Changeset 50831 in vbox for trunk/src/VBox
- Timestamp:
- Mar 20, 2014 5:40:50 PM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp
r50777 r50831 1116 1116 1117 1117 cbBuffer -= RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, aSysMem); 1118 uint32_t i = 0; 1119 1120 for (; cPages && cbBuffer >= sizeof (VBOXCMDVBVA_PAGING_TRANSFER); ++cEls, cbBuffer-=sizeof (VBOXCMDVBVA_SYSMEMEL), ++pEl, ++i) 1118 1119 for (; cPages && cbBuffer >= sizeof (VBOXCMDVBVA_SYSMEMEL); ++cEls, cbBuffer-=sizeof (VBOXCMDVBVA_SYSMEMEL), ++pEl) 1121 1120 { 1122 1121 cPages = vboxCVDdiSysMemElBuild(pEl, pMdl, iPfn + cInitPages - cPages, cPages); 1123 1122 } 1124 1125 pCmd->cSysMem = i;1126 1123 1127 1124 done: -
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r50812 r50831 22 22 #include <iprt/asm.h> 23 23 #include <iprt/list.h> 24 #include <iprt/param.h> 24 25 25 26 #include "DevVGA.h" … … 1157 1158 } 1158 1159 1159 1160 /* 1161 * @returns 1162 * 1160 /** 1161 * @param fIn - whether this is a page in or out op. 1162 * the direction is VRA#M - related, so fIn == true - transfer to VRAM); false - transfer from VRAM 1163 1163 */ 1164 static int vboxVDMACrCmdProcess(struct VBOXVDMAHOST *pVdma, uint8_t* pu8Cmd, uint32_t cbCmd) 1164 static int vboxVDMACrCmdVbvaProcessPagingEl(PPDMDEVINS pDevIns, const VBOXCMDVBVA_SYSMEMEL *pMemEl, uint8_t *pu8Vram, uint8_t *pu8VramMax, uint8_t **ppu8VramNext, bool fIn) 1165 { 1166 uint32_t u32Cpages = pMemEl->cPagesAfterFirst + 1; 1167 RTGCPHYS phPage = (pMemEl->iPage1 | (pMemEl->iPage2 << 20)); 1168 PGMPAGEMAPLOCK Lock; 1169 uint32_t cbCopy = u32Cpages * PAGE_SIZE; 1170 uint8_t* pu8VramNext = pu8Vram + cbCopy; 1171 1172 if (pu8VramNext <= pu8Vram && pu8VramNext > pu8VramMax) 1173 { 1174 WARN(("invalid copy size")); 1175 return VERR_INVALID_PARAMETER; 1176 } 1177 1178 int rc; 1179 if (fIn) 1180 { 1181 for (uint32_t i = 0; i < u32Cpages; ++i) 1182 { 1183 const void * pvPage; 1184 rc = PDMDevHlpPhysGCPhys2CCPtrReadOnly(pDevIns, phPage, 0, &pvPage, &Lock); 1185 if (!RT_SUCCESS(rc)) 1186 { 1187 WARN(("PDMDevHlpPhysGCPhys2CCPtrReadOnly failed %d", rc)); 1188 return rc; 1189 } 1190 1191 memcpy(pu8Vram, pvPage, PAGE_SIZE); 1192 1193 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &Lock); 1194 1195 pu8Vram += PAGE_SIZE; 1196 } 1197 } 1198 else 1199 { 1200 for (uint32_t i = 0; i < u32Cpages; ++i) 1201 { 1202 void * pvPage; 1203 rc = PDMDevHlpPhysGCPhys2CCPtr(pDevIns, phPage, 0, &pvPage, &Lock); 1204 if (!RT_SUCCESS(rc)) 1205 { 1206 WARN(("PDMDevHlpPhysGCPhys2CCPtr failed %d", rc)); 1207 return rc; 1208 } 1209 1210 memcpy(pvPage, pu8Vram, PAGE_SIZE); 1211 1212 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &Lock); 1213 1214 pu8Vram += PAGE_SIZE; 1215 } 1216 } 1217 1218 if (ppu8VramNext) 1219 *ppu8VramNext = pu8VramNext; 1220 1221 return VINF_SUCCESS; 1222 } 1223 1224 static int vboxVDMACrCmdVbvaProcessPagingEls(PPDMDEVINS pDevIns, const VBOXCMDVBVA_SYSMEMEL *pMemEl, uint32_t cMemEls, uint8_t *pu8Vram, uint8_t *pu8VramMax, uint8_t **ppu8VramNext, bool fIn) 1225 { 1226 uint8_t *pu8VramNext = pu8Vram; 1227 for (uint32_t i = 0; i < cMemEls; ++i, ++pMemEl) 1228 { 1229 int rc = vboxVDMACrCmdVbvaProcessPagingEl(pDevIns, pMemEl, pu8Vram, pu8VramMax, &pu8VramNext, fIn); 1230 if (!RT_SUCCESS(rc)) 1231 { 1232 WARN(("vboxVDMACrCmdVbvaProcessPagingEl failed %d", rc)); 1233 return rc; 1234 } 1235 } 1236 1237 if (ppu8VramNext) 1238 *ppu8VramNext = pu8VramNext; 1239 1240 return VINF_SUCCESS; 1241 } 1242 1243 static int8_t vboxVDMACrCmdVbvaPagingDataInit(PVGASTATE pVGAState, const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd, 1244 const VBOXCMDVBVA_SYSMEMEL **ppSysMem, uint32_t *pcSysMem, 1245 uint8_t **ppu8Vram, uint8_t **ppu8VramMax, bool *pfIn) 1246 { 1247 if (cbCmd < sizeof (VBOXCMDVBVA_PAGING_TRANSFER)) 1248 { 1249 WARN(("cmd too small")); 1250 return -1; 1251 } 1252 1253 uint32_t cSysMem = cbCmd - RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, aSysMem); 1254 if (cSysMem % sizeof (VBOXCMDVBVA_SYSMEMEL)) 1255 { 1256 WARN(("invalid cmd size")); 1257 return -1; 1258 } 1259 cSysMem /= sizeof (VBOXCMDVBVA_SYSMEMEL); 1260 1261 VBOXCMDVBVA_PAGING_TRANSFER *pTransfer = (VBOXCMDVBVA_PAGING_TRANSFER*)pCmd; 1262 VBOXCMDVBVAOFFSET offVRAM = pTransfer->Alloc.u.offVRAM; 1263 if (offVRAM & PAGE_OFFSET_MASK) 1264 { 1265 WARN(("offVRAM address is not on page boundary\n")); 1266 return -1; 1267 } 1268 const VBOXCMDVBVA_SYSMEMEL *pSysMem = pTransfer->aSysMem; 1269 1270 uint8_t * pu8VramBase = pVGAState->vram_ptrR3; 1271 uint8_t *pu8VramMax = pu8VramBase + pVGAState->vram_size; 1272 if (pTransfer->Alloc.u.offVRAM >= pVGAState->vram_size) 1273 { 1274 WARN(("invalid vram offset")); 1275 return -1; 1276 } 1277 1278 uint8_t *pu8Vram = pu8VramBase + pTransfer->Alloc.u.offVRAM; 1279 bool fIn = (pTransfer->Hdr.u8Flags & VBOXCMDVBVA_OPF_PAGING_TRANSFER_IN); 1280 1281 *ppSysMem = pSysMem; 1282 *pcSysMem = cSysMem; 1283 *ppu8Vram = pu8Vram; 1284 *ppu8VramMax = pu8VramMax; 1285 *pfIn = fIn; 1286 return 0; 1287 } 1288 1289 static int8_t vboxVDMACrCmdVbvaProcessCmdData(struct VBOXVDMAHOST *pVdma, const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd) 1290 { 1291 switch (pCmd->u8OpCode) 1292 { 1293 case VBOXCMDVBVA_OPTYPE_NOPCMD: 1294 return 0; 1295 case VBOXCMDVBVA_OPTYPE_PAGING_TRANSFER: 1296 { 1297 PVGASTATE pVGAState = pVdma->pVGAState; 1298 const VBOXCMDVBVA_SYSMEMEL *pSysMem; 1299 uint32_t cSysMem; 1300 uint8_t *pu8Vram; 1301 uint8_t *pu8VramMax; 1302 bool fIn; 1303 int8_t i8Result = vboxVDMACrCmdVbvaPagingDataInit(pVGAState, pCmd, cbCmd, 1304 &pSysMem, &cSysMem, 1305 &pu8Vram, &pu8VramMax, &fIn); 1306 if (i8Result < 0) 1307 { 1308 WARN(("vboxVDMACrCmdVbvaPagingDataInit failed %d", i8Result)); 1309 return i8Result; 1310 } 1311 1312 PPDMDEVINS pDevIns = pVGAState->pDevInsR3; 1313 int rc = vboxVDMACrCmdVbvaProcessPagingEls(pDevIns, pSysMem, cSysMem, pu8Vram, pu8VramMax, &pu8Vram, fIn); 1314 if (!RT_SUCCESS(rc)) 1315 { 1316 WARN(("vboxVDMACrCmdVbvaProcessPagingEls failed %d", rc)); 1317 return -1; 1318 } 1319 1320 return 0; 1321 } 1322 case VBOXCMDVBVA_OPTYPE_PAGING_FILL: 1323 WARN(("VBOXCMDVBVA_OPTYPE_PAGING_FILL not implemented")); 1324 return -1; 1325 default: 1326 return pVdma->CrSrvInfo.pfnCmd(pVdma->CrSrvInfo.hSvr, pCmd, cbCmd); 1327 } 1328 } 1329 1330 #if 0 1331 typedef struct VBOXCMDVBVA_PAGING_TRANSFER 1332 { 1333 VBOXCMDVBVA_HDR Hdr; 1334 /* for now can only contain offVRAM. 1335 * paging transfer can NOT be initiated for allocations having host 3D object (hostID) associated */ 1336 VBOXCMDVBVA_ALLOCINFO Alloc; 1337 uint32_t u32Reserved; 1338 VBOXCMDVBVA_SYSMEMEL aSysMem[1]; 1339 } VBOXCMDVBVA_PAGING_TRANSFER; 1340 #endif 1341 1342 AssertCompile(sizeof (VBOXCMDVBVA_HDR) == 8); 1343 AssertCompile(sizeof (VBOXCMDVBVA_ALLOCINFO) == 4); 1344 AssertCompile(sizeof (VBOXCMDVBVA_SYSMEMEL) == 8); 1345 AssertCompile(!(PAGE_SIZE % sizeof (VBOXCMDVBVA_SYSMEMEL))); 1346 AssertCompile(!(sizeof (VBOXCMDVBVA_PAGING_TRANSFER) % 8)); 1347 1348 #define VBOXCMDVBVA_NUM_SYSMEMEL_PER_PAGE (PAGE_SIZE / sizeof (VBOXCMDVBVA_SYSMEMEL)) 1349 1350 static int8_t vboxVDMACrCmdVbvaProcess(struct VBOXVDMAHOST *pVdma, const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd) 1351 { 1352 switch (pCmd->u8OpCode) 1353 { 1354 case VBOXCMDVBVA_OPTYPE_SYSMEMCMD: 1355 { 1356 VBOXCMDVBVA_SYSMEMCMD *pSysmemCmd = (VBOXCMDVBVA_SYSMEMCMD*)pCmd; 1357 const VBOXCMDVBVA_HDR *pRealCmd; 1358 uint32_t cbRealCmd = pCmd->u8Flags; 1359 cbRealCmd |= (pCmd->u.u8PrimaryID << 8); 1360 if (cbRealCmd < sizeof (VBOXCMDVBVA_HDR)) 1361 { 1362 WARN(("invalid sysmem cmd size")); 1363 return -1; 1364 } 1365 1366 RTGCPHYS phPage = pSysmemCmd->phSysMem; 1367 if (phPage & PAGE_OFFSET_MASK) 1368 { 1369 WARN(("cmd address is not on page boundary\n")); 1370 return -1; 1371 } 1372 1373 PGMPAGEMAPLOCK Lock; 1374 PVGASTATE pVGAState = pVdma->pVGAState; 1375 PPDMDEVINS pDevIns = pVGAState->pDevInsR3; 1376 const void * pvCmd; 1377 int rc = PDMDevHlpPhysGCPhys2CCPtrReadOnly(pDevIns, phPage, 0, &pvCmd, &Lock); 1378 if (!RT_SUCCESS(rc)) 1379 { 1380 WARN(("PDMDevHlpPhysGCPhys2CCPtrReadOnly failed %d\n", rc)); 1381 return -1; 1382 } 1383 1384 pRealCmd = (const VBOXCMDVBVA_HDR *)pvCmd; 1385 1386 if (cbRealCmd <= PAGE_SIZE) 1387 { 1388 uint8_t i8Result = vboxVDMACrCmdVbvaProcessCmdData(pVdma, pRealCmd, cbRealCmd); 1389 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &Lock); 1390 return i8Result; 1391 } 1392 1393 int8_t i8Result = 0; 1394 1395 switch (pRealCmd->u8OpCode) 1396 { 1397 case VBOXCMDVBVA_OPTYPE_PAGING_TRANSFER: 1398 { 1399 const VBOXCMDVBVA_SYSMEMEL *pSysMem; 1400 uint32_t cSysMem; 1401 uint8_t *pu8Vram; 1402 uint8_t *pu8VramMax; 1403 bool fIn; 1404 i8Result = vboxVDMACrCmdVbvaPagingDataInit(pVGAState, pCmd, cbCmd, 1405 &pSysMem, &cSysMem, 1406 &pu8Vram, &pu8VramMax, &fIn); 1407 if (i8Result < 0) 1408 { 1409 WARN(("vboxVDMACrCmdVbvaPagingDataInit failed %d", i8Result)); 1410 return i8Result; 1411 } 1412 1413 uint32_t cCurSysMem = PAGE_SIZE - RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, aSysMem); 1414 cCurSysMem /= sizeof (VBOXCMDVBVA_SYSMEMEL); 1415 Assert(cCurSysMem < cSysMem); 1416 1417 do 1418 { 1419 rc = vboxVDMACrCmdVbvaProcessPagingEls(pDevIns, pSysMem, cCurSysMem, pu8Vram, pu8VramMax, &pu8Vram, fIn); 1420 if (!RT_SUCCESS(rc)) 1421 { 1422 WARN(("vboxVDMACrCmdVbvaProcessPagingEls failed %d", rc)); 1423 i8Result = -1; 1424 break; 1425 } 1426 1427 Assert(cSysMem >= cCurSysMem); 1428 cSysMem -= cCurSysMem; 1429 1430 if (!cSysMem) 1431 break; 1432 1433 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &Lock); 1434 1435 phPage += PAGE_SIZE; 1436 1437 rc = PDMDevHlpPhysGCPhys2CCPtrReadOnly(pDevIns, phPage, 0, &pvCmd, &Lock); 1438 if (!RT_SUCCESS(rc)) 1439 { 1440 WARN(("PDMDevHlpPhysGCPhys2CCPtrReadOnly failed %d\n", rc)); 1441 return -1; 1442 } 1443 1444 if (cSysMem > VBOXCMDVBVA_NUM_SYSMEMEL_PER_PAGE) 1445 cCurSysMem = VBOXCMDVBVA_NUM_SYSMEMEL_PER_PAGE; 1446 else 1447 cCurSysMem = cSysMem; 1448 } while (1); 1449 break; 1450 } 1451 default: 1452 WARN(("command can not be splitted")); 1453 i8Result = -1; 1454 break; 1455 } 1456 1457 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &Lock); 1458 return i8Result; 1459 } 1460 default: 1461 return vboxVDMACrCmdVbvaProcessCmdData(pVdma, pCmd, cbCmd); 1462 } 1463 } 1464 1465 static void vboxVDMACrCmdProcess(struct VBOXVDMAHOST *pVdma, uint8_t* pu8Cmd, uint32_t cbCmd) 1165 1466 { 1166 1467 if (*pu8Cmd == VBOXCMDVBVA_OPTYPE_NOP) 1167 return VINF_EOF; 1468 return; 1469 1470 if (cbCmd < sizeof (VBOXCMDVBVA_HDR)) 1471 { 1472 WARN(("invalid command size")); 1473 return; 1474 } 1168 1475 1169 1476 PVBOXCMDVBVA_HDR pCmd = (PVBOXCMDVBVA_HDR)pu8Cmd; … … 1173 1480 { 1174 1481 Assert(pCmd->u8State == VBOXCMDVBVA_STATE_CANCELLED); 1175 return VINF_EOF; 1176 } 1177 1178 /* come commands can be handled right away? */ 1179 switch (pCmd->u8OpCode) 1180 { 1181 case VBOXCMDVBVA_OPTYPE_NOPCMD: 1182 pCmd->u.i8Result = 0; 1183 return VINF_EOF; 1184 default: 1185 return VINF_SUCCESS; 1186 } 1187 } 1188 1189 static DECLCALLBACK(int) vboxVDMACrCmdEnable(HVBOXCRCMDSVR hSvr, VBOXCRCMD_SVRENABLE_INFO *pInfo) 1190 { 1191 return VINF_SUCCESS; 1192 } 1193 1194 static DECLCALLBACK(void) vboxVDMACrCmdDisable(HVBOXCRCMDSVR hSvr) 1195 { 1196 } 1197 1198 static DECLCALLBACK(int) vboxVDMACrCmdCtl(HVBOXCRCMDSVR hSvr, uint8_t* pCmd, uint32_t cbCmd) 1199 { 1200 return VERR_NOT_SUPPORTED; 1201 } 1202 1203 static DECLCALLBACK(int) vboxVDMACrCmdCmd(HVBOXCRCMDSVR hSvr, PVBOXCMDVBVA_HDR pCmd, uint32_t cbCmd) 1204 { 1205 switch (pCmd->u8OpCode) 1206 { 1207 #if 0 1208 case VBOXCMDVBVA_OPTYPE_BLT_OFFPRIMSZFMT_OR_ID: 1209 { 1210 crVBoxServerCrCmdBltProcess(pCmd, cbCmd); 1211 break; 1212 } 1213 #endif 1214 default: 1215 WARN(("unsupported command\n")); 1216 pCmd->u.i8Result = -1; 1217 } 1218 return VINF_SUCCESS; 1482 return; 1483 } 1484 1485 pCmd->u.i8Result = vboxVDMACrCmdVbvaProcess(pVdma, pCmd, cbCmd); 1219 1486 } 1220 1487 -
trunk/src/VBox/GuestHost/OpenGL/include/cr_protocol.h
r50041 r50831 103 103 struct VBOXVDMACMD_CHROMIUM_CMD *pHgsmiCmd; 104 104 struct VBOXCMDVBVA_CRCMD_CMD *pVbvaCmd; 105 void *pvCmd;105 const void *pvCmd; 106 106 }; 107 107 int *pCmdRc; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r50812 r50831 464 464 void CrFbTexDataInit(CR_TEXDATA* pFbTex, const VBOXVR_TEXTURE *pTex, PFNCRTEXDATA_RELEASED pfnTextureReleased); 465 465 466 int 32_t crVBoxServerCrCmdBltProcess(PVBOXCMDVBVA_HDRpCmd, uint32_t cbCmd);466 int8_t crVBoxServerCrCmdBltProcess(const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd); 467 467 468 468 //#define VBOX_WITH_CRSERVER_DUMPER -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r50827 r50831 60 60 int tearingdown = 0; /* can't be static */ 61 61 62 static DECLCALLBACK(int ) crVBoxCrCmdCmd(HVBOXCRCMDSVR hSvr, PVBOXCMDVBVA_HDRpCmd, uint32_t cbCmd);62 static DECLCALLBACK(int8_t) crVBoxCrCmdCmd(HVBOXCRCMDSVR hSvr, const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd); 63 63 64 64 DECLINLINE(CRClient*) crVBoxServerClientById(uint32_t u32ClientID) … … 2989 2989 #ifdef VBOX_WITH_CRHGSMI 2990 2990 2991 static int32_t crVBoxServerCmdVbvaCrCmdProcess( struct VBOXCMDVBVA_CRCMD_CMD *pCmd, uint32_t cbCmd)2991 static int32_t crVBoxServerCmdVbvaCrCmdProcess(const struct VBOXCMDVBVA_CRCMD_CMD *pCmd, uint32_t cbCmd) 2992 2992 { 2993 2993 int32_t rc; … … 3047 3047 { 3048 3048 CRVBOXHGSMIWRITE* pFnCmd = (CRVBOXHGSMIWRITE*)pHdr; 3049 VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1];3049 const VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1]; 3050 3050 /* Fetch parameters. */ 3051 3051 uint32_t cbBuffer = pBuf->cbBuffer; … … 3103 3103 /* Fetch parameters. */ 3104 3104 uint32_t u32InjectClientID = pFnCmd->u32ClientID; 3105 VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1];3105 const VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1]; 3106 3106 uint32_t cbBuffer = pBuf->cbBuffer; 3107 3107 uint8_t *pBuffer = VBOXCRHGSMI_PTR_SAFE(pBuf->offBuffer, cbBuffer, uint8_t); … … 3153 3153 { 3154 3154 CRVBOXHGSMIREAD *pFnCmd = (CRVBOXHGSMIREAD*)pHdr; 3155 VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1];3155 const VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1]; 3156 3156 /* Fetch parameters. */ 3157 3157 uint32_t cbBuffer = pBuf->cbBuffer; … … 3207 3207 { 3208 3208 CRVBOXHGSMIWRITEREAD *pFnCmd = (CRVBOXHGSMIWRITEREAD*)pHdr; 3209 VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1];3210 VBOXCMDVBVA_CRCMD_BUFFER *pWbBuf = &pCmd->aBuffers[2];3209 const VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1]; 3210 const VBOXCMDVBVA_CRCMD_BUFFER *pWbBuf = &pCmd->aBuffers[2]; 3211 3211 3212 3212 /* Fetch parameters. */ … … 3452 3452 3453 3453 3454 static DECLCALLBACK(int ) crVBoxCrCmdCmd(HVBOXCRCMDSVR hSvr, PVBOXCMDVBVA_HDRpCmd, uint32_t cbCmd)3454 static DECLCALLBACK(int8_t) crVBoxCrCmdCmd(HVBOXCRCMDSVR hSvr, const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd) 3455 3455 { 3456 3456 AssertFailed(); … … 3459 3459 case VBOXCMDVBVA_OPTYPE_CRCMD: 3460 3460 { 3461 VBOXCMDVBVA_CRCMD *pCrCmdDr;3462 VBOXCMDVBVA_CRCMD_CMD *pCrCmd;3461 const VBOXCMDVBVA_CRCMD *pCrCmdDr; 3462 const VBOXCMDVBVA_CRCMD_CMD *pCrCmd; 3463 3463 int rc; 3464 pCrCmdDr = ( VBOXCMDVBVA_CRCMD*)pCmd;3464 pCrCmdDr = (const VBOXCMDVBVA_CRCMD*)pCmd; 3465 3465 pCrCmd = &pCrCmdDr->Cmd; 3466 3466 if (cbCmd < sizeof (VBOXCMDVBVA_CRCMD)) 3467 3467 { 3468 3468 WARN(("invalid buffer size")); 3469 pCmd->u.i8Result = -1; 3470 break; 3469 return -1; 3471 3470 } 3472 3471 rc = crVBoxServerCmdVbvaCrCmdProcess(pCrCmd, cbCmd - RT_OFFSETOF(VBOXCMDVBVA_CRCMD, Cmd)); 3473 3472 if (RT_SUCCESS(rc)) 3474 3473 { 3475 /* success */3476 pCmd->u.i8Result =0;3474 /* success */ 3475 return 0; 3477 3476 } 3478 else 3479 { 3480 WARN(("crVBoxServerCmdVbvaCrCmdProcess failed, rc %d", rc)); 3481 pCmd->u.i8Result = -1; 3482 } 3483 break; 3477 3478 WARN(("crVBoxServerCmdVbvaCrCmdProcess failed, rc %d", rc)); 3479 return -1; 3484 3480 } 3485 3481 case VBOXCMDVBVA_OPTYPE_BLT_OFFPRIMSZFMT_OR_ID: 3486 3482 { 3487 crVBoxServerCrCmdBltProcess(pCmd, cbCmd); 3488 break; 3483 return crVBoxServerCrCmdBltProcess(pCmd, cbCmd); 3489 3484 } 3490 3485 default: 3491 3486 WARN(("unsupported command")); 3492 pCmd->u.i8Result = -1; 3493 } 3494 return VINF_SUCCESS; 3487 return -1; 3488 } 3489 3490 WARN(("internal error")); 3491 return -1; 3495 3492 } 3496 3493 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r50827 r50831 4629 4629 } 4630 4630 4631 int 32_t crVBoxServerCrCmdBltProcess(PVBOXCMDVBVA_HDRpCmd, uint32_t cbCmd)4631 int8_t crVBoxServerCrCmdBltProcess(const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd) 4632 4632 { 4633 4633 uint8_t u8Flags = pCmd->u8Flags; … … 4640 4640 { 4641 4641 WARN(("request to present on disabled framebuffer, ignore")); 4642 pCmd->u.i8Result = -1; 4643 return VINF_SUCCESS; 4642 return -1; 4644 4643 } 4645 4644 … … 4658 4657 WARN(("RTMemAlloc failed!")); 4659 4658 g_CrPresenter.cbTmpBuf = 0; 4660 pCmd->u.i8Result = -1; 4661 return VINF_SUCCESS; 4659 return -1; 4662 4660 } 4663 4661 } … … 4690 4688 { 4691 4689 WARN(("invalid param")); 4692 pCmd->u.i8Result = -1; 4693 return VINF_SUCCESS; 4690 return -1; 4694 4691 } 4695 4692 … … 4702 4699 { 4703 4700 WARN(("CrFbBltPutContentsNe failed %d", rc)); 4704 return rc;4701 return -1; 4705 4702 } 4706 4703 … … 4766 4763 } 4767 4764 } 4768 return VINF_SUCCESS;4765 return 0; 4769 4766 } 4770 4767 else … … 4772 4769 /* blit from one primary to another primary, wow */ 4773 4770 WARN(("not implemented")); 4774 pCmd->u.i8Result = -1; 4775 return VINF_SUCCESS; 4771 return -1; 4776 4772 } 4777 4773 } … … 4784 4780 uint32_t texId = pBlt->alloc.u.id; 4785 4781 WARN(("not implemented")); 4786 pCmd->u.i8Result = -1; 4787 return VINF_SUCCESS; 4782 return -1; 4788 4783 } 4789 4784 else … … 4796 4791 { 4797 4792 WARN(("invalid param")); 4798 pCmd->u.i8Result = -1; 4799 return VINF_SUCCESS; 4793 return -1; 4800 4794 } 4801 4795 … … 4818 4812 { 4819 4813 WARN(("CrFbBltGetContents failed %d", rc)); 4820 pCmd->u.i8Result = -1; 4821 return VINF_SUCCESS; 4814 return -1; 4822 4815 } 4823 4816 } … … 4827 4820 { 4828 4821 WARN(("not implemented")); 4829 pCmd->u.i8Result = -1; 4830 return VINF_SUCCESS; 4831 } 4832 4833 pCmd->u.i8Result = 0; 4834 return VINF_SUCCESS; 4835 } 4822 return -1; 4823 } 4824 4825 return 0; 4826 }
Note:
See TracChangeset
for help on using the changeset viewer.