mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-25 16:30:05 +01:00
xfree86: fbdevhw: fix pci detection on recent Linux
Linux kernel v6.9 has changed the symlink to point to the parent device. This
breaks fbdev_open() detection logic. Change it to use the subsystem symlink
instead which will remain stable.
Kernel v6.8:
[ 14.067] (II) fbdev_open() sysfs_path=/sys/class/graphics/fb0
[ 14.067] (II) fbdev_open() buf=../../devices/platform/vesa-framebuffer.0/graphics/fb0
Kernel v6.9:
[ 15.609] (II) fbdev_open() sysfs_path=/sys/class/graphics/fb0
[ 15.609] (II) fbdev_open() buf=../../devices/pci0000:00/0000:00:01.0/vesa-framebuffer.0/graphics/fb0
Originally found in automated Debian ISO QA testing [0] and confirmed in Linux [1].
Tested on kernels v6.9.7 and v6.8.12
[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1075713
[1] https://lore.kernel.org/lkml/lLyvPFC_APGHNfyGNHRpQy5izBikkaTPOpHooZIT3fFAoJPquSI31ZMueA99XTdr8ysir3X7O7IMdc6za-0m79vr_claeparHhoRouVgHOI=@proton.me/
Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1714
Signed-off-by: Tj <tj.iam.tj@proton.me>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Enrico Weigelt, metux IT consult <info@metux.net>
(cherry picked from commit 728b54528d)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1767>
This commit is contained in:
parent
ac48573a9b
commit
e38c23e5b8
1 changed files with 2 additions and 2 deletions
|
|
@ -335,9 +335,9 @@ fbdev_open(int scrnIndex, const char *dev, char **namep)
|
|||
char *sysfs_path = NULL;
|
||||
char *node = strrchr(dev, '/') + 1;
|
||||
|
||||
if (asprintf(&sysfs_path, "/sys/class/graphics/%s", node) < 0 ||
|
||||
if (asprintf(&sysfs_path, "/sys/class/graphics/%s/device/subsystem", node) < 0 ||
|
||||
readlink(sysfs_path, buf, sizeof(buf) - 1) < 0 ||
|
||||
strstr(buf, "devices/pci")) {
|
||||
strstr(buf, "bus/pci")) {
|
||||
free(sysfs_path);
|
||||
close(fd);
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue