Changeset 90180 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jul 14, 2021 12:05:26 PM (4 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/Svga.cpp
r89438 r90180 27 27 #include <iprt/memobj.h> 28 28 29 static NTSTATUS SvgaCmdBufCtxInit(VBOXWDDM_EXT_VMSVGA *pSvga, bool enable) 30 { 31 int rc = STATUS_SUCCESS; 32 33 if (enable) 34 { 35 rc = RTR0MemObjAllocPageTag(&pSvga->hMemObj, 2 << PAGE_SHIFT, 36 false /* executable R0 mapping */, "WDDMGA"); 37 38 pSvga->pvR0Hdr = RTR0MemObjAddress(pSvga->hMemObj); 39 pSvga->paHdr = RTR0MemObjGetPagePhysAddr(pSvga->hMemObj, 0/*iPage*/); 40 41 pSvga->pvR0Cmd = (uint8_t *)pSvga->pvR0Hdr + PAGE_SIZE; 42 pSvga->paCmd = RTR0MemObjGetPagePhysAddr(pSvga->hMemObj, 1/*iPage*/); 43 } 44 45 SVGACBHeader *pHdr = (SVGACBHeader *)pSvga->pvR0Hdr; 46 47 pHdr->status = SVGA_CB_STATUS_NONE; 48 pHdr->errorOffset = 0; 49 pHdr->id = 0; 50 pHdr->flags = SVGA_CB_FLAG_NONE; 51 pHdr->length = sizeof(uint32_t) + sizeof(SVGADCCmdStartStop); 52 pHdr->ptr.pa = pSvga->paCmd; 53 54 uint32_t *pu32Id = (uint32_t *)pSvga->pvR0Cmd; 55 SVGADCCmdStartStop *pCommand = (SVGADCCmdStartStop *)&pu32Id[1]; 56 57 *pu32Id = SVGA_DC_CMD_START_STOP_CONTEXT; 58 pCommand->enable = enable; 59 pCommand->context = SVGA_CB_CONTEXT_0; 60 61 SVGARegWrite(pSvga, SVGA_REG_COMMAND_HIGH, (uint32_t)(pSvga->paHdr >> 32)); 62 SVGARegWrite(pSvga, SVGA_REG_COMMAND_LOW, (uint32_t)pSvga->paHdr | 0x3f); 63 64 if (!enable) 65 { 66 RTR0MemObjFree(pSvga->hMemObj, true); 67 pSvga->hMemObj = NIL_RTR0MEMOBJ; 68 } 69 70 return rc; 71 } 72 29 73 static NTSTATUS svgaHwInit(VBOXWDDM_EXT_VMSVGA *pSvga) 30 74 { … … 70 114 } 71 115 116 if (pSvga->u32Caps & SVGA_CAP_COMMAND_BUFFERS) 117 { 118 SvgaCmdBufCtxInit(pSvga, true); 119 } 120 72 121 return Status; 73 122 } … … 95 144 pSvga->pu32GMRBits = NULL; 96 145 pSvga->cbGMRBits = 0; 146 } 147 148 if (pSvga->u32Caps & SVGA_CAP_COMMAND_BUFFERS) 149 { 150 SvgaCmdBufCtxInit(pSvga, false); 97 151 } 98 152 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/Svga.h
r86307 r90180 64 64 /** Pointer to FIFO MMIO region. */ 65 65 volatile uint32_t *pu32FIFO; 66 67 RTR0MEMOBJ hMemObj; 68 RTR0PTR pvR0Hdr, pvR0Cmd; 69 RTHCPHYS paHdr, paCmd; 66 70 67 71 /**
Note:
See TracChangeset
for help on using the changeset viewer.