xf86-video-intel: 2 commits - src/sna/sna_accel.c src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Jun 11 06:44:13 PDT 2013


 src/sna/sna_accel.c   |   31 ++++++++++++++++---------------
 src/sna/sna_display.c |    6 +-----
 2 files changed, 17 insertions(+), 20 deletions(-)

New commits:
commit 7d91051c50210560dbd93a9e36f30d9f74ce9133
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jun 11 14:23:57 2013 +0100

    sna: Make sure the source is coherent on the CPU before uploading
    
    Makes the presumption that for the upload path the region is stored on
    the CPU explicit.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=61628
    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 69a151c..1663fe3 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4861,6 +4861,22 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 			}
 		}
 
+		if (src_priv) {
+			bool ret;
+
+			RegionTranslate(region, src_dx, src_dy);
+			ret = sna_drawable_move_region_to_cpu(&src_pixmap->drawable,
+							      region, MOVE_READ);
+			RegionTranslate(region, -src_dx, -src_dy);
+			if (!ret)
+				goto fallback;
+
+			assert(!src_priv->mapped);
+			if (src_pixmap->devPrivate.ptr == NULL)
+				/* uninitialised!*/
+				return;
+		}
+
 		if (alu != GXcopy) {
 			PixmapPtr tmp;
 			struct kgem_bo *src_bo;
@@ -4936,21 +4952,6 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 			DBG(("%s: dst is on the GPU, src is on the CPU, uploading into dst\n",
 			     __FUNCTION__));
 
-			if (src_priv) {
-				/* Fixup the shadow pointer as necessary */
-				if (src_priv->mapped) {
-					assert(!src_priv->shm);
-					src_pixmap->devPrivate.ptr = NULL;
-					src_priv->mapped = false;
-				}
-				if (src_pixmap->devPrivate.ptr == NULL) {
-					if (!src_priv->ptr) /* uninitialised!*/
-						return;
-					src_pixmap->devPrivate.ptr = PTR(src_priv->ptr);
-					src_pixmap->devKind = src_priv->stride;
-				}
-			}
-
 			if (!dst_priv->pinned && replaces) {
 				stride = src_pixmap->devKind;
 				bits = src_pixmap->devPrivate.ptr;
commit 2e2db4b88f741ca6cd4312c6c5242261c5de4d06
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jun 11 00:49:35 2013 +0100

    sna: Tidy batch submission around CRTC updates
    
    A few places we were redundantly submitting the same bo, and in others
    doing more work than necessary.
    
    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 db4cb38..3a5b6e3 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -776,7 +776,6 @@ sna_crtc_apply(xf86CrtcPtr crtc)
 	int i;
 
 	DBG(("%s\n", __FUNCTION__));
-	kgem_bo_submit(&sna->kgem, sna_crtc->bo);
 
 	assert(xf86_config->num_output < ARRAY_SIZE(output_ids));
 
@@ -2072,9 +2071,6 @@ sna_output_dpms(xf86OutputPtr output, int dpms)
 
 	DBG(("%s: dpms=%d\n", __FUNCTION__, dpms));
 
-	if (dpms != DPMSModeOn)
-		kgem_submit(&sna->kgem);
-
 	/* Record the value of the backlight before turning
 	 * off the display, and reset if after turning it on.
 	 * Order is important as the kernel may record and also
@@ -2887,7 +2883,7 @@ sna_page_flip(struct sna *sna,
 	DBG(("%s: handle %d attached\n", __FUNCTION__, bo->handle));
 	assert(bo->refcnt);
 
-	kgem_submit(&sna->kgem);
+	kgem_bo_submit(&sna->kgem, bo);
 
 	/*
 	 * Queue flips on all enabled CRTCs


More information about the xorg-commit mailing list