syncobj: use rendernode for timelines (#11087)

* syncobj: use rendernode for timelines

use rendernode for timelines instead of the drmfd, some devices dont
support to use the drmfd for this.

* opengl: use rendernode if available

use rendernode if available for CHyprOpenglImpl

* MesaDRM: use the m_drmRenderNodeFD if it exist

try use the rendernode we got from AQ if it exist.

* linuxdmabuf: use rendernode if available

use the rendernode if available already from AQ

* syncobj: prefer rendernode over displaynode

prefer the rendernode over the displaynode, and log a error if
attempting to use the protocol without explicit sync support on any of
the nodes.

* syncobj: check support on both nodes always

check support on both nodes always so it can be used later for
preferring rendernode if possible in syncobj protocol.

* syncobj: remove old var in non linux if else case

remove old m_bDrmSyncobjTimelineSupported from non linux if else case
that will fail to compile on non linux. the nodes sets support by
default to false, and if non linux it wont check for support and set it
to true.

* build: bump aq requirement

bump to 0.9.3 where rendernode support got added.

* flake.lock: update

* renderer: glfinish on software renderer

software renderers apparently bug out on implicit sync, use glfinish as
with nvidia case on implicit paths.

* flake.lock: update

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
This commit is contained in:
Tom Englund 2025-08-24 22:32:13 +02:00 committed by GitHub
parent ced38b1b0f
commit b329ea8e96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 107 additions and 59 deletions

View file

@ -69,6 +69,8 @@ CHyprRenderer::CHyprRenderer() {
m_nvidia = true;
else if (name.contains("i915"))
m_intel = true;
else if (name.contains("softpipe") || name.contains("Software Rasterizer") || name.contains("llvmpipe"))
m_software = true;
Debug::log(LOG, "DRM driver information: {} v{}.{}.{} from {} description {}", name, DRMV->version_major, DRMV->version_minor, DRMV->version_patchlevel,
std::string{DRMV->date, DRMV->date_len}, std::string{DRMV->desc, DRMV->desc_len});
@ -79,7 +81,7 @@ CHyprRenderer::CHyprRenderer() {
} else {
Debug::log(LOG, "Aq backend has no session, omitting full DRM node checks");
const auto DRMV = drmGetVersion(g_pCompositor->m_drmFD);
const auto DRMV = drmGetVersion(g_pCompositor->m_drm.fd);
if (DRMV) {
std::string name = std::string{DRMV->name, DRMV->name_len};
@ -89,6 +91,8 @@ CHyprRenderer::CHyprRenderer() {
m_nvidia = true;
else if (name.contains("i915"))
m_intel = true;
else if (name.contains("softpipe") || name.contains("Software Rasterizer") || name.contains("llvmpipe"))
m_software = true;
Debug::log(LOG, "Primary DRM driver information: {} v{}.{}.{} from {} description {}", name, DRMV->version_major, DRMV->version_minor, DRMV->version_patchlevel,
std::string{DRMV->date, DRMV->date_len}, std::string{DRMV->desc, DRMV->desc_len});
@ -2234,8 +2238,8 @@ void CHyprRenderer::endRender(const std::function<void()>& renderingDoneCallback
if (!g_pHyprOpenGL->explicitSyncSupported()) {
Debug::log(TRACE, "renderer: Explicit sync unsupported, falling back to implicit in endRender");
// nvidia doesn't have implicit sync, so we have to explicitly wait here
if (isNvidia() && *PNVIDIAANTIFLICKER)
// nvidia doesn't have implicit sync, so we have to explicitly wait here, llvmpipe and other software renderer seems to bug out aswell.
if ((isNvidia() && *PNVIDIAANTIFLICKER) || isSoftware())
glFinish();
else
glFlush(); // mark an implicit sync point
@ -2295,6 +2299,10 @@ bool CHyprRenderer::isIntel() {
return m_intel;
}
bool CHyprRenderer::isSoftware() {
return m_software;
}
bool CHyprRenderer::isMgpu() {
return m_mgpu;
}