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 <m.olbrich@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
dev
Michael Olbrich 3 years ago committed by Daniel Stone
parent c0cafde80f
commit 83d1eafd81
  1. 3
      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;

Loading…
Cancel
Save