diff options
Diffstat (limited to 'src/vmware_bootstrap.c')
-rw-r--r-- | src/vmware_bootstrap.c | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c index ed6c740..b30cf2b 100644 --- a/src/vmware_bootstrap.c +++ b/src/vmware_bootstrap.c @@ -50,6 +50,10 @@ #include <xf86_libc.h> #endif +#ifdef XSERVER_PLATFORM_BUS +#include "xf86platformBus.h" +#endif + #ifdef HaveDriverFuncs #define VMWARE_DRIVER_FUNC HaveDriverFuncs #else @@ -247,9 +251,6 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags) vmwlegacy_hookup(pScrn); pEnt = xf86GetEntityInfo(pScrn->entityList[0]); - if (pEnt->location.type != BUS_PCI) - return FALSE; - pciInfo = xf86GetPciInfoForEntity(pEnt->index); if (pciInfo == NULL) return FALSE; @@ -407,6 +408,45 @@ VMWAREProbe(DriverPtr drv, int flags) } #endif +#ifdef XSERVER_PLATFORM_BUS +static Bool +VMwarePlatformProbe(DriverPtr drv, int entity, int flags, + struct xf86_platform_device *dev, intptr_t match_data) +{ + ScrnInfoPtr pScrn; + int scrnFlag = 0; + + if (!dev->pdev) + return FALSE; + + if (flags & PLATFORM_PROBE_GPU_SCREEN) + scrnFlag = XF86_ALLOCATE_GPU_SCREEN; + + pScrn = xf86AllocateScreen(drv, scrnFlag); + if (!pScrn) + return FALSE; + + if (xf86IsEntitySharable(entity)) + xf86SetEntityShared(entity); + + xf86AddEntityToScreen(pScrn, entity); + + pScrn->driverVersion = VMWARE_DRIVER_VERSION; + pScrn->driverName = VMWARE_DRIVER_NAME; + pScrn->name = VMWARE_NAME; + pScrn->Probe = NULL; +#ifdef BUILD_VMWGFX + vmwgfx_hookup(pScrn); +#else + vmwlegacy_hookup(pScrn); +#endif + pScrn->driverPrivate = pScrn->PreInit; + pScrn->PreInit = VMwarePreinitStub; + + return TRUE; +} +#endif + static void VMWAREIdentify(int flags) { @@ -481,6 +521,14 @@ _X_EXPORT DriverRec vmware = { #if XSERVER_LIBPCIACCESS VMwareDeviceMatch, VMwarePciProbe, +#else + NULL, + NULL, +#endif +#ifdef XSERVER_PLATFORM_BUS + VMwarePlatformProbe, +#else + NULL, #endif }; |