1
0
Fork 0

drm_hwcomposer: Fix HwcLayer::GetReleaseFences()

GetReleaseFences() should return release fence for the prior buffer
(not for the one assigned to layer at the moment of GetReleaseFences call).

Once not provided, old front buffer can be damaged before new buffer
presented. (Such issues start to appear once we started using
non-blocking DRM/KMS commits).

Using present (out) fence is a perfect solution, since it is
signaled once old buffer replaced with the new one.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
This commit is contained in:
Roman Stratiienko 2022-05-03 18:24:49 +03:00
parent 5f21dbc6f3
commit dd21494e00
7 changed files with 46 additions and 24 deletions

View file

@ -17,6 +17,7 @@
#ifndef UNIQUEFD_H_
#define UNIQUEFD_H_
#include <fcntl.h>
#include <unistd.h>
#include <memory>
@ -73,6 +74,11 @@ class UniqueFd {
return fd_;
}
static auto Dup(int fd) {
// NOLINTNEXTLINE(android-cloexec-dup): fcntl has issue (see issue #63)
return UniqueFd(dup(fd));
}
explicit operator bool() const {
return fd_ != kEmptyFd;
}