diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/vmware.c | 15 | ||||
-rw-r--r-- | src/vmware.h | 8 | ||||
-rw-r--r-- | src/vmwarectrl.c | 40 | ||||
-rw-r--r-- | src/vmwaremodes.c | 3 | ||||
-rw-r--r-- | src/vmwarexinerama.c | 106 |
6 files changed, 114 insertions, 60 deletions
diff --git a/configure.ac b/configure.ac index 9af67a4..3aec9af 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-vmware], - [11.0.3], + [11.0.99.901], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-video-vmware]) AC_CONFIG_SRCDIR([Makefile.am]) diff --git a/src/vmware.c b/src/vmware.c index 3f5e486..9160cf2 100644 --- a/src/vmware.c +++ b/src/vmware.c @@ -121,7 +121,7 @@ vmwareWriteReg(VMWAREPtr pVMWARE, int index, CARD32 value) void vmwareWriteWordToFIFO(VMWAREPtr pVMWARE, CARD32 value) { - CARD32* vmwareFIFO = pVMWARE->vmwareFIFO; + volatile CARD32* vmwareFIFO = pVMWARE->vmwareFIFO; /* Need to sync? */ if ((vmwareFIFO[SVGA_FIFO_NEXT_CMD] + sizeof(CARD32) == vmwareFIFO[SVGA_FIFO_STOP]) @@ -132,6 +132,9 @@ vmwareWriteWordToFIFO(VMWAREPtr pVMWARE, CARD32 value) } vmwareFIFO[vmwareFIFO[SVGA_FIFO_NEXT_CMD] / sizeof(CARD32)] = value; + + write_mem_barrier(); + if(vmwareFIFO[SVGA_FIFO_NEXT_CMD] == vmwareFIFO[SVGA_FIFO_MAX] - sizeof(CARD32)) { vmwareFIFO[SVGA_FIFO_NEXT_CMD] = vmwareFIFO[SVGA_FIFO_MIN]; @@ -299,9 +302,11 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags) uint32 width = 0, height = 0; Bool defaultMode; +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12 #ifndef BUILD_FOR_420 domainIOBase = pScrn->domainIOBase; #endif +#endif if (flags & PROBE_DETECT) { return FALSE; @@ -653,7 +658,8 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags) } i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, pScrn->display->modes, - clockRanges, NULL, 256, pVMWARE->maxWidth, 32 * 32, + clockRanges, NULL, 256, pVMWARE->maxWidth, + pVMWARE->bitsPerPixel * 1, 128, pVMWARE->maxHeight, pScrn->display->virtualX, pScrn->display->virtualY, pVMWARE->videoRam, @@ -1022,7 +1028,7 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn) int err; void *mmioVirtBase; #endif - CARD32* vmwareFIFO; + volatile CARD32* vmwareFIFO; Bool extendedFifo; int min; @@ -1053,6 +1059,9 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn) extendedFifo = pVMWARE->vmwareCapability & SVGA_CAP_EXTENDED_FIFO; min = extendedFifo ? vmwareReadReg(pVMWARE, SVGA_REG_MEM_REGS) : 4; + vmwareWaitForFB(pVMWARE); + vmwareWriteReg(pVMWARE, SVGA_REG_CONFIG_DONE, 0); + vmwareFIFO[SVGA_FIFO_MIN] = min * sizeof(CARD32); vmwareFIFO[SVGA_FIFO_MAX] = pVMWARE->mmioSize; vmwareFIFO[SVGA_FIFO_NEXT_CMD] = min * sizeof(CARD32); diff --git a/src/vmware.h b/src/vmware.h index cf32462..0385292 100644 --- a/src/vmware.h +++ b/src/vmware.h @@ -43,6 +43,14 @@ #include "svga_reg.h" #include "svga_struct.h" +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12 +#define _swapl(x, n) swapl(x,n) +#define _swaps(x, n) swaps(x,n) +#else +#define _swapl(x, n) swapl(x) +#define _swaps(x, n) swaps(x) +#endif + /* * The virtual hardware's cursor limits are pretty big. Some VMware * product versions limit to 1024x1024 pixels, others limit to 128 diff --git a/src/vmwarectrl.c b/src/vmwarectrl.c index d021eb7..d31bef6 100644 --- a/src/vmwarectrl.c +++ b/src/vmwarectrl.c @@ -82,10 +82,10 @@ VMwareCtrlQueryVersion(ClientPtr client) rep.majorVersion = VMWARE_CTRL_MAJOR_VERSION; rep.minorVersion = VMWARE_CTRL_MINOR_VERSION; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); + _swaps(&rep.sequenceNumber, n); + _swapl(&rep.length, n); + _swapl(&rep.majorVersion, n); + _swapl(&rep.minorVersion, n); } WriteToClient(client, sizeof(xVMwareCtrlQueryVersionReply), (char *)&rep); @@ -225,11 +225,11 @@ VMwareCtrlSetRes(ClientPtr client) rep.x = stuff->x; rep.y = stuff->y; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.screen, n); - swapl(&rep.x, n); - swapl(&rep.y, n); + _swaps(&rep.sequenceNumber, n); + _swapl(&rep.length, n); + _swapl(&rep.screen, n); + _swapl(&rep.x, n); + _swapl(&rep.y, n); } WriteToClient(client, sizeof(xVMwareCtrlSetResReply), (char *)&rep); @@ -379,9 +379,9 @@ VMwareCtrlSetTopology(ClientPtr client) rep.sequenceNumber = client->sequence; rep.screen = stuff->screen; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.screen, n); + _swaps(&rep.sequenceNumber, n); + _swapl(&rep.length, n); + _swapl(&rep.screen, n); } WriteToClient(client, sizeof(xVMwareCtrlSetTopologyReply), (char *)&rep); @@ -448,7 +448,7 @@ SVMwareCtrlQueryVersion(ClientPtr client) REQUEST(xVMwareCtrlQueryVersionReq); REQUEST_SIZE_MATCH(xVMwareCtrlQueryVersionReq); - swaps(&stuff->length, n); + _swaps(&stuff->length, n); return VMwareCtrlQueryVersion(client); } @@ -479,10 +479,10 @@ SVMwareCtrlSetRes(ClientPtr client) REQUEST(xVMwareCtrlSetResReq); REQUEST_SIZE_MATCH(xVMwareCtrlSetResReq); - swaps(&stuff->length, n); - swapl(&stuff->screen, n); - swapl(&stuff->x, n); - swapl(&stuff->y, n); + _swaps(&stuff->length, n); + _swapl(&stuff->screen, n); + _swapl(&stuff->x, n); + _swapl(&stuff->y, n); return VMwareCtrlSetRes(client); } @@ -513,9 +513,9 @@ SVMwareCtrlSetTopology(ClientPtr client) REQUEST(xVMwareCtrlSetTopologyReq); REQUEST_SIZE_MATCH(xVMwareCtrlSetTopologyReq); - swaps(&stuff->length, n); - swapl(&stuff->screen, n); - swapl(&stuff->number, n); + _swaps(&stuff->length, n); + _swapl(&stuff->screen, n); + _swapl(&stuff->number, n); /* Each extent is a struct of shorts. */ SwapRestS(stuff); diff --git a/src/vmwaremodes.c b/src/vmwaremodes.c index 9a7b757..2965dca 100644 --- a/src/vmwaremodes.c +++ b/src/vmwaremodes.c @@ -138,6 +138,9 @@ vmwareAddDefaultMode(ScrnInfoPtr pScrn, uint32 dwidth, uint32 dheight) if (dispModeCount == 0) { /* + * Set up a large virtual size, so that we allow also + * setting modes larger than the initial mode. + * * We might also want to consider the case where * dispModeCount != 0, but the requested display modes * are not available. This is sufficient for now. diff --git a/src/vmwarexinerama.c b/src/vmwarexinerama.c index 3476f43..954abdc 100644 --- a/src/vmwarexinerama.c +++ b/src/vmwarexinerama.c @@ -48,6 +48,26 @@ #include <xf86_libc.h> #endif +/* + * LookupWindow was removed with video abi 11. + */ +#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4) +#ifndef DixGetAttrAccess +#define DixGetAttrAccess (1<<4) +#endif +#endif + +#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 2) +static inline int +dixLookupWindow(WindowPtr *pWin, XID id, ClientPtr client, Mask access) +{ + *pWin = LookupWindow(id, client); + if (!*pWin) + return BadWindow; + return Success; +} +#endif + /* *---------------------------------------------------------------------------- @@ -79,10 +99,10 @@ VMwareXineramaQueryVersion(ClientPtr client) rep.majorVersion = 1; rep.minorVersion = 0; if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); + _swaps(&rep.sequenceNumber, n); + _swapl(&rep.length, n); + _swaps(&rep.majorVersion, n); + _swaps(&rep.minorVersion, n); } WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep); return (client->noClientException); @@ -116,10 +136,12 @@ VMwareXineramaGetState(ClientPtr client) ExtensionEntry *ext; ScrnInfoPtr pScrn; VMWAREPtr pVMWARE; + int rc; REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - pWin = LookupWindow(stuff->window, client); - if(!pWin) return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); + if (rc != Success) + return rc; if (!(ext = CheckExtension(PANORAMIX_PROTOCOL_NAME))) { return BadMatch; @@ -131,10 +153,11 @@ VMwareXineramaGetState(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; rep.state = pVMWARE->xinerama; + rep.window = stuff->window; if(client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swaps (&rep.state, n); + _swaps (&rep.sequenceNumber, n); + _swapl (&rep.length, n); + _swapl (&rep.window, n); } WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep); return client->noClientException; @@ -168,10 +191,12 @@ VMwareXineramaGetScreenCount(ClientPtr client) ExtensionEntry *ext; ScrnInfoPtr pScrn; VMWAREPtr pVMWARE; + int rc; REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - pWin = LookupWindow(stuff->window, client); - if(!pWin) return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); + if (rc != Success) + return rc; if (!(ext = CheckExtension(PANORAMIX_PROTOCOL_NAME))) { return BadMatch; @@ -183,10 +208,12 @@ VMwareXineramaGetScreenCount(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; rep.ScreenCount = pVMWARE->xineramaNumOutputs; + rep.window = stuff->window; + if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.ScreenCount, n); + _swaps(&rep.sequenceNumber, n); + _swapl(&rep.length, n); + _swapl(&rep.window, n); } WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); return client->noClientException; @@ -220,10 +247,13 @@ VMwareXineramaGetScreenSize(ClientPtr client) ExtensionEntry *ext; ScrnInfoPtr pScrn; VMWAREPtr pVMWARE; + int rc; + REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); - pWin = LookupWindow (stuff->window, client); - if(!pWin) return BadWindow; + rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); + if (rc != Success) + return rc; if (!(ext = CheckExtension(PANORAMIX_PROTOCOL_NAME))) { return BadMatch; @@ -236,11 +266,15 @@ VMwareXineramaGetScreenSize(ClientPtr client) rep.sequenceNumber = client->sequence; rep.width = pVMWARE->xineramaState[stuff->screen].width; rep.height = pVMWARE->xineramaState[stuff->screen].height; + rep.window = stuff->window; + rep.screen = stuff->screen; if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.width, n); - swaps(&rep.height, n); + _swaps(&rep.sequenceNumber, n); + _swapl(&rep.length, n); + _swapl(&rep.width, n); + _swapl(&rep.height, n); + _swapl(&rep.window, n); + _swapl(&rep.screen, n); } WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); return client->noClientException; @@ -286,9 +320,9 @@ VMwareXineramaIsActive(ClientPtr client) rep.state = pVMWARE->xinerama; if(client->swapped) { register int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.state, n); + _swaps(&rep.sequenceNumber, n); + _swapl(&rep.length, n); + _swapl(&rep.state, n); } WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); return client->noClientException; @@ -334,9 +368,9 @@ VMwareXineramaQueryScreens(ClientPtr client) rep.length = rep.number * sz_XineramaScreenInfo >> 2; if(client->swapped) { register int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.number, n); + _swaps(&rep.sequenceNumber, n); + _swapl(&rep.length, n); + _swapl(&rep.number, n); } WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *)&rep); @@ -351,10 +385,10 @@ VMwareXineramaQueryScreens(ClientPtr client) scratch.height = pVMWARE->xineramaState[i].height; if(client->swapped) { register int n; - swaps(&scratch.x_org, n); - swaps(&scratch.y_org, n); - swaps(&scratch.width, n); - swaps(&scratch.height, n); + _swaps(&scratch.x_org, n); + _swaps(&scratch.y_org, n); + _swaps(&scratch.width, n); + _swaps(&scratch.height, n); } WriteToClient(client, sz_XineramaScreenInfo, (char *)&scratch); } @@ -425,7 +459,7 @@ SVMwareXineramaQueryVersion (ClientPtr client) { REQUEST(xPanoramiXQueryVersionReq); register int n; - swaps(&stuff->length,n); + _swaps(&stuff->length,n); REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); return VMwareXineramaQueryVersion(client); } @@ -453,7 +487,7 @@ SVMwareXineramaGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); register int n; - swaps (&stuff->length, n); + _swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); return VMwareXineramaGetState(client); } @@ -481,7 +515,7 @@ SVMwareXineramaGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); register int n; - swaps (&stuff->length, n); + _swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); return VMwareXineramaGetScreenCount(client); } @@ -509,7 +543,7 @@ SVMwareXineramaGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); register int n; - swaps (&stuff->length, n); + _swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); return VMwareXineramaGetScreenSize(client); } @@ -537,7 +571,7 @@ SVMwareXineramaIsActive(ClientPtr client) { REQUEST(xXineramaIsActiveReq); register int n; - swaps (&stuff->length, n); + _swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xXineramaIsActiveReq); return VMwareXineramaIsActive(client); } @@ -565,7 +599,7 @@ SVMwareXineramaQueryScreens(ClientPtr client) { REQUEST(xXineramaQueryScreensReq); register int n; - swaps (&stuff->length, n); + _swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); return VMwareXineramaQueryScreens(client); } |