Driver autoload/autodetection for platform devices

Ricardo Salveti ricardo.salveti at linaro.org
Tue Aug 14 18:45:29 PDT 2012


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?

Thanks,
-- 
Ricardo Salveti de Araujo


More information about the xorg-devel mailing list