xf86-video-intel: src/sna/sna_blt.c

Chris Wilson ickle at kemper.freedesktop.org
Thu May 1 05:20:08 PDT 2014


 src/sna/sna_blt.c |   23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

New commits:
commit 81608b4da5b35993cd2071098235c14920b7236d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu May 1 13:15:11 2014 +0100

    sna: Do not discard damage when using the CPU to perform BLT spans
    
    The BLT paths are only taken when we know we are overwriting the target
    contents, and so we do not have to worry about reads along those paths.
    However, in terms of migrating the damage for a pixmap, we have to be
    careful in case we do not write to the full area of the composite
    rectangle, in which case we have to treat it as a read to that area and
    migrate the damage.
    
    Regression from
    commit a13781d19defc97af6a279c11a85e33ef825020e [2.20.10]
    Author: Chris Wilson <chris at chris-wilson.co.uk>
    Date:   Sun Aug 19 09:45:12 2012 +0100
    
        sna: Enable BLT composite functions to target CPU buffers
    
        Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
    
    Reported-by: Matti Hämäläinen
    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 f68d951..75a65f4 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -2521,8 +2521,7 @@ clear:
 		hint = 0;
 		if (can_render(sna)) {
 			hint |= PREFER_GPU;
-			if (dst->pCompositeClip->data == NULL &&
-			    (flags & COMPOSITE_PARTIAL) == 0) {
+			if ((flags & COMPOSITE_PARTIAL) == 0) {
 				hint |= IGNORE_CPU;
 				if (width  == tmp->dst.pixmap->drawable.width &&
 				    height == tmp->dst.pixmap->drawable.height)
@@ -2545,8 +2544,10 @@ clear:
 			region.extents = dst_box;
 			region.data = NULL;
 
-			if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region,
-							     MOVE_INPLACE_HINT | MOVE_WRITE))
+			hint = MOVE_WRITE | MOVE_INPLACE_HINT;
+			if (flags & COMPOSITE_PARTIAL)
+				hint |= MOVE_READ;
+			if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region, hint))
 				return false;
 		}
 
@@ -2610,8 +2611,7 @@ fill:
 		hint = 0;
 		if (can_render(sna)) {
 			hint |= PREFER_GPU;
-			if (dst->pCompositeClip->data == NULL &&
-			    (flags & COMPOSITE_PARTIAL) == 0) {
+			if ((flags & COMPOSITE_PARTIAL) == 0) {
 				hint |= IGNORE_CPU;
 				if (width  == tmp->dst.pixmap->drawable.width &&
 				    height == tmp->dst.pixmap->drawable.height)
@@ -2634,8 +2634,10 @@ fill:
 			region.extents = dst_box;
 			region.data = NULL;
 
-			if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region,
-							     MOVE_INPLACE_HINT | MOVE_WRITE))
+			hint = MOVE_WRITE | MOVE_INPLACE_HINT;
+			if (flags & COMPOSITE_PARTIAL)
+				hint |= MOVE_READ;
+			if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region, hint))
 				return false;
 		}
 
@@ -2775,8 +2777,7 @@ fill:
 	hint = 0;
 	if (bo || can_render(sna)) {
 		hint |= PREFER_GPU;
-		if (dst->pCompositeClip->data == NULL &&
-		    (flags & COMPOSITE_PARTIAL) == 0) {
+		if ((flags & COMPOSITE_PARTIAL) == 0) {
 			hint |= IGNORE_CPU;
 			if (width  == tmp->dst.pixmap->drawable.width &&
 			    height == tmp->dst.pixmap->drawable.height)
@@ -2824,7 +2825,7 @@ put:
 
 		if (tmp->dst.bo == NULL) {
 			hint = MOVE_INPLACE_HINT | MOVE_WRITE;
-			if (dst->pCompositeClip->data)
+			if (flags & COMPOSITE_PARTIAL)
 				hint |= MOVE_READ;
 
 			region.extents = dst_box;


More information about the xorg-commit mailing list