compositor-drm: fix gbm_bo_get_handle_for_plane error handling

gbm_bo_get_handle_for_plane returns -1 on error, not 0.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
dev
Philipp Zabel 6 years ago committed by Philipp Zabel
parent 2914a6da8b
commit 1c49b5445e
  1. 7
      libweston/compositor-drm.c

@ -1246,9 +1246,12 @@ drm_fb_get_from_dmabuf(struct linux_dmabuf_buffer *dmabuf,
fb->num_planes = dmabuf->attributes.n_planes; fb->num_planes = dmabuf->attributes.n_planes;
for (i = 0; i < dmabuf->attributes.n_planes; i++) { for (i = 0; i < dmabuf->attributes.n_planes; i++) {
fb->handles[i] = gbm_bo_get_handle_for_plane(fb->bo, i).u32; union gbm_bo_handle handle;
if (!fb->handles[i])
handle = gbm_bo_get_handle_for_plane(fb->bo, i);
if (handle.s32 == -1)
goto err_free; goto err_free;
fb->handles[i] = handle.u32;
} }
if (drm_fb_addfb(backend, fb) != 0) if (drm_fb_addfb(backend, fb) != 0)

Loading…
Cancel
Save