Changeset 50984 in vbox for trunk/src/VBox/GuestHost/OpenGL
- Timestamp:
- Apr 7, 2014 10:57:41 AM (11 years ago)
- Location:
- trunk/src/VBox/GuestHost/OpenGL
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_net.h
r50973 r50984 306 306 307 307 #endif 308 #ifdef IN_GUEST 309 extern DECLEXPORT(uint32_t) crNetHostCapsGet(); 310 #endif 308 311 extern DECLEXPORT(void) crNetDefaultRecv( CRConnection *conn, CRMessage *msg, unsigned int len ); 309 312 extern DECLEXPORT(void) crNetDispatchMessage( CRNetReceiveFuncList *rfl, CRConnection *conn, CRMessage *msg, unsigned int len ); -
trunk/src/VBox/GuestHost/OpenGL/include/cr_pack.h
r50973 r50984 137 137 #endif 138 138 ); 139 DECLINLINE(bool) crPackBufferIsEmpty(CRPackBuffer *buffer)140 {141 return (buffer->opcode_current == buffer->data_current -1);142 }143 139 144 140 extern DECLEXPORT(void) crPackFlushFunc( CRPackContext *pc, CRPackFlushFunc ff ); … … 195 191 extern DECLEXPORT(void) crPackExpandMultiDrawElementsEXTSWAP( GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, CRClientState *c ); 196 192 193 extern DECLEXPORT(void) crPackCmdBlocksEnable(); 194 197 195 198 196 /** … … 206 204 } 207 205 206 DECLINLINE(bool) crPackBufferIsEmpty(CRPackBuffer *buffer) 207 { 208 return crPackNumOpcodes(buffer) == 0; 209 } 208 210 209 211 /** -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_init.c
r50973 r50984 69 69 } 70 70 71 void crPackCmdBlocksEnable() 72 { 73 cr_packer_cmd_blocks_enabled = 1; 74 } -
trunk/src/VBox/GuestHost/OpenGL/util/net.c
r50452 r50984 1276 1276 } 1277 1277 1278 #ifdef IN_GUEST 1279 uint32_t crNetHostCapsGet() 1280 { 1281 #ifdef VBOX_WITH_HGCM 1282 if ( cr_net.use_hgcm ) 1283 return crVBoxHGCMHostCapsGet(); 1284 #endif 1285 WARN(("HostCaps supportted for HGCM only!")); 1286 return 0; 1287 } 1288 #endif 1289 1278 1290 /** 1279 1291 * The big boy -- call this function to see (non-blocking) if there is -
trunk/src/VBox/GuestHost/OpenGL/util/net_internals.h
r42499 r50984 102 102 #endif 103 103 ); 104 #ifdef IN_GUEST 105 extern uint32_t crVBoxHGCMHostCapsGet(); 106 #endif 104 107 extern CRConnection** crVBoxHGCMDump( int *num ); 105 108 extern void crVBoxHGCMTearDown(void); -
trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
r50973 r50984 185 185 int iGuestDrv; 186 186 #endif 187 #ifdef IN_GUEST 188 uint32_t u32HostCaps; 189 bool fHostCapsInitialized; 190 #endif 187 191 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) 188 192 bool bHgsmiOn; … … 1263 1267 rc = crVBoxHGCMCall(conn, &parms, sizeof(parms)); 1264 1268 1265 if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.result)) 1266 { 1267 crWarning("Host doesn't accept our version %d.%d. Make sure you have appropriate additions installed!", 1268 parms.vMajor.u.value32, parms.vMinor.u.value32); 1269 if (RT_SUCCESS(rc)) 1270 { 1271 rc = parms.hdr.result; 1272 if (RT_SUCCESS(rc)) 1273 { 1274 conn->vMajor = CR_PROTOCOL_VERSION_MAJOR; 1275 conn->vMinor = CR_PROTOCOL_VERSION_MINOR; 1276 1277 return VINF_SUCCESS; 1278 } 1279 else 1280 WARN(("Host doesn't accept our version %d.%d. Make sure you have appropriate additions installed!", 1281 parms.vMajor.u.value32, parms.vMinor.u.value32)); 1282 } 1283 else 1284 WARN(("crVBoxHGCMCall failed %d", rc)); 1285 1286 return rc; 1287 } 1288 1289 static int crVBoxHGCMGetHostCaps(CRConnection *conn, uint32_t *pu32HostCaps) 1290 { 1291 CRVBOXHGCMGETCAPS caps; 1292 int rc; 1293 1294 caps.hdr.result = VERR_WRONG_ORDER; 1295 caps.hdr.u32ClientID = conn->u32ClientID; 1296 caps.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS; 1297 caps.hdr.cParms = SHCRGL_CPARMS_GET_CAPS; 1298 1299 caps.Caps.type = VMMDevHGCMParmType_32bit; 1300 caps.Caps.u.value32 = 0; 1301 1302 rc = crVBoxHGCMCall(conn, &caps, sizeof(caps)); 1303 1304 if (RT_SUCCESS(rc)) 1305 { 1306 rc = caps.hdr.result; 1307 if (RT_SUCCESS(rc)) 1308 { 1309 *pu32HostCaps = caps.Caps.u.value32; 1310 return VINF_SUCCESS; 1311 } 1312 else 1313 WARN(("SHCRGL_GUEST_FN_GET_CAPS failed %d", rc)); 1269 1314 return FALSE; 1270 1315 } 1271 1272 conn->vMajor = CR_PROTOCOL_VERSION_MAJOR; 1273 conn->vMinor = CR_PROTOCOL_VERSION_MINOR; 1274 1275 return TRUE; 1276 } 1316 else 1317 WARN(("crVBoxHGCMCall failed %d", rc)); 1318 1319 *pu32HostCaps = 0; 1320 1321 return rc; 1322 } 1323 1277 1324 1278 1325 static int crVBoxHGCMSetPID(CRConnection *conn, unsigned long long pid) … … 1380 1427 1381 1428 rc = crVBoxHGCMSetVersion(conn, CR_PROTOCOL_VERSION_MAJOR, CR_PROTOCOL_VERSION_MINOR); 1382 if ( !rc)1429 if (RT_FAILURE(rc)) 1383 1430 { 1431 WARN(("crVBoxHGCMSetVersion failed %d", rc)); 1384 1432 return rc; 1385 1433 } … … 1389 1437 rc = crVBoxHGCMSetPID(conn, crGetPID()); 1390 1438 #endif 1439 if (RT_FAILURE(rc)) 1440 { 1441 WARN(("crVBoxHGCMSetPID failed %d", rc)); 1442 return rc; 1443 } 1444 1445 if (!g_crvboxhgcm.fHostCapsInitialized) 1446 { 1447 rc = crVBoxHGCMGetHostCaps(conn, &g_crvboxhgcm.u32HostCaps); 1448 if (RT_FAILURE(rc)) 1449 { 1450 WARN(("VBoxCrHgsmiCtlConGetHostCaps failed %d", rc)); 1451 g_crvboxhgcm.u32HostCaps = 0; 1452 } 1453 1454 /* host may not support it, ignore any failures */ 1455 g_crvboxhgcm.fHostCapsInitialized = true; 1456 rc = VINF_SUCCESS; 1457 } 1458 1391 1459 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 1392 1460 return rc; … … 2196 2264 pClient = _crVBoxHGSMIClientGet(conn); 2197 2265 if (pClient) 2266 { 2198 2267 rc = VBoxCrHgsmiCtlConGetClientID(pClient->pHgsmi, &conn->u32ClientID); 2268 if (RT_FAILURE(rc)) 2269 { 2270 WARN(("VBoxCrHgsmiCtlConGetClientID failed %d", rc)); 2271 } 2272 if (!g_crvboxhgcm.fHostCapsInitialized) 2273 { 2274 rc = VBoxCrHgsmiCtlConGetHostCaps(pClient->pHgsmi, &g_crvboxhgcm.u32HostCaps); 2275 if (RT_SUCCESS(rc)) 2276 { 2277 g_crvboxhgcm.fHostCapsInitialized = true; 2278 } 2279 else 2280 { 2281 WARN(("VBoxCrHgsmiCtlConGetHostCaps failed %d", rc)); 2282 g_crvboxhgcm.u32HostCaps = 0; 2283 } 2284 } 2285 } 2199 2286 else 2287 { 2288 WARN(("_crVBoxHGSMIClientGet failed %d", rc)); 2200 2289 rc = VERR_GENERAL_FAILURE; 2290 } 2201 2291 2202 2292 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); … … 2305 2395 #endif 2306 2396 g_crvboxhgcm.bufpool = crBufferPoolInit(16); 2397 2398 #ifdef IN_GUEST 2399 g_crvboxhgcm.fHostCapsInitialized = false; 2400 g_crvboxhgcm.u32HostCaps = 0; 2401 #endif 2307 2402 } 2308 2403 … … 2504 2599 } 2505 2600 2601 #ifdef IN_GUEST 2602 uint32_t crVBoxHGCMHostCapsGet() 2603 { 2604 Assert(g_crvboxhgcm.fHostCapsInitialized); 2605 return g_crvboxhgcm.u32HostCaps; 2606 } 2607 #endif 2608 2506 2609 int crVBoxHGCMRecv( 2507 2610 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
Note:
See TracChangeset
for help on using the changeset viewer.