summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-05-06 16:00:50 +0200
committerHans de Goede <hdegoede@redhat.com>2014-05-14 12:08:17 +0200
commit675fe58eee8acdb302c3501236b86a3289991053 (patch)
tree23d619ed4d410414cf94e7a5c8afd4afad81c7ed
parent88c487cb19aaf2882d582f7f887a52935ef8d92e (diff)
Add support for XSERVER_PLATFORM_BUS
This is a preparation patch for adding support for server managed fds. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
-rw-r--r--src/vmware.c3
-rw-r--r--src/vmware_bootstrap.c54
-rw-r--r--vmwgfx/vmwgfx_driver.c4
3 files changed, 53 insertions, 8 deletions
diff --git a/src/vmware.c b/src/vmware.c
index 6b74e14..17434ab 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -310,9 +310,6 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
pVMWARE->pvtSema = &pScrn->vtSema;
pVMWARE->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
- if (pVMWARE->pEnt->location.type != BUS_PCI) {
- return FALSE;
- }
pVMWARE->PciInfo = xf86GetPciInfoForEntity(pVMWARE->pEnt->index);
if (pVMWARE->PciInfo == NULL) {
return FALSE;
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
};
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
index 2d38d2a..7e5dc4e 100644
--- a/vmwgfx/vmwgfx_driver.c
+++ b/vmwgfx/vmwgfx_driver.c
@@ -465,13 +465,13 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
pScrn->displayWidth = 640; /* default it */
- if (ms->pEnt->location.type != BUS_PCI) {
+ ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
+ if (!ms->PciInfo) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Incorrect bus for device.\n");
goto out_err_bus;
}
- ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
xf86SetPrimInitDone(pScrn->entityList[0]);
ms->hdriver = vmwgfx_hosted_detect();