[PATCH xf86-video-vmware] Fix build issues if using xserver built with meson
Tuomo Rinne
tuomo.rinne at pm.me
Wed Jan 16 21:34:55 UTC 2019
Meson defines variables as:
define XSERVER_LIBPCIACCESS
whereas autotools defines:
define XSERVER_LIBPCIACCESS 1
This fix caters for both forms.
Signed-off-by: Tuomo Rinne <tuomo.rinne at pm.me>
---
src/vmware.c | 16 ++++++++--------
src/vmware.h | 4 ++--
src/vmware_bootstrap.c | 14 +++++++-------
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/vmware.c b/src/vmware.c
index bd8ec37..4f731e4 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -341,7 +341,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
SVGA_LEGACY_BASE_PORT + SVGA_VALUE_PORT*sizeof(uint32);
} else {
/* Note: This setting of valueReg causes unaligned I/O */
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pVMWARE->portIOBase = pVMWARE->PciInfo->regions[0].base_addr;
#else
pVMWARE->portIOBase = pVMWARE->PciInfo->ioBase[0];
@@ -383,7 +383,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
}
pVMWARE->suspensionSavedRegId = id;
-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
pVMWARE->PciTag = pciTag(pVMWARE->PciInfo->bus, pVMWARE->PciInfo->device,
pVMWARE->PciInfo->func);
#endif
@@ -727,13 +727,13 @@ static Bool
VMWAREMapMem(ScrnInfoPtr pScrn)
{
VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
int err;
struct pci_device *const device = pVMWARE->PciInfo;
void *fbBase;
#endif
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
err = pci_device_map_range(device,
pVMWARE->memPhysBase,
pVMWARE->videoRam,
@@ -770,7 +770,7 @@ VMWAREUnmapMem(ScrnInfoPtr pScrn)
VmwareLog(("Unmapped: %p/%u\n", pVMWARE->FbBase, pVMWARE->videoRam));
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->FbBase, pVMWARE->videoRam);
#else
xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->FbBase, pVMWARE->videoRam);
@@ -1045,7 +1045,7 @@ static void
VMWAREInitFIFO(ScrnInfoPtr pScrn)
{
VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
struct pci_device *const device = pVMWARE->PciInfo;
int err;
void *mmioVirtBase;
@@ -1058,7 +1058,7 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn)
pVMWARE->mmioPhysBase = vmwareReadReg(pVMWARE, SVGA_REG_MEM_START);
pVMWARE->mmioSize = vmwareReadReg(pVMWARE, SVGA_REG_MEM_SIZE) & ~3;
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
err = pci_device_map_range(device, pVMWARE->mmioPhysBase,
pVMWARE->mmioSize,
PCI_DEV_MAP_FLAG_WRITABLE,
@@ -1099,7 +1099,7 @@ VMWAREStopFIFO(ScrnInfoPtr pScrn)
TRACEPOINT
vmwareWriteReg(pVMWARE, SVGA_REG_CONFIG_DONE, 0);
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
#else
xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
diff --git a/src/vmware.h b/src/vmware.h
index 028dff3..f08a283 100644
--- a/src/vmware.h
+++ b/src/vmware.h
@@ -83,7 +83,7 @@ typedef xXineramaScreenInfo VMWAREXineramaRec, *VMWAREXineramaPtr;
typedef struct {
EntityInfoPtr pEnt;
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
struct pci_device *PciInfo;
#else
pciVideoPtr PciInfo;
@@ -207,7 +207,7 @@ typedef struct {
/* Undefine this to kill all acceleration */
#define ACCELERATE_OPS
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
#define VENDOR_ID(p) (p)->vendor_id
#define DEVICE_ID(p) (p)->device_id
#define SUBVENDOR_ID(p) (p)->subvendor_id
diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
index 0cfac57..ac7c7f6 100644
--- a/src/vmware_bootstrap.c
+++ b/src/vmware_bootstrap.c
@@ -91,7 +91,7 @@ static char vmware_driver_name[] = VMWARE_DRIVER_NAME;
VMW_STRING(PACKAGE_VERSION_MAJOR) "." VMW_STRING(PACKAGE_VERSION_MINOR) \
"." VMW_STRING(PACKAGE_VERSION_PATCHLEVEL)
-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
static const char VMWAREBuildStr[] = "VMware Guest X Server "
VMWARE_DRIVER_VERSION_STRING " - build=$Name$\n";
#else
@@ -127,7 +127,7 @@ static resRange vmwareLegacyRes[] = {
#define vmwareLegacyRes NULL
#endif
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
#define VENDOR_ID(p) (p)->vendor_id
#define DEVICE_ID(p) (p)->device_id
#define SUBVENDOR_ID(p) (p)->subvendor_id
@@ -141,7 +141,7 @@ static resRange vmwareLegacyRes[] = {
#define CHIP_REVISION(p) (p)->chipRev
#endif
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
#define VMWARE_DEVICE_MATCH(d, i) \
{PCI_VENDOR_ID_VMWARE, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
@@ -220,7 +220,7 @@ vmwgfx_hosted_detect(void);
static Bool
VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
{
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
struct pci_device *pciInfo;
#else
pciVideoPtr pciInfo;
@@ -270,7 +270,7 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
return (*pScrn->PreInit)(pScrn, flags);
};
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
static Bool
VMwarePciProbe (DriverPtr drv,
int entity_num,
@@ -520,7 +520,7 @@ _X_EXPORT DriverRec vmware = {
VMWARE_DRIVER_VERSION,
vmware_driver_name,
VMWAREIdentify,
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
NULL,
#else
VMWAREProbe,
@@ -532,7 +532,7 @@ _X_EXPORT DriverRec vmware = {
VMWareDriverFunc,
#endif
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 4
-#if XSERVER_LIBPCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
VMwareDeviceMatch,
VMwarePciProbe,
#else
--
2.20.0
More information about the xorg-devel
mailing list