compositor-drm: Check that that we have a valid bo for scanout

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 <rob@linux.intel.com>
Rob Bradford 12 years ago committed by Kristian Høgsberg
parent 6e1e385d51
commit 9b1018702d
  1. 4
      src/compositor-drm.c

@ -292,6 +292,10 @@ drm_output_prepare_scanout_surface(struct weston_output *_output,
bo = gbm_bo_import(c->gbm, GBM_BO_IMPORT_WL_BUFFER, bo = gbm_bo_import(c->gbm, GBM_BO_IMPORT_WL_BUFFER,
es->buffer, GBM_BO_USE_SCANOUT); 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 /* Need to verify output->region contained in surface opaque
* region. Or maybe just that format doesn't have alpha. * region. Or maybe just that format doesn't have alpha.
* For now, scanout only if format is XRGB8888. */ * For now, scanout only if format is XRGB8888. */

Loading…
Cancel
Save