mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 07:01:57 -07:00
renderer: Explicit sync fixes (#7151)
Enables explicit sync by default for most platforms `misc:no_direct_scanout` -> `render:direct_scanout`
This commit is contained in:
@@ -2870,7 +2870,7 @@ SP<CEGLSync> CHyprOpenGLImpl::createEGLSync(int fenceFD) {
|
||||
std::vector<EGLint> attribs;
|
||||
int dupFd = -1;
|
||||
if (fenceFD > 0) {
|
||||
int dupFd = fcntl(fenceFD, F_DUPFD_CLOEXEC, 0);
|
||||
dupFd = fcntl(fenceFD, F_DUPFD_CLOEXEC, 0);
|
||||
if (dupFd < 0) {
|
||||
Debug::log(ERR, "createEGLSync: dup failed");
|
||||
return nullptr;
|
||||
@@ -2889,8 +2889,18 @@ SP<CEGLSync> CHyprOpenGLImpl::createEGLSync(int fenceFD) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto eglsync = SP<CEGLSync>(new CEGLSync);
|
||||
eglsync->sync = sync;
|
||||
// we need to flush otherwise we might not get a valid fd
|
||||
glFlush();
|
||||
|
||||
int fd = g_pHyprOpenGL->m_sProc.eglDupNativeFenceFDANDROID(g_pHyprOpenGL->m_pEglDisplay, sync);
|
||||
if (fd == EGL_NO_NATIVE_FENCE_FD_ANDROID) {
|
||||
Debug::log(ERR, "eglDupNativeFenceFDANDROID failed");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto eglsync = SP<CEGLSync>(new CEGLSync);
|
||||
eglsync->sync = sync;
|
||||
eglsync->m_iFd = fd;
|
||||
return eglsync;
|
||||
}
|
||||
|
||||
@@ -2983,19 +2993,13 @@ CEGLSync::~CEGLSync() {
|
||||
|
||||
if (g_pHyprOpenGL->m_sProc.eglDestroySyncKHR(g_pHyprOpenGL->m_pEglDisplay, sync) != EGL_TRUE)
|
||||
Debug::log(ERR, "eglDestroySyncKHR failed");
|
||||
|
||||
if (m_iFd >= 0)
|
||||
close(m_iFd);
|
||||
}
|
||||
|
||||
int CEGLSync::dupFenceFD() {
|
||||
if (sync == EGL_NO_SYNC_KHR)
|
||||
return -1;
|
||||
|
||||
int fd = g_pHyprOpenGL->m_sProc.eglDupNativeFenceFDANDROID(g_pHyprOpenGL->m_pEglDisplay, sync);
|
||||
if (fd == EGL_NO_NATIVE_FENCE_FD_ANDROID) {
|
||||
Debug::log(ERR, "eglDupNativeFenceFDANDROID failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return fd;
|
||||
int CEGLSync::fd() {
|
||||
return m_iFd;
|
||||
}
|
||||
|
||||
bool CEGLSync::wait() {
|
||||
|
Reference in New Issue
Block a user