diff options
author | Dave Airlie <airlied@redhat.com> | 2012-07-25 16:11:23 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-07-26 10:37:48 +1000 |
commit | b123d5a89ed6f5156d0fea855e213c355184510f (patch) | |
tree | 4495e17ccfb57fe2dc5ab1d4fddf098e6a76a4cf | |
parent | c1785aaca2c9347114d28f114ee59ef8206d829b (diff) |
intel: add platform probing support.
This allows the driver to be loaded by the platform loading code.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | src/intel_driver.c | 9 | ||||
-rw-r--r-- | src/intel_module.c | 51 |
2 files changed, 58 insertions, 2 deletions
diff --git a/src/intel_driver.c b/src/intel_driver.c index cab7b4ee..b30e7c2b 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -461,7 +461,14 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags) return FALSE; pEnt = xf86GetEntityInfo(scrn->entityList[0]); - if (pEnt == NULL || pEnt->location.type != BUS_PCI) + if (pEnt == NULL) + return NULL; + + if (pEnt->location.type != BUS_PCI +#ifdef XSERVER_PLATFORM_BUS + && pEnt->location.type != BUS_PLATFORM +#endif + ) return FALSE; if (flags & PROBE_DETECT) diff --git a/src/intel_module.c b/src/intel_module.c index 845b40eb..0bb6e4c4 100644 --- a/src/intel_module.c +++ b/src/intel_module.c @@ -44,6 +44,10 @@ #include "legacy/legacy.h" #include "sna/sna_module.h" +#ifdef XSERVER_PLATFORM_BUS +#include <xf86platformBus.h> +#endif + static struct intel_device_info *chipset_info; static const struct intel_device_info intel_generic_info = { @@ -425,6 +429,48 @@ static Bool intel_pci_probe(DriverPtr driver, } } +#ifdef XSERVER_PLATFORM_BUS +static Bool +intel_platform_probe(DriverPtr driver, + int entity_num, int flags, + struct xf86_platform_device *dev, + intptr_t match_data) +{ + ScrnInfoPtr scrn = NULL; + char *path = xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_PATH); + + if (!dev->pdev) + return FALSE; + /* if we get any flags we don't understand fail to probe for now */ + if (flags) + return FALSE; + + chipset_info = (void *)match_data; + + scrn = xf86AllocateScreen(driver, 0); + xf86AddEntityToScreen(scrn, entity_num); + + scrn->driverVersion = INTEL_VERSION; + scrn->driverName = INTEL_DRIVER_NAME; + scrn->name = INTEL_NAME; + scrn->Probe = NULL; + switch (get_accel_method()) { +#if USE_SNA + case SNA: sna_init_scrn(scrn, entity_num); break; +#endif + +#if USE_UXA + case UXA: intel_init_scrn(scrn); break; +#endif + default: break; + } + + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "using drv %s\n", path ? path : "Default device"); + return scrn != NULL; +} +#endif + #ifdef XFree86LOADER static MODULESETUPPROTO(intel_setup); @@ -469,7 +515,10 @@ static DriverRec intel = { 0, intel_driver_func, intel_device_match, - intel_pci_probe + intel_pci_probe, +#ifdef XSERVER_PLATFORM_BUS + intel_platform_probe +#endif }; static pointer intel_setup(pointer module, |