Changeset 93834 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video
- Timestamp:
- Feb 17, 2022 9:11:03 PM (3 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
r93115 r93834 133 133 } 134 134 135 /** @todo The size of each Object Table should not be hardcoded but estimated using some VMSVGA device limits **/ 136 static NTSTATUS SvgaObjectTablesInit(VBOXWDDM_EXT_VMSVGA *pSvga, bool enable) 137 { 138 uint32_t idCmdHdr = UINT32_MAX; 139 void *pvCmd = NULL; 140 int rc = STATUS_SUCCESS; 141 142 if (enable) 143 { 144 rc = RTR0MemObjAllocPageTag(&pSvga->hMemObjOTables, (SVGA_OTABLE_DXCONTEXT + 1) * PAGE_SIZE, 145 false /* executable R0 mapping */, "WDDMGA"); 146 } 147 else 148 { 149 rc = RTR0MemObjFree(pSvga->hMemObjOTables, true); 150 pSvga->hMemObjOTables = NIL_RTR0MEMOBJ; 151 return rc; 152 } 153 154 idCmdHdr = SvgaCmdBufReserve(pSvga); 155 156 if (idCmdHdr < pSvga->u32NumCmdBufs) 157 { 158 pvCmd = pSvga->pvR0Cmd; 159 } 160 else 161 { 162 GALOGREL(32, ("WDDM: SvgaCmdBufReserve failed\n")); 163 return STATUS_INSUFFICIENT_RESOURCES; 164 } 165 166 SVGA3dCmdHeader *pHeader = (SVGA3dCmdHeader *)pvCmd; 167 SVGA3dCmdSetOTableBase64 *pCommand = (SVGA3dCmdSetOTableBase64 *)&pHeader[1]; 168 uint32_t cbSubmit = 0; 169 uint32_t idOTable; 170 171 for(idOTable = 0; idOTable <= SVGA_OTABLE_DXCONTEXT; idOTable++) 172 { 173 RTHCPHYS paOT = RTR0MemObjGetPagePhysAddr(pSvga->hMemObjOTables, idOTable); 174 175 pHeader->id = SVGA_3D_CMD_SET_OTABLE_BASE64; 176 pHeader->size = sizeof(SVGA3dCmdSetOTableBase64); 177 pCommand->type = (SVGAOTableType)idOTable; 178 pCommand->baseAddress = paOT >> 12; 179 pCommand->sizeInBytes = PAGE_SIZE; 180 pCommand->validSizeInBytes = 0; 181 pCommand->ptDepth = SVGA3D_MOBFMT_PTDEPTH64_0; 182 183 cbSubmit += sizeof(SVGA3dCmdHeader) + sizeof(SVGA3dCmdSetOTableBase64); 184 185 pHeader = (SVGA3dCmdHeader *)&pCommand[1]; 186 pCommand = (SVGA3dCmdSetOTableBase64 *)&pHeader[1]; 187 } 188 189 SvgaCmdBufSubmit(pSvga, cbSubmit, idCmdHdr); 190 191 AssertRC(rc); 192 return rc; 193 } 194 135 195 static NTSTATUS svgaHwInit(VBOXWDDM_EXT_VMSVGA *pSvga) 136 196 { … … 179 239 { 180 240 SvgaCmdBufCtxInit(pSvga, true); 241 SvgaObjectTablesInit(pSvga, true); 181 242 } 182 243 … … 210 271 if (pSvga->u32Caps & SVGA_CAP_COMMAND_BUFFERS) 211 272 { 273 SvgaObjectTablesInit(pSvga, false); 212 274 SvgaCmdBufCtxInit(pSvga, false); 213 275 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/Svga.h
r93349 r93834 73 73 RTHCPHYS paHdr, paCmd; 74 74 uint32_t u32NumCmdBufs; 75 76 RTR0MEMOBJ hMemObjOTables; 75 77 76 78 /**
Note:
See TracChangeset
for help on using the changeset viewer.