From 52baa0bffbc255ff074f96aad5454b9310f1e8b3 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 5 Oct 2023 16:15:12 +0200 Subject: [PATCH] linux_dmabuf_v1: drop split render/display workaround --- types/wlr_linux_dmabuf_v1.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/types/wlr_linux_dmabuf_v1.c b/types/wlr_linux_dmabuf_v1.c index 98409e00e..a831f86c3 100644 --- a/types/wlr_linux_dmabuf_v1.c +++ b/types/wlr_linux_dmabuf_v1.c @@ -883,24 +883,20 @@ static bool set_default_feedback(struct wlr_linux_dmabuf_v1 *linux_dmabuf, goto error_compiled; } - const char *name = NULL; - if (device->available_nodes & (1 << DRM_NODE_RENDER)) { - name = device->nodes[DRM_NODE_RENDER]; - } else { - // Likely a split display/render setup - assert(device->available_nodes & (1 << DRM_NODE_PRIMARY)); - name = device->nodes[DRM_NODE_PRIMARY]; - wlr_log(WLR_DEBUG, "DRM device %s has no render node, " - "falling back to primary node", name); - } - - int main_device_fd = open(name, O_RDWR | O_CLOEXEC); - drmFreeDevice(&device); - if (main_device_fd < 0) { - wlr_log_errno(WLR_ERROR, "Failed to open DRM device %s", name); + if (!(device->available_nodes & (1 << DRM_NODE_RENDER))) { + wlr_log(WLR_DEBUG, "DRM device has no render node"); goto error_compiled; } + const char *name = device->nodes[DRM_NODE_RENDER]; + int main_device_fd = open(name, O_RDWR | O_CLOEXEC); + if (main_device_fd < 0) { + wlr_log_errno(WLR_ERROR, "Failed to open DRM device %s", name); + drmFreeDevice(&device); + goto error_compiled; + } + drmFreeDevice(&device); + size_t tranches_len = feedback->tranches.size / sizeof(struct wlr_linux_dmabuf_feedback_v1_tranche); const struct wlr_linux_dmabuf_feedback_v1_tranche *tranches = feedback->tranches.data;