diff options
-rw-r--r-- | src/intel_driver.c | 9 | ||||
-rw-r--r-- | src/intel_module.c | 50 |
2 files changed, 57 insertions, 2 deletions
diff --git a/src/intel_driver.c b/src/intel_driver.c index c5be6793..76d56d92 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -452,7 +452,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 e5f98d4c..cfd92e97 100644 --- a/src/intel_module.c +++ b/src/intel_module.c @@ -47,6 +47,10 @@ #include "legacy/legacy.h" #include "sna/sna_module.h" +#ifdef XSERVER_PLATFORM_BUS +#include <xf86platformBus.h> +#endif + static const struct intel_device_info intel_generic_info = { .gen = -1, }; @@ -525,6 +529,47 @@ 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; + + scrn = xf86AllocateScreen(driver, 0); + xf86AddEntityToScreen(scrn, entity_num); + + scrn->driverVersion = INTEL_VERSION; + scrn->driverName = INTEL_DRIVER_NAME; + scrn->name = INTEL_NAME; + scrn->driverPrivate = (void *)(match_data | 1); + 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); @@ -569,7 +614,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, |