[PATCH] xfree86: Revert workaround for drm race condition.

Bryce Harrington bryce at canonical.com
Wed Apr 10 23:05:40 PDT 2013


Revert 70739e817b2d64bc020ea491f23a3574bdb6155e and mostly revert
c31eac647a9ecf0fb20dc98266cadf0ba923ba14.

Further investigation shows the encountered race condition is between
lightdm and plymouth-splash, as implemented in the Ubuntu distribution
within the limitations of upstart's job coordination logic, and can (and
should) be fixed within those limiations.  Not in xserver itself.

This leaves some of the diagnostic improvements from the recent patch
series, in case others run into a similar situation.

Signed-off-by: Bryce Harrington <bryce at canonical.com>
---
 hw/xfree86/os-support/linux/lnx_platform.c |   30 ++++++----------------------
 1 file changed, 6 insertions(+), 24 deletions(-)

diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c
index 444f8f5..33a953c 100644
--- a/hw/xfree86/os-support/linux/lnx_platform.c
+++ b/hw/xfree86/os-support/linux/lnx_platform.c
@@ -26,35 +26,17 @@ get_drm_info(struct OdevAttributes *attribs, char *path)
     char *buf;
     int fd;
     int err = 0;
-    int tries = 0;
 
     fd = open(path, O_RDWR, O_CLOEXEC);
     if (fd == -1)
         return FALSE;
 
-    while (tries++ < 200) {
-	sv.drm_di_major = 1;
-	sv.drm_di_minor = 4;
-	sv.drm_dd_major = -1;       /* Don't care */
-	sv.drm_dd_minor = -1;       /* Don't care */
-
-	err = drmSetInterfaceVersion(fd, &sv);
-	if (!err) {
-	    if (tries > 1)
-		LogMessage(X_INFO, "setversion 1.4 succeeded on try #%d\n", tries);
-	    break;
-	} if (err == -EACCES) {
-	    if (tries % 500 == 0)
-		LogMessage(X_INFO, "waiting on drm device...\n");
-	} else {
-	    break;
-	}
-
-	usleep(10000);
-
-	if (!drmSetMaster(fd))
-	    LogMessage(X_INFO, "drmSetMaster succeeded\n");
-    }
+    sv.drm_di_major = 1;
+    sv.drm_di_minor = 4;
+    sv.drm_dd_major = -1;       /* Don't care */
+    sv.drm_dd_minor = -1;       /* Don't care */
+
+    err = drmSetInterfaceVersion(fd, &sv);
     if (err) {
         ErrorF("setversion 1.4 failed: %s\n", strerror(-err));
 	goto out;
-- 
1.7.9.5



More information about the xorg-devel mailing list