Driver autoload/autodetection for platform devices

Ricardo Salveti ricardo.salveti at
Tue Aug 14 19:08:18 PDT 2012

On Tue, Aug 14, 2012 at 10:45 PM, Ricardo Salveti
<ricardo.salveti at> wrote:
> Hey,
> I'm looking at the latest code included to support platform devices,
> and platform bus, and I'm trying to understand how it can be used to
> dynamically autoload/autodetect the drivers available at the system.
> At my current use case, I'm trying to get the xserver to automatically
> load the xf86-video-omap driver in case it's available at the system,
> and I'm running at a Pandaboard. Currently to make the driver to load,
> you need to create a xorg.conf just to point out to xserver which
> driver to load, and as I know platform devices support was improved by
> Dave, I want to understand what would be the steps needed to avoid
> having the xorg config file at the system just to use the omap xorg
> driver.
> Looking at the latest platform related code included by Dave, this is
> what is happening at my current system:
> 1 - xf86platformProbe is called, which register the udev callback for
> xf86PlatformDeviceProbe, which is also executed as we have a a valid
> dri/card0 available at the system (linux 3.4, using omap drm);
> 2 - The platform device for /dev/dri/card0 is registered by
> xf86_add_platform_device, setting the correct attributes but setting
> pdev as NULL;
> 3 - listPossibleVideoDrivers calls xf86PlatformMatchDriver, but as
> pdev is still null, it doesn't call xf86MatchDriverFromFiles;
> 4 - Xorg then loads fbdev and moves on;
> As we don't have a common bus to probe for devices, one way would be
> to also depend on xf86MatchDriverFromFiles, but for that we'd need to
> make sure we're probing the correct device/vendor id from the platform
> device. I don't know much about the details on how this could be done
> with drm/kms, so that's why I first wanted to know if that would be a
> really  a valid path.
> Is there any other way where we could change at Xorg to be able to
> dynamically detect/load the platform (without a pci bus to probe)
> specific drivers?

Also, another issue I just noticed, is that even if we get the
autoload/autodetect at the Xorg side, it'll still load fbdev even
after omap is loaded (loading 2 different screens).

Looking at the code, it seems that this happens because there's no way
to control if the slot was claimed, because the omap driver uses
xf86ClaimNoSlot instead of xf86ClaimPlatformSlot (not yet public, but
would probably be the one to be called).

So I believe another change that would be needed is to export
xf86ClaimPlatformSlot as well, unless there's another way to control
tell fbdev not to load it's own driver.

Ricardo Salveti de Araujo

More information about the xorg-devel mailing list