xfree86: Revert workaround for drm race condition.

Revert 70739e817b and mostly revert
c31eac647a.

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@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Bryce Harrington 2013-04-10 23:05:40 -07:00 committed by Peter Hutterer
parent 131f883f85
commit d16284687d

View File

@ -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 */
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");
}
err = drmSetInterfaceVersion(fd, &sv);
if (err) {
ErrorF("setversion 1.4 failed: %s\n", strerror(-err));
goto out;