xf86-video-intel: 3 commits - src/intel_device.c src/sna/sna_display.c src/sna/xassert.h

Chris Wilson ickle at kemper.freedesktop.org
Fri Jul 31 09:19:44 PDT 2015


 src/intel_device.c    |   27 ++++++++++++++++++++++++---
 src/sna/sna_display.c |    9 +++++++--
 src/sna/xassert.h     |    6 ++++++
 3 files changed, 37 insertions(+), 5 deletions(-)

New commits:
commit bc063c9f4af90542297877281b1b9f4692dafde4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 31 17:17:26 2015 +0100

    sna: Undo a CRTC flip that results in a pageflip failure
    
    If the pageflip following the CRTC fixup fails, we can be left with the
    flip-to bo being left as the CRTC scanout. If that is so, reset the
    desired mode (and original scanout bo).
    
    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 5ec2512..606c3bd 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -6235,7 +6235,7 @@ error:
 					"page flipping failed, on CRTC:%d (pipe=%d), disabling %s page flips\n",
 					__sna_crtc_id(crtc), __sna_crtc_pipe(crtc), data ? "synchronous": "asynchronous");
 
-			if (count)
+			if (count || crtc->bo == bo)
 				sna_mode_restore(sna);
 
 			sna->flags &= ~(data ? SNA_HAS_FLIP : SNA_HAS_ASYNC_FLIP);
commit 9451976a5b00416a1247cb5b80c4943b613e56eb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 31 17:14:12 2015 +0100

    sna: Assert that flip handler/data exists before invoking
    
    Just an explanatory assert in case we ever jump off into a NULL function
    pointer.
    
    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 48c032d..5ec2512 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -8594,8 +8594,13 @@ again:
 
 				DBG(("%s: flip complete, pending? %d\n", __FUNCTION__, sna->mode.flip_active));
 				assert(sna->mode.flip_active);
-				if (--sna->mode.flip_active == 0)
+				if (--sna->mode.flip_active == 0) {
+					assert(crtc->flip_handler);
+					assert(crtc->flip_data);
 					crtc->flip_handler(vbl, crtc->flip_data);
+					dbg(crtc->flip_handler = NULL);
+					dbg(crtc->flip_data = NULL);
+				}
 			}
 			break;
 		default:
diff --git a/src/sna/xassert.h b/src/sna/xassert.h
index bac70b8..28796b8 100644
--- a/src/sna/xassert.h
+++ b/src/sna/xassert.h
@@ -52,8 +52,14 @@
 		__warn_once__ = 1; \
 	} \
 } while (0)
+
+#define dbg(EXPR) EXPR
+
 #else
+
 #define warn_unless(E)
+#define dbg(EXPR)
+
 #endif
 
 #endif /* __XASSERT_H__ */
commit 6a2dcb388e6b549c3175ccfbcd3f1751e25de40a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 31 10:40:32 2015 +0100

    intel: Refactor i915.ko loading support
    
    Different OS name the i915 KMS module differently, so make it convenient
    for us to be able to feed in the right name, or even just try them all
    and pick the first one that exists!
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_device.c b/src/intel_device.c
index f1a6887..54c1443 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -203,9 +203,15 @@ static inline struct intel_device *intel_device(ScrnInfoPtr scrn)
 	return xf86GetEntityPrivate(scrn->entityList[0], intel_device_key)->ptr;
 }
 
+static const char *kernel_module_names[] ={
+	"i915",
+	NULL,
+};
+
 static int is_i915_device(int fd)
 {
 	drm_version_t version;
+	const char **kn;
 	char name[5] = "";
 
 	memset(&version, 0, sizeof(version));
@@ -215,7 +221,22 @@ static int is_i915_device(int fd)
 	if (drmIoctl(fd, DRM_IOCTL_VERSION, &version))
 		return 0;
 
-	return strcmp("i915", name) == 0;
+	for (kn = kernel_module_names; *kn; kn++)
+		if (strcmp(*kn, name) == 0)
+			return 1;
+
+	return 0;
+}
+
+static int load_i915_kernel_module(void)
+{
+	const char **kn;
+
+	for (kn = kernel_module_names; *kn; kn++)
+		if (xf86LoadKernelModule(*kn) == 0)
+			return 0;
+
+	return -1;
 }
 
 static int is_i915_gem(int fd)
@@ -342,7 +363,7 @@ static int __intel_open_device__pci(const struct pci_device *pci)
 
 		sprintf(path + base, "driver");
 		if (stat(path, &st)) {
-			if (xf86LoadKernelModule("i915"))
+			if (load_i915_kernel_module())
 				return -1;
 			(void)xf86LoadKernelModule("fbcon");
 		}
@@ -405,7 +426,7 @@ static int __intel_open_device__legacy(const struct pci_device *pci)
 
 	ret = drmCheckModesettingSupported(id);
 	if (ret) {
-		if (xf86LoadKernelModule("i915"))
+		if (load_i915_kernel_module() == 0)
 			ret = drmCheckModesettingSupported(id);
 		if (ret)
 			return -1;


More information about the xorg-commit mailing list