[PATCH 2/3] compositor-drm: alow scanning out of buffers with XRGB8888 format

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Wed May 2 06:42:22 PDT 2012


---
 src/compositor-drm.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index a05b2c8..21e59c8 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -238,10 +238,6 @@ drm_output_prepare_scanout_surface(struct drm_output *output)
 	es = container_of(c->base.surface_list.next,
 			  struct weston_surface, link);
 
-	/* Need to verify output->region contained in surface opaque
-	 * region.  Or maybe just that format doesn't have alpha. */
-	return -1;
-
 	if (es->geometry.x != output->base.x ||
 	    es->geometry.y != output->base.y ||
 	    es->geometry.width != output->base.current->width ||
@@ -256,6 +252,14 @@ drm_output_prepare_scanout_surface(struct drm_output *output)
 					  es->geometry.height,
 					  GBM_BO_USE_SCANOUT);
 
+	/* 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. */
+	if (gbm_bo_get_format(bo) != GBM_FORMAT_XRGB8888) {
+		gbm_bo_destroy(bo);
+		return -1;
+	}
+
 	output->next = drm_fb_get_from_bo(bo, output);
 	if (!output->next) {
 		gbm_bo_destroy(bo);
-- 
1.7.4.1



More information about the wayland-devel mailing list