From 83d1eafd817b40ede7081f81116f64f4b3d358f3 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Wed, 20 Oct 2021 15:08:01 +0200 Subject: [PATCH] backend-drm: virtual: use the DRM fd from the fb The fb already contains a DRM fd for later use. So just use that one instead of fetching it from the backend. This is necessary if the fbs are allocated on different devices, since otherwise the wrong device might be used to get the fd of the passed fb. Signed-off-by: Michael Olbrich Signed-off-by: Michael Tretter --- libweston/backend-drm/drm-virtual.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libweston/backend-drm/drm-virtual.c b/libweston/backend-drm/drm-virtual.c index 3be2feb3..d3e5b720 100644 --- a/libweston/backend-drm/drm-virtual.c +++ b/libweston/backend-drm/drm-virtual.c @@ -163,11 +163,10 @@ static int drm_virtual_output_submit_frame(struct drm_output *output, struct drm_fb *fb) { - struct drm_backend *b = to_drm_backend(output->base.compositor); int fd, ret; assert(fb->num_planes == 1); - ret = drmPrimeHandleToFD(b->drm.fd, fb->handles[0], DRM_CLOEXEC, &fd); + ret = drmPrimeHandleToFD(fb->fd, fb->handles[0], DRM_CLOEXEC, &fd); if (ret) { weston_log("drmPrimeHandleFD failed, errno=%d\n", errno); return -1;