mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-25 01:20:05 +01:00
xfree86: Fix race condition failure opening drm.
If other processes have had drm open previously, xserver may attempt to open the device too early and fail, with xserver error exit "Cannot run in framebuffer mode" or Xorg.0.log messages about "setversion 1.4 failed". In this situation, we're receiving back -EACCES from libdrm. To address this we need to re-set ourselves as the drm master, and keep trying to set the interface until it works (or until we give up). See https://bugs.launchpad.net/ubuntu/+source/libdrm/+bug/982889 Signed-off-by: Bryce Harrington <bryce@canonical.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
c31eac647a
commit
70739e817b
1 changed files with 6 additions and 0 deletions
|
|
@ -43,8 +43,14 @@ get_drm_info(struct OdevAttributes *attribs, char *path)
|
|||
if (tries > 1)
|
||||
LogMessage(X_INFO, "setversion 1.4 succeeded on try #%d\n", tries);
|
||||
break;
|
||||
} else if (err != -EACCES) {
|
||||
break;
|
||||
}
|
||||
|
||||
usleep(10000);
|
||||
|
||||
if (!drmSetMaster(fd))
|
||||
LogMessage(X_INFO, "drmSetMaster succeeded\n");
|
||||
}
|
||||
if (err) {
|
||||
ErrorF("setversion 1.4 failed: %s\n", strerror(-err));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue