Bug 91820

Summary: Xserver does not handle xf86_num_platform_devices == 0 situation
Product: xorg Reporter: Marcin Juszkiewicz <marcin>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: keithp
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xorg.conf snippet with BusID
none
xserver patch
none
Xorg.0.log when it fails to find card
none
Xorg.0.log when it finds card
none
lspci output
none
dmesg none

Description Marcin Juszkiewicz 2015-08-31 12:39:32 UTC
Created attachment 118008 [details]
xorg.conf snippet with BusID

I have APM Mustang (AArch64 (64-bit ARMv8) architecture) on my desk. As it has x8 pcie slot I connected Radeon HD5450 graphics card to it. But to get X11 running I need to have xorg.conf snippet (attached).

Digged into xserver source and found why it happens:

Configure sets CONFIG_UDEV_KMS variable and then XSERVER_PLATFORM_BUS is set as well. 

Then we have xf86BusProbe() function in hw/xfree86/common/xf86Bus.c (xserver source file). If XSERVER_PLATFORM_BUS is defined then xf86platformProbe() is called. And then it fails.

But if I disable that block then xf86PciProbe() is called and xserver finds PCIe card properly.

So let's check why it fails in xf86platformProbe()...

xf86platformProbe() calls config_odev_probe(xf86PlatformDeviceProbe) (argument is callback name)

xf86PlatformDeviceProbe() goes xf86_num_platform_devices times over xf86_platform_odev_attributes table to find /dev/dri/card0 entry.

The problem is that xf86_num_platform_devices == 0 so there is nothing to search for.
Comment 1 Marcin Juszkiewicz 2015-08-31 12:40:10 UTC
Created attachment 118009 [details] [review]
xserver patch

No idea is it best way to do that but this one worked for me.
Comment 2 Marcin Juszkiewicz 2015-08-31 12:40:50 UTC
Created attachment 118010 [details]
Xorg.0.log when it fails to find card
Comment 3 Marcin Juszkiewicz 2015-08-31 12:41:14 UTC
Created attachment 118011 [details]
Xorg.0.log when it finds card
Comment 4 Marcin Juszkiewicz 2015-08-31 12:41:38 UTC
Created attachment 118012 [details]
lspci output
Comment 5 Marcin Juszkiewicz 2015-08-31 12:41:56 UTC
Created attachment 118013 [details]
dmesg
Comment 6 Marcin Juszkiewicz 2015-08-31 12:42:20 UTC
First reported in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1256933
Comment 7 Alan Coopersmith 2015-08-31 15:03:32 UTC
Note that the Xserver maintainer does not pull patches from bugzilla but
from the xorg-devel mailing list, so to get this patch applied you'll need
to send it there for code review, then to keith to be applied with the
necessary Reviewed-by tags included.

http://wiki.x.org/wiki/Development/Documentation/SubmittingPatches/
Comment 8 Marcin Juszkiewicz 2015-08-31 18:31:08 UTC
Thanks Alan - subscribed to ML and sent patch there.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.