Source: debian-installer
Followup-For: Bug #1075713
X-Debbugs-Cc: tj.iam...@proton.me

Finally managed to build the v6.8.12 initrd; process is quite convoluted
due to having to manually identify, install, and depmod modules.
However...

... it works (both with and without a hard-coded xorg.conf fragment).

The Xorg.0.log trace messages I added show that the call to
fbdevHWProbe() succeeds, falls through to the subordinate 'else' clause
and calls xf86ClaimFbSlot():

With the hard-coded fragment:

~ # grep fbdev /var/log/Xorg.0.log
[    88.861] (II) LoadModule: "fbdev"
[    88.861] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[    88.861] (II) Module fbdev: vendor="X.Org Foundation"
[    88.861] (II) FBDEV: driver for framebuffer: fbdev
[    88.894] fbdev trace: FBDevPciProbe()
[    88.894] (II) Loading sub module "fbdevhw"
[    88.894] (II) LoadModule: "fbdevhw"
[    88.894] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    88.894] (II) Module fbdevhw: vendor="X.Org Foundation"
[    88.894] fbdev trace: FBDevPciProbe() return
[    88.894] (WW) Falling back to old probe method for fbdev
[    88.894] fbdev trace: FBDevProbe()
[    88.894] (II) Loading sub module "fbdevhw"
[    88.894] (II) LoadModule: "fbdevhw"
[    88.894] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    88.894] (II) Module fbdevhw: vendor="X.Org Foundation"
[    88.894] fbdev: FBDevProbe() for() numDevSection=0
[    88.894] fbdev: FBDevProbe() isPci0 isISA=0
[    88.895] fbdev: FBDevProbe() calling fbdevHWProbe(NULL, '/dev/fb0', NULL)
[    88.895] fbdev trace: FBDevProbe() fbdevHWProbe()
[    88.895] fbdev trace: FBDevProbe() else xf86ClaimFbSlot()
[    88.895] fbdev trace: FBDevProbe() return
[    88.895] (II) UnloadModule: "fbdev"
[    88.895] (II) UnloadSubModule: "fbdevhw"
[    88.895] fbdev: PreInit 0
[    88.895] (**) FBDEV(0): Option "fbdev" "/dev/fb0"

Auto-detection without hard coded fragment:

~ # grep fbdev /var/log/Xorg.0.log
[   213.290] (==) Matched fbdev as autoconfigured driver 2
[   213.291] (II) LoadModule: "fbdev"
[   213.291] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[   213.291] (II) Module fbdev: vendor="X.Org Foundation"
[   213.291] (II) FBDEV: driver for framebuffer: fbdev
[   213.324] fbdev trace: FBDevPciProbe()
[   213.324] (II) Loading sub module "fbdevhw"
[   213.324] (II) LoadModule: "fbdevhw"
[   213.324] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[   213.324] (II) Module fbdevhw: vendor="X.Org Foundation"
[   213.324] fbdev trace: FBDevPciProbe() return
[   213.324] (WW) Falling back to old probe method for fbdev
[   213.324] fbdev trace: FBDevProbe()
[   213.324] (II) Loading sub module "fbdevhw"
[   213.324] (II) LoadModule: "fbdevhw"
[   213.324] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[   213.324] (II) Module fbdevhw: vendor="X.Org Foundation"
[   213.325] fbdev: FBDevProbe() for() numDevSection=0
[   213.325] fbdev: FBDevProbe() isPci0 isISA=0
[   213.325] fbdev: FBDevProbe() calling fbdevHWProbe(NULL, '(null)', NULL)
[   213.325] fbdev trace: FBDevProbe() fbdevHWProbe()
[   213.325] fbdev trace: FBDevProbe() else xf86ClaimFbSlot()
[   213.325] fbdev trace: FBDevProbe() return
[   213.325] (II) UnloadModule: "fbdev"
[   213.325] (II) UnloadSubModule: "fbdevhw"
[   213.325] fbdev: PreInit 0

Notice here both of these succeed:

fbdev: FBDevProbe() calling fbdevHWProbe(NULL, '/dev/fb0', NULL)
fbdev: FBDevProbe() calling fbdevHWProbe(NULL, '(null)', NULL)

This leads back to:

xorg-server-${VERSION}/hw/xfree86/fbdevhw/fbdevhw.c

Bool
fbdevHWProbe(struct pci_device *pPci, char *device, char **namep)
{
int fd;

if (pPci)
fd = fbdev_open_pci(pPci, namep);
else
fd = fbdev_open(-1, device, namep);

if (-1 == fd)
return FALSE;
close(fd);
return TRUE;
}

So I now instrument xserver-xorg-core's
hw/xfree86/fbdevhw/fbdevhw.c::fbdev_open()

With v6.8.12 Xorg reports:

~ # uname -r; grep fbdev /var/log/Xorg.0.log
6.8.12-amd64
[    14.033] (==) Matched fbdev as autoconfigured driver 2
[    14.033] (II) LoadModule: "fbdev"
[    14.033] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[    14.033] (II) Module fbdev: vendor="X.Org Foundation"
[    14.033] (II) FBDEV: driver for framebuffer: fbdev
[    14.066] fbdev trace: FBDevPciProbe()
[    14.066] (II) Loading sub module "fbdevhw"
[    14.066] (II) LoadModule: "fbdevhw"
[    14.066] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    14.066] (II) Module fbdevhw: vendor="X.Org Foundation"
[    14.067] fbdev trace: FBDevPciProbe() return
[    14.067] (WW) Falling back to old probe method for fbdev
[    14.067] fbdev trace: FBDevProbe()
[    14.067] (II) Loading sub module "fbdevhw"
[    14.067] (II) LoadModule: "fbdevhw"
[    14.067] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    14.067] (II) Module fbdevhw: vendor="X.Org Foundation"
[    14.067] fbdev: FBDevProbe() for() numDevSection=0
[    14.067] fbdev: FBDevProbe() isPci0 isISA=0
[    14.067] fbdev: FBDevProbe() calling fbdevHWProbe(NULL, '(null)', NULL)
[    14.067] (II) fbdev_open(scrnIndex=-1, dev=(null), namep=(nil))
[    14.067] (II) fbdev_open() using dev from env FRAMEBUFFER=(null)
[    14.067] (II) fbdev_open() using default dev=/dev/fb0
[    14.067] (II) fbdev_open() sysfs_path=/sys/class/graphics/fb0
[    14.067] (II) fbdev_open() 
buf=../../devices/platform/vesa-framebuffer.0/graphics/fb0
[    14.067] (II) fbdev_open() returning file descriptor 11
[    14.067] fbdev trace: FBDevProbe() fbdevHWProbe()
[    14.067] fbdev trace: FBDevProbe() else xf86ClaimFbSlot()
[    14.067] fbdev trace: FBDevProbe() return
[    14.067] (II) UnloadModule: "fbdev"
[    14.067] (II) UnloadSubModule: "fbdevhw"
[    14.067] fbdev: PreInit 0
[    14.067] (II) FBDEV(0): fbdev_open(scrnIndex=0, dev=(null), namep=(nil))
[    14.067] (II) FBDEV(0): fbdev_open() using dev from env FRAMEBUFFER=(null)
[    14.067] (II) FBDEV(0): fbdev_open() using default dev=/dev/fb0
[    14.067] (II) FBDEV(0): fbdev_open() sysfs_path=/sys/class/graphics/fb0
[    14.067] (II) FBDEV(0): fbdev_open() 
buf=../../devices/platform/vesa-framebuffer.0/graphics/fb0
[    14.067] (II) FBDEV(0): fbdev_open() returning file descriptor 12

~ # ls -l /sys/devices/platform/vesa-framebuffer.0/
total 0
lrwxrwxrwx    1 root     root             0 Jul 13 14:01 driver -> 
../../../bus/platform/drivers/vesa-framebuffer
With v6.9.7:

~ # uname -r; grep fbdev /var/log/Xorg.0.log
6.9.7-amd64
[    15.582] (==) Matched fbdev as autoconfigured driver 2
[    15.582] (II) LoadModule: "fbdev"
[    15.582] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[    15.582] (II) Module fbdev: vendor="X.Org Foundation"
[    15.582] (II) FBDEV: driver for framebuffer: fbdev
[    15.608] fbdev trace: FBDevPciProbe()
[    15.608] (II) Loading sub module "fbdevhw"
[    15.608] (II) LoadModule: "fbdevhw"
[    15.608] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    15.608] (II) Module fbdevhw: vendor="X.Org Foundation"
[    15.608] fbdev trace: FBDevPciProbe() return
[    15.608] (WW) Falling back to old probe method for fbdev
[    15.608] fbdev trace: FBDevProbe()
[    15.608] (II) Loading sub module "fbdevhw"
[    15.608] (II) LoadModule: "fbdevhw"
[    15.609] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    15.609] (II) Module fbdevhw: vendor="X.Org Foundation"
[    15.609] fbdev: FBDevProbe() for() numDevSection=0
[    15.609] fbdev: FBDevProbe() isPci0 isISA=0
[    15.609] fbdev: FBDevProbe() calling fbdevHWProbe(NULL, '(null)', NULL)
[    15.609] (II) fbdev_open(scrnIndex=-1, dev=(null), namep=(nil))
[    15.609] (II) fbdev_open() using dev from env FRAMEBUFFER=(null)
[    15.609] (II) fbdev_open() using default dev=/dev/fb0
[    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
[    15.609] (II) fbdev_open() strstr() matches
[    15.609] (II) fbdev_open() returning -1 due to PCI device: 
sysfs_path/sys/class/graphics/fb0 
buf=../../devices/pci0000:00/0000:00:01.0/vesa-framebuffer.0/graphics/fb0
[    15.609] fbdev trace: FBDevProbe() return
[    15.609] (II) UnloadModule: "fbdev"
[    15.609] (II) UnloadSubModule: "fbdevhw"

So the issue here is the framebuffer device was a platform device but is
now a PCI device. On v6.9.7 there is no platform entry so this isn't just
a case of multiple symlinks and the 'wrong' one being used:

ls -1 /sys/devices/platform/
PNP0103:00
i8042
pcspkr
power
reg-dummy
serial8250
uevent

~ # ls -l /sys/devices/pci0000:00/0000:00:01.0/vesa-framebuffer.0/
total 0
lrwxrwxrwx    1 root     root             0 Jul 13 14:05 driver -> 
../../../../bus/platform/drivers/vesa-framebuffer

This looks likely to be caused by these Linux commits:

9eac534db0013 firmware/sysfb: Set firmware-framebuffer parent device
4e754597d603c firmware/sysfb: Create firmware device only for enabled PCI 
devices

$ git describe --contains 9eac534db0013a
v6.9-rc1~126^2~19^2~8

Reply via email to