aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-06-19 11:43:04 +0200
committerAlexander Orzechowski <alex@ozal.ski>2023-06-19 19:36:17 +0000
commitbe73da28b24f3250178a0c5448e835f810f75f28 (patch)
treef6d9b79f5a9fb5703538ad6a2aa1be8d7a43864c /render
parente8887f76ed3eb683b7d4644289615aafb47fafa6 (diff)
allocator: only use DRM auth if we are master
Legacy DRM auth will only work if we are DRM master. Keep using an unauthenticated DRM FD if we are not DRM master. This should be enough for GBM. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3674
Diffstat (limited to 'render')
-rw-r--r--render/allocator/allocator.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/render/allocator/allocator.c b/render/allocator/allocator.c
index b380584c..10284cdd 100644
--- a/render/allocator/allocator.c
+++ b/render/allocator/allocator.c
@@ -69,11 +69,11 @@ static int reopen_drm_node(int drm_fd, bool allow_render_node) {
free(name);
- // If we're using a DRM primary node (e.g. because we're running under the
- // DRM backend, or because we're on split render/display machine), we need
- // to use the legacy DRM authentication mechanism to have the permission to
- // manipulate buffers.
- if (drmGetNodeTypeFromFd(new_fd) == DRM_NODE_PRIMARY) {
+ // If we're using a DRM primary node and we are DRM master (e.g. because
+ // we're running under the DRM backend), we need to use the legacy DRM
+ // authentication mechanism to have the permission to manipulate DRM dumb
+ // buffers.
+ if (drmIsMaster(drm_fd) && drmGetNodeTypeFromFd(new_fd) == DRM_NODE_PRIMARY) {
drm_magic_t magic;
if (drmGetMagic(new_fd, &magic) < 0) {
wlr_log_errno(WLR_ERROR, "drmGetMagic failed");