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:
parent
ced38b1b0f
commit
b329ea8e96
12 changed files with 107 additions and 59 deletions
|
|
@ -169,7 +169,7 @@ void CCompositor::restoreNofile() {
|
|||
}
|
||||
|
||||
bool CCompositor::supportsDrmSyncobjTimeline() const {
|
||||
return m_bDrmSyncobjTimelineSupported;
|
||||
return m_drm.syncobjSupport || m_drmRenderNode.syncObjSupport;
|
||||
}
|
||||
|
||||
void CCompositor::setMallocThreshold() {
|
||||
|
|
@ -356,22 +356,32 @@ void CCompositor::initServer(std::string socketName, int socketFd) {
|
|||
|
||||
m_initialized = true;
|
||||
|
||||
m_drmFD = m_aqBackend->drmFD();
|
||||
Debug::log(LOG, "Running on DRMFD: {}", m_drmFD);
|
||||
m_drm.fd = m_aqBackend->drmFD();
|
||||
Debug::log(LOG, "Running on DRMFD: {}", m_drm.fd);
|
||||
|
||||
m_drmRenderNode.fd = m_aqBackend->drmRenderNodeFD();
|
||||
Debug::log(LOG, "Using RENDERNODEFD: {}", m_drmRenderNode.fd);
|
||||
|
||||
#if defined(__linux__)
|
||||
if (m_drmFD >= 0) {
|
||||
uint64_t cap = 0;
|
||||
int ret = drmGetCap(m_drmFD, DRM_CAP_SYNCOBJ_TIMELINE, &cap);
|
||||
m_bDrmSyncobjTimelineSupported = (ret == 0 && cap != 0);
|
||||
Debug::log(LOG, "DRM syncobj timeline support: {}", m_bDrmSyncobjTimelineSupported ? "yes" : "no");
|
||||
} else {
|
||||
m_bDrmSyncobjTimelineSupported = false;
|
||||
Debug::log(LOG, "DRM syncobj timeline support: no (no DRM FD)");
|
||||
}
|
||||
auto syncObjSupport = [](auto fd) {
|
||||
if (fd < 0)
|
||||
return false;
|
||||
|
||||
uint64_t cap = 0;
|
||||
int ret = drmGetCap(fd, DRM_CAP_SYNCOBJ_TIMELINE, &cap);
|
||||
return ret == 0 && cap != 0;
|
||||
};
|
||||
|
||||
if ((m_drm.syncobjSupport = syncObjSupport(m_drm.fd)))
|
||||
Debug::log(LOG, "DRM DisplayNode syncobj timeline support: {}", m_drm.syncobjSupport ? "yes" : "no");
|
||||
|
||||
if ((m_drmRenderNode.syncObjSupport = syncObjSupport(m_drmRenderNode.fd)))
|
||||
Debug::log(LOG, "DRM RenderNode syncobj timeline support: {}", m_drmRenderNode.syncObjSupport ? "yes" : "no");
|
||||
|
||||
if (!m_drm.syncobjSupport && !m_drmRenderNode.syncObjSupport)
|
||||
Debug::log(LOG, "DRM no syncobj support, disabling explicit sync");
|
||||
#else
|
||||
Debug::log(LOG, "DRM syncobj timeline support: no (not linux)");
|
||||
m_bDrmSyncobjTimelineSupported = false;
|
||||
#endif
|
||||
|
||||
if (!socketName.empty() && socketFd != -1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue