- Timestamp:
- Jul 15, 2011 3:14:35 PM (13 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/context.c
r34295 r37986 497 497 498 498 void 499 stubGetWindowGeometry( 500 499 stubGetWindowGeometry(const WindowInfo *window, int *x, int *y, 500 unsigned int *w, unsigned int *h ) 501 501 { 502 502 RECT rect; … … 1133 1133 return; 1134 1134 } 1135 1136 crHashtableLock(stub.contextTable); 1137 1135 1138 context = (ContextInfo *) crHashtableSearch(stub.contextTable, contextId); 1136 1139 … … 1167 1170 crMemZero(context, sizeof(ContextInfo)); /* just to be safe */ 1168 1171 crHashtableDelete(stub.contextTable, contextId, crFree); 1169 } 1170 1172 1173 crHashtableUnlock(stub.contextTable); 1174 } 1171 1175 1172 1176 void -
trunk/src/VBox/Additions/common/crOpenGL/glx.c
r37030 r37986 682 682 } 683 683 684 if (ctx && drawable) { 684 if (ctx && drawable) 685 { 686 crHashtableLock(stub.windowTable); 687 crHashtableLock(stub.contextTable); 688 685 689 context = (ContextInfo *) crHashtableSearch(stub.contextTable, (unsigned long) ctx); 686 690 window = stubGetWindowInfo(dpy, drawable); … … 692 696 } 693 697 } 694 else { 698 else 699 { 695 700 dpy = NULL; 696 701 window = NULL; … … 702 707 703 708 retVal = stubMakeCurrent(window, context); 709 710 if (ctx && drawable) 711 { 712 crHashtableUnlock(stub.contextTable); 713 crHashtableUnlock(stub.windowTable); 714 } 715 704 716 return retVal; 705 717 } -
trunk/src/VBox/Additions/common/crOpenGL/icd_drv.c
r37216 r37986 95 95 ContextInfo *context; 96 96 WindowInfo *window; 97 BOOL ret; 97 98 98 99 /*crDebug( "DrvSetContext called(0x%x, 0x%x)", hdc, hglrc );*/ 99 100 (void) (callback); 100 101 102 crHashtableLock(stub.windowTable); 103 crHashtableLock(stub.contextTable); 104 101 105 context = (ContextInfo *) crHashtableSearch(stub.contextTable, (unsigned long) hglrc); 102 106 window = stubGetWindowInfo(hdc); 103 107 104 if (stubMakeCurrent( window, context )) {105 return &icdTable; 106 }107 else {108 return NULL; 109 }108 ret = stubMakeCurrent(window, context); 109 110 crHashtableUnlock(stub.contextTable); 111 crHashtableUnlock(stub.windowTable); 112 113 return ret ? &icdTable:NULL; 110 114 } 111 115 -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c
r37760 r37986 104 104 } 105 105 106 #define PACK_FORCED_SYNC 107 106 108 void PACKSPU_APIENTRY packspu_Flush( void ) 107 109 { 108 110 GET_THREAD(thread); 109 111 int writeback = 1; 112 int found=0; 110 113 111 114 if (!thread->bInjectThread) … … 126 129 crLockMutex(&_PackMutex); 127 130 128 /*Make sure we process commands in order they should appear, so flush thread being injectedfirst*/131 /*Make sure we process commands in order they should appear, so flush other threads first*/ 129 132 for (i=0; i<MAX_THREADS; ++i) 130 133 { 131 134 if (pack_spu.thread[i].inUse 132 135 && (thread != &pack_spu.thread[i]) && pack_spu.thread[i].netServer.conn 133 && (pack_spu.thread[i].netServer.conn->u32ClientID == thread->netServer.conn->u32InjectClientID)134 136 && pack_spu.thread[i].packer && pack_spu.thread[i].packer->currentBuffer) 135 137 { 138 #ifdef PACK_FORCED_SYNC 139 CRPackContext *pc = pack_spu.thread[i].packer; 140 unsigned char *data_ptr; 141 142 CR_GET_BUFFERED_POINTER( pc, 16 ); 143 WRITE_DATA( 0, GLint, 16 ); 144 WRITE_DATA( 4, GLenum, CR_WRITEBACK_EXTEND_OPCODE ); 145 WRITE_NETWORK_POINTER( 8, (void *) &writeback ); 146 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 147 CR_UNLOCK_PACKER_CONTEXT(pc); 148 #endif 136 149 packspuFlush((void *) &pack_spu.thread[i]); 137 break; 150 151 if (pack_spu.thread[i].netServer.conn->u32ClientID == thread->netServer.conn->u32InjectClientID) 152 { 153 found=1; 154 } 155 156 #ifdef PACK_FORCED_SYNC 157 while (writeback) 158 crNetRecv(); 159 #endif 138 160 } 139 161 } 140 162 141 if ( i>=MAX_THREADS)163 if (!found) 142 164 { 143 165 /*Thread we're supposed to inject commands for has been detached, … … 147 169 } 148 170 171 #ifdef PACK_FORCED_SYNC 172 writeback = 1; 173 crPackWriteback(&writeback); 174 #endif 175 packspuFlush((void *) thread); 176 177 #ifdef PACK_FORCED_SYNC 178 while (writeback) 179 crNetRecv(); 180 #endif 149 181 crUnlockMutex(&_PackMutex); 150 151 packspuFlush((void *) thread);152 182 } 153 183 } -
trunk/src/VBox/Additions/common/crOpenGL/stub.c
r34295 r37986 127 127 if (winInfo && winInfo->type == CHROMIUM && stub.spu) 128 128 { 129 crHashtableLock(stub.windowTable); 130 129 131 stub.spu->dispatch_table.WindowDestroy( winInfo->spuWindow ); 130 #ifdef CR_NEWWINTRACK 131 crLockMutex(&stub.mutex); 132 #endif 132 133 133 #ifdef WINDOWS 134 134 if (winInfo->hVisibleRegion != INVALID_HANDLE_VALUE) … … 147 147 } 148 148 # endif 149 #endif150 #ifdef CR_NEWWINTRACK151 crUnlockMutex(&stub.mutex);152 149 #endif 153 150 crForcedFlush(); 154 151 crHashtableDelete(stub.windowTable, window, crFree); 152 153 crHashtableUnlock(stub.windowTable); 155 154 } 156 155 } -
trunk/src/VBox/GuestHost/OpenGL/include/cr_hash.h
r15532 r37986 36 36 /*Returns GL_TRUE if given hashtable hold the data, pKey is updated with key value for data in this case*/ 37 37 DECLEXPORT(GLboolean) crHashtableGetDataKey(CRHashTable *pHash, void *pData, unsigned long *pKey); 38 DECLEXPORT(void) crHashtableLock(CRHashTable *h); 39 DECLEXPORT(void) crHashtableUnlock(CRHashTable *h); 38 40 39 41 #ifdef __cplusplus -
trunk/src/VBox/GuestHost/OpenGL/util/hash.c
r31808 r37986 353 353 } 354 354 355 void crHashtableLock(CRHashTable *h) 356 { 357 #ifdef CHROMIUM_THREADSAFE 358 crLockMutex(&h->mutex); 359 #endif 360 } 361 362 void crHashtableUnlock(CRHashTable *h) 363 { 364 #ifdef CHROMIUM_THREADSAFE 365 crUnlockMutex(&h->mutex); 366 #endif 367 } 355 368 356 369 void crHashtableWalk( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *dataPtr2)
Note:
See TracChangeset
for help on using the changeset viewer.