From: Rob Bradford <r...@linux.intel.com>

If gbm_bo_import does not return a valid buffer for usage of
GBM_BO_USE_SCANOUT don't try and scan out the surface directly.

We've caught the SHM case explicitly earlier - this is to prevent other cases
where the bo cannot be scanned out.

Signed-off-by: Rob Bradford <r...@linux.intel.com>
---
 src/compositor-drm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 10f16bd..afaa2a9 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -295,6 +295,10 @@ drm_output_prepare_scanout_surface(struct weston_output 
*_output,
        bo = gbm_bo_import(c->gbm, GBM_BO_IMPORT_WL_BUFFER,
                           es->buffer, GBM_BO_USE_SCANOUT);
 
+       /* Unable to use the buffer for scanout */
+       if (!bo)
+               return NULL;
+
        /* Need to verify output->region contained in surface opaque
         * region.  Or maybe just that format doesn't have alpha.
         * For now, scanout only if format is XRGB8888. */
-- 
1.7.11.2

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to