summaryrefslogtreecommitdiff
path: root/src/vmware.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vmware.c')
-rw-r--r--src/vmware.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vmware.c b/src/vmware.c
index 55bde22..fa01dca 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -299,7 +299,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])
@@ -310,6 +310,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];
@@ -1342,7 +1345,7 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn)
int err;
void *mmioVirtBase;
#endif
- CARD32* vmwareFIFO;
+ volatile CARD32* vmwareFIFO;
Bool extendedFifo;
int min;
@@ -1373,6 +1376,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);