From d6791cc5ce0b52c0de627737915022e48660e774 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Tue, 16 Jul 2024 09:53:50 +0000 Subject: [PATCH] drm: properly check master node after 05219d5287df (#17) [LOG] [AQ] reopenDRMNode: drmModeCreateLease failed, falling back to open [LOG] [AQ] reopenDRMNode: opening node /dev/dri/renderD128 [ERR] [AQ] reopenDRMNode: drmGetMagic failed: Permission denied --- src/backend/Backend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/Backend.cpp b/src/backend/Backend.cpp index 7a50fc5..64eb9a0 100644 --- a/src/backend/Backend.cpp +++ b/src/backend/Backend.cpp @@ -311,7 +311,7 @@ int Aquamarine::CBackend::reopenDRMNode(int drmFD, bool allowRenderNode) { free(name); // We need to authenticate if we are using a DRM primary node and are the master - if (drmIsMaster(drmFD) && drmGetNodeTypeFromFd(drmFD) == DRM_NODE_PRIMARY) { + if (drmIsMaster(drmFD) && drmGetNodeTypeFromFd(newFD) == DRM_NODE_PRIMARY) { drm_magic_t magic; if (int ret = drmGetMagic(newFD, &magic); ret < 0) { log(AQ_LOG_ERROR, std::format("reopenDRMNode: drmGetMagic failed: {}", strerror(-ret))); @@ -319,7 +319,7 @@ int Aquamarine::CBackend::reopenDRMNode(int drmFD, bool allowRenderNode) { return -1; } - if (int ret = drmAuthMagic(newFD, magic); ret < 0) { + if (int ret = drmAuthMagic(drmFD, magic); ret < 0) { log(AQ_LOG_ERROR, std::format("reopenDRMNode: drmAuthMagic failed: {}", strerror(-ret))); close(newFD); return -1;