From c8e1c498431b1f8758f62c94131c302cf3d07b39 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Mon, 16 Dec 2013 06:05:35 -0800 Subject: vmwgfx: Add an infrastructure to be able to run hosted under a compositor v2 Figure out what's needed both for XMir and XWayland and make a common driver structure out of it. v2: Added a lot of comments. No code change. Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul Reviewed-by: Jakob Bornecrantz --- src/vmware_bootstrap.c | 19 +++++++++++++++++-- src/vmware_bootstrap.h | 2 ++ 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c index bb58325..57f8ae9 100644 --- a/src/vmware_bootstrap.c +++ b/src/vmware_bootstrap.c @@ -199,6 +199,12 @@ OptionInfoPtr VMWARECopyOptions(void) return options; } +/* + * Also in vmwgfx_hosted.h, which we don't include. + */ +void * +vmwgfx_hosted_detect(void); + static Bool VMwarePreinitStub(ScrnInfoPtr pScrn, int flags) { @@ -220,6 +226,11 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags) if ((*pScrn->PreInit)(pScrn, flags)) return TRUE; + /* + * Can't run legacy hosted + */ + if (vmwgfx_hosted_detect()) + return FALSE; #else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Driver was compiled without KMS- and 3D support.\n"); @@ -413,15 +424,19 @@ VMWareDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer data) { - CARD32 *flag; + uint32_t *flag; xorgRRModeMM *modemm; switch (op) { case GET_REQUIRED_HW_INTERFACES: - flag = (CARD32 *)data; + flag = (uint32_t *)data; if (flag) { +#ifdef BUILD_VMWGFX + vmwgfx_modify_flags(flag); +#else *flag = HW_IO | HW_MMIO; +#endif } return TRUE; case RR_GET_MODE_MM: diff --git a/src/vmware_bootstrap.h b/src/vmware_bootstrap.h index f72d298..b71d3cd 100644 --- a/src/vmware_bootstrap.h +++ b/src/vmware_bootstrap.h @@ -52,6 +52,8 @@ vmwlegacy_hookup(ScrnInfoPtr pScrn); #ifdef BUILD_VMWGFX void vmwgfx_hookup(ScrnInfoPtr pScrn); +void +vmwgfx_modify_flags(uint32_t *flags); #endif /* defined(BUILD_VMWGFX) */ #ifdef XFree86LOADER -- cgit v1.2.3