xf86-video-intel: 4 commits - src/sna/sna_display.c src/sna/sna_dri2.c src/sna/sna_driver.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jan 23 03:38:46 PST 2015


 src/sna/sna_display.c |    8 ++++++--
 src/sna/sna_dri2.c    |   32 ++++++++++++++++++--------------
 src/sna/sna_driver.c  |    3 +++
 3 files changed, 27 insertions(+), 16 deletions(-)

New commits:
commit ed19b160089640c2e1167332b00ffe1e569a48dc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jan 23 11:08:37 2015 +0000

    sna: Assert that the shadow buffer has a compatible pitch to the front
    
    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 ab42dbe..f59c621 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2133,6 +2133,8 @@ out_shadow:
 					goto force_shadow;
 				}
 
+				assert(__sna_pixmap_get_bo(sna->front) == NULL ||
+				       __sna_pixmap_get_bo(sna->front)->pitch == shadow->pitch);
 				sna->mode.shadow = shadow;
 				set_shadow(sna, &region);
 			}
commit b388172076c1664e949cd81feb94c60e81a90d86
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jan 23 10:54:57 2015 +0000

    sna: GETPROPBLOB only works with exact length matches
    
    If the blob is smaller than the space we offer for the read, it skips
    the read. So make sure we repeat the read in this case as well.
    
    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 00c93d4..ab42dbe 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3002,10 +3002,12 @@ sna_output_attach_edid(xf86OutputPtr output)
 
 		VG(memset(raw, 0, blob.length));
 		blob.data = (uintptr_t)raw;
-		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob))
-			goto done;
 	}
 
+	if (blob.length != sna_output->edid_len &&
+	    drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob))
+		goto done;
+
 	if (old &&
 	    blob.length == sna_output->edid_len &&
 	    memcmp(old, raw, blob.length) == 0) {
commit 619d165eed414ecbb0e7d22763f1c2f82763f9ec
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jan 23 08:42:56 2015 +0000

    sna: Add a fallback DBG for the git version
    
    In case the version numbering is disabled, like on Arch, include it
    anyway in the full debug log.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index fc6afad..ab204f2 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -76,6 +76,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #if HAVE_DOT_GIT
 #include "git_version.h"
+#else
+#define git_version "not compiled from git"
 #endif
 
 #ifdef TEARFREE
@@ -1463,6 +1465,7 @@ static void describe_sna(ScrnInfoPtr scrn)
 		   "SNA compiled for use with valgrind\n");
 	VALGRIND_PRINTF("SNA compiled for use with valgrind\n");
 #endif
+	DBG(("xf86-video-intel version: %s\n", git_version));
 	DBG(("pixman version: %s\n", pixman_version_string()));
 }
 
commit 684e921a5442c0d7afedd27b7b85719d8195c6ee
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 22 15:26:00 2015 +0000

    sna/dri2: Only preserve back buffers with the same pitch
    
    We can only pageflip if we don't change the pitch, otherwise we
    simulate the pageflip with modeset. The idea is that once we have
    exchanged the buffers, we will quickly settle down to a steady state
    scenario where each buffer has the same pitch. We can encourage this
    further by only keeping those buffers around that do have the same pitch
    as the current front.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 6b0520f..8bbb598 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -82,6 +82,18 @@ get_private(void *buffer)
 	return (struct sna_dri2_private *)((DRI2Buffer2Ptr)buffer+1);
 }
 
+pure static inline DRI2BufferPtr sna_pixmap_get_buffer(PixmapPtr pixmap)
+{
+	assert(pixmap->refcnt);
+	return ((void **)__get_private(pixmap, sna_pixmap_key))[2];
+}
+
+static inline void sna_pixmap_set_buffer(PixmapPtr pixmap, void *ptr)
+{
+	assert(pixmap->refcnt);
+	((void **)__get_private(pixmap, sna_pixmap_key))[2] = ptr;
+}
+
 #if DRI2INFOREC_VERSION >= 4
 enum event_type {
 	WAITMSC = 0,
@@ -138,10 +150,14 @@ sna_dri2_get_back(struct sna *sna,
 	int flags;
 	bool reuse;
 
-	DBG(("%s: draw size=%dx%d, buffer size=%dx%d\n",
+	DBG(("%s: draw size=%dx%d, buffer size=%dx%d, is-scanout? %d, pitch=%d, front pitch=%d\n",
 	     __FUNCTION__, draw->width, draw->height,
-	     get_private(back)->size & 0xffff, get_private(back)->size >> 16));
+	     get_private(back)->size & 0xffff, get_private(back)->size >> 16,
+	     get_private(back)->bo->scanout,
+	     back->pitch, sna_pixmap_get_buffer(get_drawable_pixmap(draw))->pitch ));
 	reuse = (draw->height << 16 | draw->width) == get_private(back)->size;
+	if (reuse && get_private(back)->bo->scanout)
+		reuse = sna_pixmap_get_buffer(get_drawable_pixmap(draw))->pitch == back->pitch;
 	if (reuse) {
 		bo = get_private(back)->bo;
 		assert(bo->refcnt);
@@ -401,18 +417,6 @@ static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna,
 	return priv->gpu_bo;
 }
 
-pure static inline void *sna_pixmap_get_buffer(PixmapPtr pixmap)
-{
-	assert(pixmap->refcnt);
-	return ((void **)__get_private(pixmap, sna_pixmap_key))[2];
-}
-
-static inline void sna_pixmap_set_buffer(PixmapPtr pixmap, void *ptr)
-{
-	assert(pixmap->refcnt);
-	((void **)__get_private(pixmap, sna_pixmap_key))[2] = ptr;
-}
-
 void
 sna_dri2_pixmap_update_bo(struct sna *sna, PixmapPtr pixmap, struct kgem_bo *bo)
 {


More information about the xorg-commit mailing list