xf86-video-intel: 3 commits - src/sna/sna_accel.c src/sna/sna_trapezoids.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Jun 18 03:42:40 PDT 2012


 src/sna/sna_accel.c      |   19 ++++++++++++-------
 src/sna/sna_trapezoids.c |   39 +++++++++++++++++++++++----------------
 2 files changed, 35 insertions(+), 23 deletions(-)

New commits:
commit a936466dd41c4bb8b0956c4da5a5838f991b332a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 18 11:36:53 2012 +0100

    sna: Prefer to attempt a Composite operation rather than use pixman composite
    
    As pixman composite performance is atrocious for anything other than
    solids, prefer to upload the mask and attempt a composite operation on
    the GPU unless we are forcing the fallback.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 9da9aae..cb9fd7c 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -3412,12 +3412,8 @@ composite_unaligned_boxes_inplace(CARD8 op,
 				  PicturePtr dst, int n, xTrapezoid *t,
 				  bool force_fallback)
 {
-	if (!force_fallback &&
-	    (is_gpu(dst->pDrawable) ||
-	     (src->pDrawable && is_gpu(src->pDrawable)))) {
-		DBG(("%s: fallback -- can not perform operation in place, destination busy\n",
-		     __FUNCTION__));
-
+	if (!force_fallback) {
+		DBG(("%s: fallback -- not forcing\n", __FUNCTION__));
 		return false;
 	}
 
commit 4b325d6e2b99ec3f63a7c5175f6f4746f6773550
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 18 11:24:55 2012 +0100

    sna: Fix rendering of unaligned boxes through pixman
    
    Not only do we need to make sure the source is available to the CPU, we
    need to actually check the right conditions for clipping the box.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 61b4fb1..9da9aae 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -3148,7 +3148,7 @@ pixsolid_unaligned_box_row(struct pixman_inplace *pi,
 	if (x2 > extents->x2)
 		x2 = extents->x2, fx2 = 0;
 
-	if (x2 < x1) {
+	if (x1 < x2) {
 		if (fx1) {
 			pixsolid_opacity(pi, x1, 1, y, h,
 					 covered * (SAMPLES_X - fx1));
@@ -3389,7 +3389,7 @@ pixmask_unaligned_box_row(struct pixman_inplace *pi,
 	if (x2 > extents->x2)
 		x2 = extents->x2, fx2 = 0;
 
-	if (x2 < x1) {
+	if (x1 < x2) {
 		if (fx1) {
 			pixmask_opacity(pi, x1, 1, y, h,
 					 covered * (SAMPLES_X - fx1));
@@ -3412,10 +3412,9 @@ composite_unaligned_boxes_inplace(CARD8 op,
 				  PicturePtr dst, int n, xTrapezoid *t,
 				  bool force_fallback)
 {
-	PixmapPtr pixmap;
-	int16_t dx, dy;
-
-	if (!force_fallback && is_gpu(dst->pDrawable)) {
+	if (!force_fallback &&
+	    (is_gpu(dst->pDrawable) ||
+	     (src->pDrawable && is_gpu(src->pDrawable)))) {
 		DBG(("%s: fallback -- can not perform operation in place, destination busy\n",
 		     __FUNCTION__));
 
@@ -3424,10 +3423,6 @@ composite_unaligned_boxes_inplace(CARD8 op,
 
 	src_x -= pixman_fixed_to_int(t[0].left.p1.x);
 	src_y -= pixman_fixed_to_int(t[0].left.p1.y);
-
-	pixmap = get_drawable_pixmap(dst->pDrawable);
-	get_drawable_deltas(dst->pDrawable, pixmap, &dx, &dy);
-
 	do {
 		struct pixman_inplace pi;
 		RegionRec clip;
@@ -3441,8 +3436,9 @@ composite_unaligned_boxes_inplace(CARD8 op,
 		clip.data = NULL;
 
 		if (!sna_compute_composite_region(&clip,
-						   NULL, NULL, dst,
-						   0, 0,
+						   src, NULL, dst,
+						   clip.extents.x1 + src_x,
+						   clip.extents.y1 + src_y,
 						   0, 0,
 						   clip.extents.x1, clip.extents.y1,
 						   clip.extents.x2 - clip.extents.x1,
@@ -3455,8 +3451,23 @@ composite_unaligned_boxes_inplace(CARD8 op,
 			continue;
 		}
 
+		if (src->pDrawable) {
+			if (!sna_drawable_move_to_cpu(src->pDrawable,
+						      MOVE_READ)) {
+				RegionUninit(&clip);
+				continue;
+			}
+			if (src->alphaMap) {
+				if (!sna_drawable_move_to_cpu(src->alphaMap->pDrawable,
+							      MOVE_READ)) {
+					RegionUninit(&clip);
+					continue;
+				}
+			}
+		}
+
 		pi.image = image_from_pict(dst, FALSE, &pi.dx, &pi.dy);
-		pi.source = image_from_pict(src, TRUE, &pi.sx, &pi.sy);
+		pi.source = image_from_pict(src, FALSE, &pi.sx, &pi.sy);
 		pi.sx += src_x;
 		pi.sy += src_y;
 		pi.mask = pixman_image_create_bits(PIXMAN_a8, 1, 1, NULL, 0);
commit caef27492b5a70bd46a09cd5094b2c93e38e39ea
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jun 17 20:56:46 2012 +0100

    sna: convert another instance of applying the clear to the CPU pixmap
    
    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 97df25a..adc3e4e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1136,13 +1136,18 @@ skip_inplace_map:
 			kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo);
 		}
 
-		pixman_fill(pixmap->devPrivate.ptr,
-			    pixmap->devKind/sizeof(uint32_t),
-			    pixmap->drawable.bitsPerPixel,
-			    0, 0,
-			    pixmap->drawable.width,
-			    pixmap->drawable.height,
-			    priv->clear_color);
+		if (priv->clear_color == 0 || pixmap->drawable.bitsPerPixel == 8) {
+			memset(pixmap->devPrivate.ptr, priv->clear_color,
+			       pixmap->devKind * pixmap->drawable.height);
+		} else {
+			pixman_fill(pixmap->devPrivate.ptr,
+				    pixmap->devKind/sizeof(uint32_t),
+				    pixmap->drawable.bitsPerPixel,
+				    0, 0,
+				    pixmap->drawable.width,
+				    pixmap->drawable.height,
+				    priv->clear_color);
+		}
 
 		priv->clear = false;
 	}


More information about the xorg-commit mailing list