xf86-video-intel: 3 commits - src/sna/kgem.c src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jan 1 02:04:49 PST 2016


 src/sna/kgem.c        |   13 +++++++++++++
 src/sna/sna_display.c |    8 ++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

New commits:
commit ec92e2584ffa0bf2a7f5bd724b69e68687e11c96
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Dec 20 18:37:38 2015 +0000

    sna: Add fault-injection for cursor ioctls
    
    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 1b39f20..60bc42b 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -90,6 +90,8 @@ void *alloca(size_t);
 #include <memcheck.h>
 #endif
 
+#define FAIL_CURSOR_IOCTL 0
+
 #define COLDPLUG_DELAY_MS 2000
 
 /* Minor discrepancy between 32-bit/64-bit ABI in old kernels */
@@ -5729,7 +5731,8 @@ sna_show_cursors(ScrnInfoPtr scrn)
 		arg.width = arg.height = cursor->size;
 		arg.handle = cursor->handle;
 
-		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg) == 0) {
+		if (!FAIL_CURSOR_IOCTL &&
+		    drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg) == 0) {
 			if (sna_crtc->cursor) {
 				assert(sna_crtc->cursor->ref > 0);
 				sna_crtc->cursor->ref--;
@@ -5955,7 +5958,8 @@ disable:
 		if (arg.flags == 0)
 			continue;
 
-		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg) == 0) {
+		if (!FAIL_CURSOR_IOCTL &&
+		    drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg) == 0) {
 			if (arg.flags & DRM_MODE_CURSOR_BO) {
 				if (sna_crtc->cursor) {
 					assert(sna_crtc->cursor->ref > 0);
commit 2788914ea67fa01b869571f0db61bed2ec964ca2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Dec 30 21:46:37 2015 +0000

    sna: Disable WC mmaps for 945 and older
    
    Unresolved coherency troubles that probably should be fixed in the
    kernel (since the coherency issue is likely wider, but the impact just
    seems to be these old chipsets).
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=90841
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 823bee6..8e5ec51 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1290,6 +1290,10 @@ static bool test_has_wc_mmap(struct kgem *kgem)
 	if (DBG_NO_WC_MMAP)
 		return false;
 
+	/* XXX See https://bugs.freedesktop.org/show_bug.cgi?id=90841 */
+	if (kgem->gen < 033)
+		return false;
+
 	if (gem_param(kgem, LOCAL_I915_PARAM_MMAP_VERSION) < 1)
 		return false;
 
commit 963b5bb1be874623f06caa421e06cdd2134204dc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Dec 30 16:12:30 2015 +0000

    sna: Skip sync if we have an idle coherent bo
    
    If we know that our bo is idle and already coherent, skip the call to
    synchronize that bo with the kernel.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index fefa475..823bee6 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -6999,6 +6999,9 @@ void kgem_bo_sync__cpu(struct kgem *kgem, struct kgem_bo *bo)
 	assert(!bo->scanout);
 	assert_tiling(kgem, bo);
 
+	if (bo->rq == NULL && (kgem->has_llc || bo->snoop))
+		return;
+
 	kgem_bo_submit(kgem, bo);
 
 	/* SHM pixmaps use proxies for subpage offsets */
@@ -7036,6 +7039,9 @@ void kgem_bo_sync__cpu_full(struct kgem *kgem, struct kgem_bo *bo, bool write)
 	assert(!bo->scanout || !write);
 	assert_tiling(kgem, bo);
 
+	if (bo->rq == NULL && (kgem->has_llc || bo->snoop))
+		return;
+
 	if (write || bo->needs_flush)
 		kgem_bo_submit(kgem, bo);
 
@@ -7083,6 +7089,9 @@ void kgem_bo_sync__gtt(struct kgem *kgem, struct kgem_bo *bo)
 	assert(bo->proxy == NULL);
 	assert_tiling(kgem, bo);
 
+	if (bo->rq == NULL)
+		return;
+
 	kgem_bo_submit(kgem, bo);
 
 	if (bo->domain != DOMAIN_GTT || FORCE_MMAP_SYNC & (1 << DOMAIN_GTT)) {


More information about the xorg-commit mailing list