[Glamor] [PATCH 4/5] glamor_set_alu: Added GXclear support at glamor_solid.

Zhigang Gong zhigang.gong at linux.intel.com
Fri Apr 6 06:28:57 PDT 2012


We don't need to issue the glamor_fallback at the glamor_set_alu
routine, as the caller may support GXclear or other most frequent
Ops. Leave it to the caller to determine fallback or not.

Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
---
 src/glamor_fill.c   |    9 +++++++--
 src/glamor_pixmap.c |    5 +----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/glamor_fill.c b/src/glamor_fill.c
index 53c750a..4cee485 100644
--- a/src/glamor_fill.c
+++ b/src/glamor_fill.c
@@ -190,8 +190,13 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
 
 	dispatch = glamor_get_dispatch(glamor_priv);
 	if (!glamor_set_alu(dispatch, alu)) {
-		glamor_put_dispatch(glamor_priv);
-		return FALSE;
+		if (alu == GXclear)
+			color[0] = color[1] = color[2] = color[3] = 0.0;
+		else {
+			glamor_fallback("unsupported alu %x\n", alu);
+			glamor_put_dispatch(glamor_priv);
+			return FALSE;
+		}
 	}
 	dispatch->glUseProgram(glamor_priv->solid_prog);
 
diff --git a/src/glamor_pixmap.c b/src/glamor_pixmap.c
index 35b2d56..066d9a7 100644
--- a/src/glamor_pixmap.c
+++ b/src/glamor_pixmap.c
@@ -204,10 +204,8 @@ glamor_set_alu(struct glamor_gl_dispatch *dispatch, unsigned char alu)
 		return FALSE;
 	}
 #else
-	if (alu != GXcopy) {
-		glamor_fallback("unsupported alu %x\n", alu);
+	if (alu != GXcopy)
 		return FALSE;
-	}
 #endif
 	return TRUE;
 }
@@ -872,7 +870,6 @@ glamor_es2_pixmap_read_prepare(PixmapPtr source, GLenum format,
 	return temp_fbo;
 }
 
-
 /**
  * Move a pixmap to CPU memory.
  * The input data is the pixmap's fbo.
-- 
1.7.4.4



More information about the Glamor mailing list