xf86-video-intel: src/i965_render.c

Chris Wilson ickle at kemper.freedesktop.org
Sat Dec 4 16:28:26 PST 2010


 src/i965_render.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

New commits:
commit f40f8bcf07bd7f496bfd3069eddfcbeb3d1bf8be
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Dec 5 00:26:22 2010 +0000

    i965: Check for potential vertex array overflow every time
    
    There was a reason why we need to check at the start of every composite
    operation to see if we have enough space in the array to fit the
    vertices, which I promptly forgot when moving the code around to make
    it look pretty.
    
    * sigh.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/i965_render.c b/src/i965_render.c
index 2e1c3f7..659e2d1 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1836,19 +1836,19 @@ i965_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY,
 			i965_emit_composite_state(scrn);
 	}
 
-	if (intel->vertex_offset == 0) {
-		if (intel->vertex_used &&
-		    intel->floats_per_vertex != intel->last_floats_per_vertex) {
-			intel->vertex_index = (intel->vertex_used + intel->floats_per_vertex - 1) / intel->floats_per_vertex;
-			intel->vertex_used = intel->vertex_index * intel->floats_per_vertex;
-		}
-		if (intel->floats_per_vertex != intel->last_floats_per_vertex ||
-		    intel_vertex_space(intel) < 3*4*intel->floats_per_vertex) {
-			intel_next_vertex(intel);
-			i965_select_vertex_buffer(intel);
-			intel->vertex_index = 0;
-		}
+	if (intel->vertex_used &&
+	    intel->floats_per_vertex != intel->last_floats_per_vertex) {
+		intel->vertex_index = (intel->vertex_used + intel->floats_per_vertex - 1) / intel->floats_per_vertex;
+		intel->vertex_used = intel->vertex_index * intel->floats_per_vertex;
+	}
+	if (intel->floats_per_vertex != intel->last_floats_per_vertex ||
+	    intel_vertex_space(intel) < 3*4*intel->floats_per_vertex) {
+		intel_next_vertex(intel);
+		i965_select_vertex_buffer(intel);
+		intel->vertex_index = 0;
+	}
 
+	if (intel->vertex_offset == 0) {
 		OUT_BATCH(BRW_3DPRIMITIVE |
 			  BRW_3DPRIMITIVE_VERTEX_SEQUENTIAL |
 			  (_3DPRIM_RECTLIST << BRW_3DPRIMITIVE_TOPOLOGY_SHIFT) |


More information about the xorg-commit mailing list