fix-old-cpp-macros_vmware.patch 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. Upstream: no (Too lazy)
  2. Reason: newer GCC don't work with these macros
  3. diff --git a/src/vmware.c b/src/vmware.c
  4. index bd8ec37..1bc1fac 100644
  5. --- a/src/vmware.c
  6. +++ b/src/vmware.c
  7. @@ -341,7 +341,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
  8. SVGA_LEGACY_BASE_PORT + SVGA_VALUE_PORT*sizeof(uint32);
  9. } else {
  10. /* Note: This setting of valueReg causes unaligned I/O */
  11. -#if XSERVER_LIBPCIACCESS
  12. +#if defined(XSERVER_LIBPCIACCESS)
  13. pVMWARE->portIOBase = pVMWARE->PciInfo->regions[0].base_addr;
  14. #else
  15. pVMWARE->portIOBase = pVMWARE->PciInfo->ioBase[0];
  16. @@ -383,7 +383,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
  17. }
  18. pVMWARE->suspensionSavedRegId = id;
  19. -#if !XSERVER_LIBPCIACCESS
  20. +#ifndef XSERVER_LIBPCIACCESS
  21. pVMWARE->PciTag = pciTag(pVMWARE->PciInfo->bus, pVMWARE->PciInfo->device,
  22. pVMWARE->PciInfo->func);
  23. #endif
  24. @@ -727,13 +727,13 @@ static Bool
  25. VMWAREMapMem(ScrnInfoPtr pScrn)
  26. {
  27. VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
  28. -#if XSERVER_LIBPCIACCESS
  29. +#if defined(XSERVER_LIBPCIACCESS)
  30. int err;
  31. struct pci_device *const device = pVMWARE->PciInfo;
  32. void *fbBase;
  33. #endif
  34. -#if XSERVER_LIBPCIACCESS
  35. +#if defined(XSERVER_LIBPCIACCESS)
  36. err = pci_device_map_range(device,
  37. pVMWARE->memPhysBase,
  38. pVMWARE->videoRam,
  39. @@ -770,7 +770,7 @@ VMWAREUnmapMem(ScrnInfoPtr pScrn)
  40. VmwareLog(("Unmapped: %p/%u\n", pVMWARE->FbBase, pVMWARE->videoRam));
  41. -#if XSERVER_LIBPCIACCESS
  42. +#if defined(XSERVER_LIBPCIACCESS)
  43. pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->FbBase, pVMWARE->videoRam);
  44. #else
  45. xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->FbBase, pVMWARE->videoRam);
  46. @@ -1045,7 +1045,7 @@ static void
  47. VMWAREInitFIFO(ScrnInfoPtr pScrn)
  48. {
  49. VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
  50. -#if XSERVER_LIBPCIACCESS
  51. +#if defined(XSERVER_LIBPCIACCESS)
  52. struct pci_device *const device = pVMWARE->PciInfo;
  53. int err;
  54. void *mmioVirtBase;
  55. @@ -1058,7 +1058,7 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn)
  56. pVMWARE->mmioPhysBase = vmwareReadReg(pVMWARE, SVGA_REG_MEM_START);
  57. pVMWARE->mmioSize = vmwareReadReg(pVMWARE, SVGA_REG_MEM_SIZE) & ~3;
  58. -#if XSERVER_LIBPCIACCESS
  59. +#if defined(XSERVER_LIBPCIACCESS)
  60. err = pci_device_map_range(device, pVMWARE->mmioPhysBase,
  61. pVMWARE->mmioSize,
  62. PCI_DEV_MAP_FLAG_WRITABLE,
  63. @@ -1099,7 +1099,7 @@ VMWAREStopFIFO(ScrnInfoPtr pScrn)
  64. TRACEPOINT
  65. vmwareWriteReg(pVMWARE, SVGA_REG_CONFIG_DONE, 0);
  66. -#if XSERVER_LIBPCIACCESS
  67. +#if defined(XSERVER_LIBPCIACCESS)
  68. pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
  69. #else
  70. xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
  71. diff --git a/src/vmware.h b/src/vmware.h
  72. index 028dff3..58676b3 100644
  73. --- a/src/vmware.h
  74. +++ b/src/vmware.h
  75. @@ -83,7 +83,7 @@ typedef xXineramaScreenInfo VMWAREXineramaRec, *VMWAREXineramaPtr;
  76. typedef struct {
  77. EntityInfoPtr pEnt;
  78. -#if XSERVER_LIBPCIACCESS
  79. +#if defined(XSERVER_LIBPCIACCESS)
  80. struct pci_device *PciInfo;
  81. #else
  82. pciVideoPtr PciInfo;
  83. @@ -207,7 +207,7 @@ typedef struct {
  84. /* Undefine this to kill all acceleration */
  85. #define ACCELERATE_OPS
  86. -#if XSERVER_LIBPCIACCESS
  87. +#if defined(XSERVER_LIBPCIACCESS)
  88. #define VENDOR_ID(p) (p)->vendor_id
  89. #define DEVICE_ID(p) (p)->device_id
  90. #define SUBVENDOR_ID(p) (p)->subvendor_id
  91. diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
  92. index 0cfac57..efe217e 100644
  93. --- a/src/vmware_bootstrap.c
  94. +++ b/src/vmware_bootstrap.c
  95. @@ -91,7 +91,7 @@ static char vmware_driver_name[] = VMWARE_DRIVER_NAME;
  96. VMW_STRING(PACKAGE_VERSION_MAJOR) "." VMW_STRING(PACKAGE_VERSION_MINOR) \
  97. "." VMW_STRING(PACKAGE_VERSION_PATCHLEVEL)
  98. -#if !XSERVER_LIBPCIACCESS
  99. +#ifndef XSERVER_LIBPCIACCESS
  100. static const char VMWAREBuildStr[] = "VMware Guest X Server "
  101. VMWARE_DRIVER_VERSION_STRING " - build=$Name$\n";
  102. #else
  103. @@ -127,7 +127,7 @@ static resRange vmwareLegacyRes[] = {
  104. #define vmwareLegacyRes NULL
  105. #endif
  106. -#if XSERVER_LIBPCIACCESS
  107. +#if defined(XSERVER_LIBPCIACCESS)
  108. #define VENDOR_ID(p) (p)->vendor_id
  109. #define DEVICE_ID(p) (p)->device_id
  110. #define SUBVENDOR_ID(p) (p)->subvendor_id
  111. @@ -141,7 +141,7 @@ static resRange vmwareLegacyRes[] = {
  112. #define CHIP_REVISION(p) (p)->chipRev
  113. #endif
  114. -#if XSERVER_LIBPCIACCESS
  115. +#if defined(XSERVER_LIBPCIACCESS)
  116. #define VMWARE_DEVICE_MATCH(d, i) \
  117. {PCI_VENDOR_ID_VMWARE, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
  118. @@ -220,7 +220,7 @@ vmwgfx_hosted_detect(void);
  119. static Bool
  120. VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
  121. {
  122. -#if XSERVER_LIBPCIACCESS
  123. +#if defined(XSERVER_LIBPCIACCESS)
  124. struct pci_device *pciInfo;
  125. #else
  126. pciVideoPtr pciInfo;
  127. @@ -270,7 +270,7 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
  128. return (*pScrn->PreInit)(pScrn, flags);
  129. };
  130. -#if XSERVER_LIBPCIACCESS
  131. +#if defined(XSERVER_LIBPCIACCESS)
  132. static Bool
  133. VMwarePciProbe (DriverPtr drv,
  134. int entity_num,
  135. @@ -520,7 +520,7 @@ _X_EXPORT DriverRec vmware = {
  136. VMWARE_DRIVER_VERSION,
  137. vmware_driver_name,
  138. VMWAREIdentify,
  139. -#if XSERVER_LIBPCIACCESS
  140. +#if defined(XSERVER_LIBPCIACCESS)
  141. NULL,
  142. #else
  143. VMWAREProbe,
  144. @@ -532,7 +532,7 @@ _X_EXPORT DriverRec vmware = {
  145. VMWareDriverFunc,
  146. #endif
  147. #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 4
  148. -#if XSERVER_LIBPCIACCESS
  149. +#if defined(XSERVER_LIBPCIACCESS)
  150. VMwareDeviceMatch,
  151. VMwarePciProbe,
  152. #else