xf86-video-intel: 4 commits - src/sna/gen2_render.c src/sna/gen3_render.c src/sna/gen6_render.c src/sna/sna_accel.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jan 20 14:17:50 PST 2012


 src/sna/gen2_render.c |    1 
 src/sna/gen3_render.c |    2 +
 src/sna/gen6_render.c |   67 +++++++++++++++++++++-----------------------------
 src/sna/sna_accel.c   |   65 +++++++++++++++++++++++-------------------------
 4 files changed, 63 insertions(+), 72 deletions(-)

New commits:
commit 20006a9ae7f993f02c45ccbc1e414d74bfee3acd
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jan 20 22:17:44 2012 +0000

    sna: Cleanup PolyText and ImageText fallback debugging
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 08a5e25..8801477 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -9099,12 +9099,6 @@ sna_poly_text8(DrawablePtr drawable, GCPtr gc,
 	if (drawable->depth < 8)
 		goto fallback;
 
-	if (FORCE_FALLBACK)
-		goto force_fallback;
-
-	if (!ACCEL_POLY_TEXT8)
-		goto force_fallback;
-
 	for (i = n = 0; i < count; i++) {
 		if (sna_get_glyph8(gc->font, priv, chars[i], &info[n]))
 			n++;
@@ -9128,6 +9122,12 @@ sna_poly_text8(DrawablePtr drawable, GCPtr gc,
 	if (!RegionNotEmpty(&region))
 		return x + extents.overallRight;
 
+	if (FORCE_FALLBACK)
+		goto force_fallback;
+
+	if (!ACCEL_POLY_TEXT8)
+		goto force_fallback;
+
 	if (!sna_glyph_blt(drawable, gc, x, y, n, info, &region, true)) {
 force_fallback:
 		DBG(("%s: fallback\n", __FUNCTION__));
@@ -9181,13 +9181,7 @@ sna_poly_text16(DrawablePtr drawable, GCPtr gc,
 	if (drawable->depth < 8)
 		goto fallback;
 
-	if (FORCE_FALLBACK)
-		goto force_fallback;
-
-	if (!ACCEL_POLY_TEXT16)
-		goto force_fallback;
-
-	for (i = n =  0; i < count; i++) {
+	for (i = n = 0; i < count; i++) {
 		if (sna_get_glyph16(gc->font, priv, chars[i], &info[n]))
 			n++;
 	}
@@ -9210,6 +9204,12 @@ sna_poly_text16(DrawablePtr drawable, GCPtr gc,
 	if (!RegionNotEmpty(&region))
 		return x + extents.overallRight;
 
+	if (FORCE_FALLBACK)
+		goto force_fallback;
+
+	if (!ACCEL_POLY_TEXT16)
+		goto force_fallback;
+
 	if (!sna_glyph_blt(drawable, gc, x, y, n, info, &region, true)) {
 force_fallback:
 		DBG(("%s: fallback\n", __FUNCTION__));
@@ -9263,12 +9263,6 @@ sna_image_text8(DrawablePtr drawable, GCPtr gc,
 	if (drawable->depth < 8)
 		goto fallback;
 
-	if (FORCE_FALLBACK)
-		goto force_fallback;
-
-	if (!ACCEL_IMAGE_TEXT8)
-		goto force_fallback;
-
 	for (i = n = 0; i < count; i++) {
 		if (sna_get_glyph8(gc->font, priv, chars[i], &info[n]))
 			n++;
@@ -9292,6 +9286,12 @@ sna_image_text8(DrawablePtr drawable, GCPtr gc,
 	if (!RegionNotEmpty(&region))
 		return;
 
+	if (FORCE_FALLBACK)
+		goto force_fallback;
+
+	if (!ACCEL_IMAGE_TEXT8)
+		goto force_fallback;
+
 	if (!sna_glyph_blt(drawable, gc, x, y, n, info, &region, false)) {
 force_fallback:
 		DBG(("%s: fallback\n", __FUNCTION__));
@@ -9337,12 +9337,6 @@ sna_image_text16(DrawablePtr drawable, GCPtr gc,
 	if (drawable->depth < 8)
 		goto fallback;
 
-	if (FORCE_FALLBACK)
-		goto force_fallback;
-
-	if (!ACCEL_IMAGE_TEXT16)
-		goto force_fallback;
-
 	for (i = n = 0; i < count; i++) {
 		if (sna_get_glyph16(gc->font, priv, chars[i], &info[n]))
 			n++;
@@ -9366,6 +9360,12 @@ sna_image_text16(DrawablePtr drawable, GCPtr gc,
 	if (!RegionNotEmpty(&region))
 		return;
 
+	if (FORCE_FALLBACK)
+		goto force_fallback;
+
+	if (!ACCEL_IMAGE_TEXT16)
+		goto force_fallback;
+
 	if (!sna_glyph_blt(drawable, gc, x, y, n, info, &region, false)) {
 force_fallback:
 		DBG(("%s: fallback\n", __FUNCTION__));
@@ -9615,10 +9615,8 @@ sna_image_glyph(DrawablePtr drawable, GCPtr gc,
 
 	if (sna_drawable_use_gpu_bo(drawable, &region.extents, &damage) &&
 	    sna_reversed_glyph_blt(drawable, gc, x, y, n, info, base,
-				   damage, &region, false)) {
-		RegionUninit(&region);
-		return;
-	}
+				   damage, &region, false))
+		goto out;
 
 fallback:
 	DBG(("%s: fallback\n", __FUNCTION__));
@@ -9683,10 +9681,8 @@ sna_poly_glyph(DrawablePtr drawable, GCPtr gc,
 
 	if (sna_drawable_use_gpu_bo(drawable, &region.extents, &damage) &&
 	    sna_reversed_glyph_blt(drawable, gc, x, y, n, info, base,
-				   damage, &region, true)) {
-		RegionUninit(&region);
-		return;
-	}
+				   damage, &region, true))
+		goto out;
 
 fallback:
 	DBG(("%s: fallback\n", __FUNCTION__));
commit 3fbd7cafb4394e0641565dc794b82bef615b4aac
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jan 20 22:16:53 2012 +0000

    sna: Copy the glyphs metrics before checking for an empty glyph
    
    The empty glyph still needs the correct advance, and copying it too late
    left it as zero and so we were collapsing spaces in PolyText8 and
    friends.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 9b934d6..08a5e25 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -9009,6 +9009,8 @@ static bool sna_set_glyph(CharInfoPtr in, CharInfoPtr out)
 	int stride = GLYPHWIDTHBYTESPADDED(in);
 	uint8_t *dst, *src;
 
+	out->metrics = in->metrics;
+
 	/* Skip empty glyphs */
 	if (w == 0 || h == 0 || ((w|h) == 1 && (in->bits[0] & 1) == 0)) {
 		out->bits = (void *)1;
@@ -9017,7 +9019,6 @@ static bool sna_set_glyph(CharInfoPtr in, CharInfoPtr out)
 
 	w = (w + 7) >> 3;
 
-	out->metrics = in->metrics;
 	out->bits = malloc((w*h + 7) & ~7);
 	if (out->bits == NULL)
 		return false;
commit f0d8f5d377460bb7da82546e8304252312e97147
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jan 20 14:34:28 2012 +0000

    sna/gen3: Set bo to NULL for render_fill_one
    
    It had to happen, I missed one! From fc9531fc2df.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 6981576..d75a412 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -2218,6 +2218,7 @@ gen2_render_composite_spans(struct sna *sna,
 		else if (tmp->base.src.is_affine)
 			tmp->prim_emit = gen2_emit_composite_spans_primitive_affine_source;
 	}
+	tmp->base.mask.bo = NULL;
 	tmp->base.floats_per_rect = 3*tmp->base.floats_per_vertex;
 
 	tmp->box   = gen2_render_composite_spans_box;
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index ad42fc7..f749afb 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -1979,6 +1979,7 @@ gen3_init_solid(struct sna_composite_channel *channel, uint32_t color)
 	else if (color == 0xffffffff)
 		channel->u.gen3.type = SHADER_WHITE;
 
+	channel->bo = NULL;
 	channel->is_opaque = (color & 0xff000000) == 0xff000000;
 	channel->is_affine = 1;
 	channel->alpha_fixup = 0;
@@ -4321,6 +4322,7 @@ gen3_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
 
 	gen3_init_solid(&tmp.src,
 			sna_rgba_for_color(color, dst->drawable.depth));
+	tmp.mask.bo = NULL;
 	tmp.mask.u.gen3.type = SHADER_NONE;
 	tmp.u.gen3.num_constants = 0;
 
commit 0286ddbd67d3b2585ffa3deccb7eeb674cd7a3e0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jan 20 11:33:05 2012 +0000

    sna/gen6: Cleanup non-pipelined w/a
    
    Move the workaround CS stall into the emit drawrect which is the only
    non-pipelined op we emit. This removes the split between deciding
    whether we will emit a drawrect and actual emission.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index cf747db..60b0446 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -699,22 +699,39 @@ gen6_emit_binding_table(struct sna *sna, uint16_t offset)
 }
 
 static bool
-gen6_need_drawing_rectangle(struct sna *sna,
+gen6_emit_drawing_rectangle(struct sna *sna,
 			    const struct sna_composite_op *op)
 {
 	uint32_t limit = (op->dst.height - 1) << 16 | (op->dst.width - 1);
 	uint32_t offset = (uint16_t)op->dst.y << 16 | (uint16_t)op->dst.x;
 
-	return (sna->render_state.gen6.drawrect_limit != limit ||
-		sna->render_state.gen6.drawrect_offset != offset);
-}
+	if  (sna->render_state.gen6.drawrect_limit  == limit &&
+	     sna->render_state.gen6.drawrect_offset == offset)
+		return false;
 
-static void
-gen6_emit_drawing_rectangle(struct sna *sna,
-			    const struct sna_composite_op *op)
-{
-	uint32_t limit = (op->dst.height - 1) << 16 | (op->dst.width - 1);
-	uint32_t offset = (uint16_t)op->dst.y << 16 | (uint16_t)op->dst.x;
+	/* [DevSNB-C+{W/A}] Before any depth stall flush (including those
+	 * produced by non-pipelined state commands), software needs to first
+	 * send a PIPE_CONTROL with no bits set except Post-Sync Operation !=
+	 * 0.
+	 *
+	 * [Dev-SNB{W/A}]: Pipe-control with CS-stall bit set must be sent
+	 * BEFORE the pipe-control with a post-sync op and no write-cache
+	 * flushes.
+	 */
+	OUT_BATCH(GEN6_PIPE_CONTROL | (4 - 2));
+	OUT_BATCH(GEN6_PIPE_CONTROL_CS_STALL |
+		  GEN6_PIPE_CONTROL_STALL_AT_SCOREBOARD);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+
+	OUT_BATCH(GEN6_PIPE_CONTROL | (4 - 2));
+	OUT_BATCH(GEN6_PIPE_CONTROL_WRITE_TIME);
+	OUT_BATCH(kgem_add_reloc(&sna->kgem, sna->kgem.nbatch,
+				 sna->render_state.gen6.general_bo,
+				 I915_GEM_DOMAIN_INSTRUCTION << 16 |
+				 I915_GEM_DOMAIN_INSTRUCTION,
+				 64));
+	OUT_BATCH(0);
 
 	OUT_BATCH(GEN6_3DSTATE_DRAWING_RECTANGLE | (4 - 2));
 	OUT_BATCH(0);
@@ -723,6 +740,7 @@ gen6_emit_drawing_rectangle(struct sna *sna,
 
 	sna->render_state.gen6.drawrect_offset = offset;
 	sna->render_state.gen6.drawrect_limit = limit;
+	return true;
 }
 
 static void
@@ -834,35 +852,8 @@ gen6_emit_state(struct sna *sna,
 		     op->u.gen6.nr_inputs);
 	gen6_emit_vertex_elements(sna, op);
 	need_stall = gen6_emit_binding_table(sna, wm_binding_table);
-
-	/* [DevSNB-C+{W/A}] Before any depth stall flush (including those
-	 * produced by non-pipelined state commands), software needs to first
-	 * send a PIPE_CONTROL with no bits set except Post-Sync Operation !=
-	 * 0.
-	 *
-	 * [Dev-SNB{W/A}]: Pipe-control with CS-stall bit set must be sent
-	 * BEFORE the pipe-control with a post-sync op and no write-cache
-	 * flushes.
-	 */
-	if (gen6_need_drawing_rectangle(sna, op)) {
-		OUT_BATCH(GEN6_PIPE_CONTROL | (4 - 2));
-		OUT_BATCH(GEN6_PIPE_CONTROL_CS_STALL |
-			  GEN6_PIPE_CONTROL_STALL_AT_SCOREBOARD);
-		OUT_BATCH(0);
-		OUT_BATCH(0);
-
-		OUT_BATCH(GEN6_PIPE_CONTROL | (4 - 2));
-		OUT_BATCH(GEN6_PIPE_CONTROL_WRITE_TIME);
-		OUT_BATCH(kgem_add_reloc(&sna->kgem, sna->kgem.nbatch,
-					 sna->render_state.gen6.general_bo,
-					 I915_GEM_DOMAIN_INSTRUCTION << 16 |
-					 I915_GEM_DOMAIN_INSTRUCTION,
-					 64));
-		OUT_BATCH(0);
-
-		gen6_emit_drawing_rectangle(sna, op);
+	if (gen6_emit_drawing_rectangle(sna, op))
 		need_stall = false;
-	}
 	if (kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo)) {
 		gen6_emit_flush(sna);
 		kgem_clear_dirty(&sna->kgem);


More information about the xorg-commit mailing list