Bug 91820 - Xserver does not handle xf86_num_platform_devices == 0 situation
Summary: Xserver does not handle xf86_num_platform_devices == 0 situation
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-31 12:39 UTC by Marcin Juszkiewicz
Modified: 2016-10-11 08:35 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
xorg.conf snippet with BusID (345 bytes, text/plain)
2015-08-31 12:39 UTC, Marcin Juszkiewicz
no flags Details
xserver patch (411 bytes, patch)
2015-08-31 12:40 UTC, Marcin Juszkiewicz
no flags Details | Splinter Review
Xorg.0.log when it fails to find card (19.30 KB, text/plain)
2015-08-31 12:40 UTC, Marcin Juszkiewicz
no flags Details
Xorg.0.log when it finds card (38.03 KB, text/plain)
2015-08-31 12:41 UTC, Marcin Juszkiewicz
no flags Details
lspci output (8.81 KB, text/plain)
2015-08-31 12:41 UTC, Marcin Juszkiewicz
no flags Details
dmesg (42.35 KB, text/plain)
2015-08-31 12:41 UTC, Marcin Juszkiewicz
no flags Details

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.