From d8c0707e2700aaaa0b09b4d9db1ab968181e625a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 11 Dec 2023 17:51:36 +0100 Subject: backend/drm: return secondary backend DRM FD It can be useful for compositors to get the real DRM FD instead of the one from the parent compositor. For instance, some compositors might want to perform some DRM IOCTLs there to check the driver name, fetch some DRM resources, etc. This will also be a requirement for direct scanout on secondary GPUs. --- backend/drm/backend.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/drm/backend.c b/backend/drm/backend.c index c50e278b..655a1856 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -73,12 +73,7 @@ static void backend_destroy(struct wlr_backend *backend) { static int backend_get_drm_fd(struct wlr_backend *backend) { struct wlr_drm_backend *drm = get_drm_backend_from_backend(backend); - - if (drm->parent) { - return drm->parent->fd; - } else { - return drm->fd; - } + return drm->fd; } static uint32_t drm_backend_get_buffer_caps(struct wlr_backend *backend) { -- cgit v1.2.3