diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2020-09-08 10:03:33 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2020-09-08 10:50:38 +0200 |
commit | af4c84ce8855e84c0ad89b929bc972e884f0b8e3 (patch) | |
tree | 6fe1fb1cad67a891b9925f466ad02dc1e9e14d15 /hw | |
parent | 39cb95e959fab97a7e255dda1a1599b096fb0f7e (diff) |
Revert "linux: Make platform device probe less fragile"
This reverts commit 74b7427c41b4e4104af7abf70a996c086d3d7628.
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1068
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/os-support/linux/lnx_platform.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c index e62306219..70374ace8 100644 --- a/hw/xfree86/os-support/linux/lnx_platform.c +++ b/hw/xfree86/os-support/linux/lnx_platform.c @@ -23,13 +23,13 @@ static Bool get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) { + drmSetVersion sv; drmVersionPtr v; + char *buf; int fd; int err = 0; Bool paused, server_fd = FALSE; - LogMessage(X_INFO, "Platform probe for %s\n", attribs->syspath); - fd = systemd_logind_take_fd(attribs->major, attribs->minor, path, &paused); if (fd != -1) { if (paused) { @@ -48,6 +48,18 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) if (fd == -1) return FALSE; + 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) { + xf86Msg(X_ERROR, "%s: failed to set DRM interface version 1.4: %s\n", + path, strerror(-err)); + goto out; + } + /* for a delayed probe we've already added the device */ if (delayed_index == -1) { xf86_add_platform_device(attribs, FALSE); @@ -57,6 +69,10 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) if (server_fd) xf86_platform_devices[delayed_index].flags |= XF86_PDEV_SERVER_FD; + buf = drmGetBusid(fd); + xf86_platform_odev_attributes(delayed_index)->busid = XNFstrdup(buf); + drmFreeBusid(buf); + v = drmGetVersion(fd); if (!v) { xf86Msg(X_ERROR, "%s: failed to query DRM version\n", path); |