xf86-video-intel: 3 commits - src/sna/blt.c src/sna/compiler.h src/sna/sna_display.c src/sna/sna_glyphs.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Aug 1 03:18:44 PDT 2013


 src/sna/blt.c         |   10 +++++++++-
 src/sna/compiler.h    |    4 ++++
 src/sna/sna_display.c |   23 ++++++++++++++++-------
 src/sna/sna_glyphs.c  |   11 ++++++-----
 4 files changed, 35 insertions(+), 13 deletions(-)

New commits:
commit 0ae07158c3550b418d3596cacda33a64ee653790
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Aug 1 11:01:14 2013 +0100

    sna: Add a few more details to the log for mode switching
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 17e2de1..f13b423 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1386,6 +1386,17 @@ static char *outputs_for_crtc(xf86CrtcPtr crtc, char *outputs, int max)
 	return outputs;
 }
 
+static const char *rotation_to_str(Rotation rotation)
+{
+	switch (rotation) {
+	case RR_Rotate_0: return "normal";
+	case RR_Rotate_90: return "right";
+	case RR_Rotate_180: return "inverted";
+	case RR_Rotate_270: return "left";
+	default: return "unknown";
+	}
+}
+
 static Bool
 sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 			Rotation rotation, int x, int y)
@@ -1402,13 +1413,11 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		return FALSE;
 
 	xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO,
-		   "switch to mode %dx%d on pipe %d using %s\n",
-		   mode->HDisplay, mode->VDisplay, sna_crtc->pipe,
-		   outputs_for_crtc(crtc, outputs, sizeof(outputs)));
-
-	DBG(("%s(crtc=%d [pipe=%d] rotation=%d, x=%d, y=%d, mode=%dx%d@%d)\n",
-	     __FUNCTION__, sna_crtc->id, sna_crtc->pipe, rotation, x, y,
-	     mode->HDisplay, mode->VDisplay, mode->Clock));
+		   "switch to mode %dx%d@%.1f on pipe %d using %s, position (%d, %d), rotation %s\n",
+		   mode->HDisplay, mode->VDisplay, xf86ModeVRefresh(mode),
+		   sna_crtc->pipe,
+		   outputs_for_crtc(crtc, outputs, sizeof(outputs)),
+		   x, y, rotation_to_str(rotation));
 
 	assert(mode->HDisplay <= sna->mode.kmode->max_width &&
 	       mode->VDisplay <= sna->mode.kmode->max_height);
commit 246911d742569eed6675698c1e51032ba50917d3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Aug 1 10:52:44 2013 +0100

    sna: Don't force inline string-ops for the general memcpy_blt routine
    
    As we need optimal copy code for the general case, where unlike
    swizzling the run lengths are not known before hand, we need to call the
    arch specific routines from glibc.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/blt.c b/src/sna/blt.c
index 4a33093..4c27678 100644
--- a/src/sna/blt.c
+++ b/src/sna/blt.c
@@ -138,7 +138,7 @@ xmm_save_128(__m128i *dst, __m128i data)
 }
 #endif
 
-fast_memcpy void
+fast void
 memcpy_blt(const void *src, void *dst, int bpp,
 	   int32_t src_stride, int32_t dst_stride,
 	   int16_t src_x, int16_t src_y,
@@ -202,6 +202,14 @@ memcpy_blt(const void *src, void *dst, int bpp,
 			dst_bytes += dst_stride;
 		} while (--height);
 		break;
+	case 16:
+		do {
+			((uint64_t *)dst_bytes)[0] = ((const uint64_t *)src_bytes)[0];
+			((uint64_t *)dst_bytes)[1] = ((const uint64_t *)src_bytes)[1];
+			src_bytes += src_stride;
+			dst_bytes += dst_stride;
+		} while (--height);
+		break;
 
 	default:
 		do {
diff --git a/src/sna/compiler.h b/src/sna/compiler.h
index 9c1b2f1..2f5dfc7 100644
--- a/src/sna/compiler.h
+++ b/src/sna/compiler.h
@@ -66,6 +66,10 @@
 #endif
 
 #if HAS_GCC(4, 6) && defined(__OPTIMIZE__)
+#define fast __attribute__((optimize("Ofast")))
+#endif
+
+#if HAS_GCC(4, 6) && defined(__OPTIMIZE__)
 #define fast_memcpy __attribute__((optimize("Ofast"))) __attribute__((target("inline-all-stringops")))
 #elif HAS_GCC(4, 5) && defined(__OPTIMIZE__)
 #define fast_memcpy __attribute__((target("inline-all-stringops")))
commit 8174c56c3ad6f1b0e6cd432c888f3eaca91159b4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Aug 1 09:19:17 2013 +0100

    sna/glyphs: Allow glyphs-to-dst to discard CA masks for a8 glyphs
    
    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 43086a0..7e6aab3 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -1233,11 +1233,8 @@ glyphs_format(int nlist, GlyphListPtr list, GlyphPtr * glyphs)
 		while (n--) {
 			GlyphPtr glyph = *glyphs++;
 
-			if (!glyph_valid(glyph)) {
-				x += glyph->info.xOff;
-				y += glyph->info.yOff;
-				continue;
-			}
+			if (!glyph_valid(glyph))
+				goto skip_glyph;
 
 			x1 = x - glyph->info.x;
 			y1 = y - glyph->info.y;
@@ -1273,6 +1270,7 @@ glyphs_format(int nlist, GlyphListPtr list, GlyphPtr * glyphs)
 				if (y2 > extents.y2)
 					extents.y2 = y2;
 			}
+skip_glyph:
 			x += glyph->info.xOff;
 			y += glyph->info.yOff;
 		}
@@ -1330,6 +1328,9 @@ static bool can_discard_mask(uint8_t op, PicturePtr src, PictFormatPtr mask,
 			list++;
 		}
 	} else {
+		if (PICT_FORMAT_A(mask->format) >= PICT_FORMAT_A(g->format))
+			return true;
+
 		if (g->depth != 1)
 			return false;
 	}


More information about the xorg-commit mailing list