xf86-video-intel: 3 commits - src/sna/sna_blt.c src/sna/sna_glyphs.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jun 27 05:45:42 PDT 2014


 src/sna/sna_blt.c    |   12 ++++++++----
 src/sna/sna_glyphs.c |   19 ++++++++++++-------
 2 files changed, 20 insertions(+), 11 deletions(-)

New commits:
commit a6ba93283b20a50ff36758624d2967562b7bdae9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 27 13:42:37 2014 +0100

    sna/glyphs: Add DBG option for glyph tolerance
    
    And bump it to 3 so that glyph filtering doesn't force us to use the
    mask too often.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 9b9ae10..0bb72d8 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -83,6 +83,7 @@
 
 #define N_STACK_GLYPHS 512
 #define NO_ATLAS ((PicturePtr)-1)
+#define GLYPH_TOLERANCE 3
 
 #define glyph_valid(g) *((uint32_t *)&(g)->info.width)
 #define glyph_copy_size(r, g) *(uint32_t *)&(r)->width = *(uint32_t *)&g->info.width
@@ -1517,8 +1518,10 @@ glyphs_format(int nlist, GlyphListPtr list, GlyphPtr * glyphs)
 				 * boundary is small, yet glyphs frequently
 				 * overlap on the boundaries.
 				 */
-				if (x1 < extents.x2-1 && x2 > extents.x1+1 &&
-				    y1 < extents.y2-1 && y2 > extents.y1+1) {
+				if (x1 < extents.x2-GLYPH_TOLERANCE &&
+				    x2 > extents.x1+GLYPH_TOLERANCE &&
+				    y1 < extents.y2-GLYPH_TOLERANCE &&
+				    y2 > extents.y1+GLYPH_TOLERANCE) {
 					DBG(("%s: overlapping glyph inside line, current bbox (%d, %d), (%d, %d), glyph (%d, %d), (%d, %d)\n",
 					     __FUNCTION__,
 					     extents.x1, extents.y1, extents.x2, extents.y2,
@@ -1547,10 +1550,10 @@ skip_glyph:
 		 */
 		if (!first) {
 			for (j = 0; j < i; j++) {
-				if (extents.x1 < list_extents[j].x2-1 &&
-				    extents.x2 > list_extents[j].x1+1 &&
-				    extents.y1 < list_extents[j].y2-1 &&
-				    extents.y2 > list_extents[j].y1+1) {
+				if (extents.x1 < list_extents[j].x2-GLYPH_TOLERANCE &&
+				    extents.x2 > list_extents[j].x1+GLYPH_TOLERANCE &&
+				    extents.y1 < list_extents[j].y2-GLYPH_TOLERANCE &&
+				    extents.y2 > list_extents[j].y1+GLYPH_TOLERANCE) {
 					DBG(("%s: overlapping lines, current bbox (%d, %d), (%d, %d), previous line (%d, %d), (%d, %d)\n",
 					     __FUNCTION__,
 					     extents.x1, extents.y1, extents.x2, extents.y2,
commit ee5c74deee77db4292ce197ab7facca422f86021
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 27 12:56:43 2014 +0100

    sna/glyphs: Add DBG option for forcing glyphs-to-dst
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 28cb58d..9b9ae10 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -70,6 +70,7 @@
 #define FALLBACK 0
 #define NO_GLYPH_CACHE 0
 #define NO_GLYPHS_TO_DST 0
+#define FORCE_GLYPHS_TO_DST 0
 #define NO_GLYPHS_VIA_MASK 0
 #define FORCE_SMALL_MASK 0 /* -1 = never, 1 = always */
 #define NO_GLYPHS_SLOW 0
@@ -1991,7 +1992,8 @@ sna_glyphs(CARD8 op,
 	}
 
 	/* Try to discard the mask for non-overlapping glyphs */
-	if (mask == NULL ||
+	if (FORCE_GLYPHS_TO_DST ||
+	    mask == NULL ||
 	    (dst->pCompositeClip->data == NULL &&
 	     can_discard_mask(op, src, mask, nlist, list, glyphs))) {
 		DBG(("%s: discarding mask\n", __FUNCTION__));
commit 6ba4ee1fe842e975c94a01f93c6d39c20eadadbe
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 27 10:38:59 2014 +0100

    sna: Check source bo is suitable for BLT before doing so
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index 98bd49b..99cb7d2 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -2804,8 +2804,13 @@ fill:
 		if (!tmp->dst.bo) {
 			DBG(("%s: fallback -- unaccelerated read back\n",
 			     __FUNCTION__));
+fallback:
 			if (flags & COMPOSITE_FALLBACK || !kgem_bo_is_busy(bo))
 				goto put;
+		} else if (!kgem_bo_can_blt(&sna->kgem, bo)) {
+			DBG(("%s: fallback -- cannot blit from source\n",
+			     __FUNCTION__));
+			goto fallback;
 		} else if (bo->snoop && tmp->dst.bo->snoop) {
 			DBG(("%s: fallback -- can not copy between snooped bo\n",
 			     __FUNCTION__));
@@ -2813,12 +2818,11 @@ fill:
 		} else if (!kgem_bo_can_blt(&sna->kgem, tmp->dst.bo)) {
 			DBG(("%s: fallback -- unaccelerated upload\n",
 			     __FUNCTION__));
-			if (flags & COMPOSITE_FALLBACK || !kgem_bo_is_busy(bo))
-				goto put;
+			goto fallback;
 		} else {
 			ret = prepare_blt_copy(sna, tmp, bo, alpha_fixup);
-			if (flags & COMPOSITE_FALLBACK && !ret)
-				goto put;
+			if (!ret)
+				goto fallback;
 		}
 	} else {
 		RegionRec region;


More information about the xorg-commit mailing list