Changeset 51559 in vbox for trunk/src/VBox
- Timestamp:
- Jun 5, 2014 9:18:41 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94217
- Location:
- trunk/src/VBox
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/context.c
r49214 r51559 110 110 void stubConChromiumParameteriCR(GLint con, GLenum param, GLint value) 111 111 { 112 if (con)112 // if (con) 113 113 stub.spu->dispatch_table.VBoxConChromiumParameteriCR(con, param, value); 114 else 115 crError("VBoxConChromiumParameteriCR called with null connection"); 114 // else 115 // crError("VBoxConChromiumParameteriCR called with null connection"); 116 } 117 118 void stubConChromiumParametervCR(GLint con, GLenum target, GLenum type, GLsizei count, const GLvoid *values) 119 { 120 // if (con) 121 stub.spu->dispatch_table.VBoxConChromiumParametervCR(con, target, type, count, values); 122 // else 123 // crError("VBoxConChromiumParameteriCR called with null connection"); 116 124 } 117 125 -
trunk/src/VBox/Additions/common/crOpenGL/icd_drv.c
r44528 r51559 308 308 } 309 309 310 DECLEXPORT(BOOL) WINAPI wglShareLists_prox( HGLRC hglrc1, HGLRC hglrc2 ); 311 310 312 BOOL APIENTRY DrvShareLists(HGLRC hglrc1, HGLRC hglrc2) 311 313 { 312 CR_DDI_PROLOGUE(); 313 crWarning( "DrvShareLists: unsupported" ); 314 return 1; 314 return wglShareLists_prox(hglrc1, hglrc2); 315 315 } 316 316 -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu.h
r51313 r51559 158 158 extern ThreadInfo *packspuNewCtxThread( struct VBOXUHGSMI *pHgsmi ); 159 159 160 161 162 #define MAGIC_OFFSET 3000 163 160 164 #endif /* CR_PACKSPU_H */ -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c
r51319 r51559 10 10 #include "cr_string.h" 11 11 #include "packspu_proto.h" 12 13 #define MAGIC_OFFSET 300014 12 15 13 /* … … 231 229 232 230 packspu_ChromiumParameteriCR(param, value); 231 232 #ifdef CHROMIUM_THREADSAFE 233 crUnlockMutex(&_PackMutex); 234 #endif 235 236 if (CRPACKSPU_IS_WDDM_CRHGSMI()) 237 { 238 /* restore the packer context to the tls */ 239 crPackSetContext(curPacker); 240 } 241 } 242 243 GLvoid PACKSPU_APIENTRY 244 packspu_VBoxConChromiumParametervCR(GLint con, GLenum target, GLenum type, GLsizei count, const GLvoid *values) 245 { 246 GET_THREAD(thread); 247 CRPackContext * curPacker = crPackGetContext(); 248 ThreadInfo *curThread = thread; 249 int writeback = 1; 250 GLint serverCtx = (GLint) -1; 251 252 CRASSERT(!curThread == !curPacker); 253 CRASSERT(!curThread || !curPacker || curThread->packer == curPacker); 254 #ifdef CHROMIUM_THREADSAFE 255 crLockMutex(&_PackMutex); 256 #endif 257 258 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) 259 CRASSERT(!con == !CRPACKSPU_IS_WDDM_CRHGSMI()); 260 #endif 261 262 if (CRPACKSPU_IS_WDDM_CRHGSMI()) 263 { 264 if (!con) 265 { 266 crError("connection should be specified!"); 267 return; 268 } 269 thread = GET_THREAD_VAL_ID(con); 270 } 271 else 272 { 273 CRASSERT(!con); 274 if (!thread) 275 { 276 thread = packspuNewThread( 277 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) 278 NULL 279 #endif 280 ); 281 } 282 } 283 CRASSERT(thread); 284 CRASSERT(thread->packer); 285 286 crPackSetContext( thread->packer ); 287 288 packspu_ChromiumParametervCR(target, type, count, values); 233 289 234 290 #ifdef CHROMIUM_THREADSAFE -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c
r51313 r51559 15 15 CRMessage msg; 16 16 int len; 17 17 GLint ai32ServerValues[2]; 18 GLboolean fFlush = GL_FALSE; 18 19 GET_THREAD(thread); 19 20 … … 30 31 len = sizeof(CRMessageGather); 31 32 crNetSend(thread->netServer.conn, NULL, &msg, len); 32 break; 33 33 return; 34 35 case GL_SHARE_LISTS_CR: 36 { 37 ContextInfo *pCtx[2]; 38 GLint *ai32Values; 39 int i; 40 if (count != 2) 41 { 42 WARN(("GL_SHARE_LISTS_CR invalid cound %d", count)); 43 return; 44 } 45 46 if (type != GL_UNSIGNED_INT && type != GL_INT) 47 { 48 WARN(("GL_SHARE_LISTS_CR invalid type %d", type)); 49 return; 50 } 51 52 ai32Values = (GLint*)values; 53 54 for (i = 0; i < 2; ++i) 55 { 56 const int slot = ai32Values[i] - MAGIC_OFFSET; 57 58 if (slot < 0 || slot >= pack_spu.numContexts) 59 { 60 WARN(("GL_SHARE_LISTS_CR invalid value[%d] %d", i, ai32Values[i])); 61 return; 62 } 63 64 pCtx[i] = &pack_spu.context[slot]; 65 if (!pCtx[i]->clientState) 66 { 67 WARN(("GL_SHARE_LISTS_CR invalid pCtx1 for value[%d] %d", i, ai32Values[i])); 68 return; 69 } 70 71 ai32ServerValues[i] = pCtx[i]->serverCtx; 72 } 73 74 crStateShareLists(pCtx[0]->clientState, pCtx[1]->clientState); 75 76 values = ai32ServerValues; 77 78 fFlush = GL_TRUE; 79 80 break; 81 } 82 34 83 default: 35 if (pack_spu.swap) 36 crPackChromiumParametervCRSWAP(target, type, count, values); 37 else 38 crPackChromiumParametervCR(target, type, count, values); 39 } 40 41 84 break; 85 } 86 87 if (pack_spu.swap) 88 crPackChromiumParametervCRSWAP(target, type, count, values); 89 else 90 crPackChromiumParametervCR(target, type, count, values); 91 92 if (fFlush) 93 packspuFlush( (void *) thread ); 42 94 } 43 95 -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_special
r51200 r51559 111 111 VBoxCreateContext 112 112 VBoxConChromiumParameteriCR 113 VBoxConChromiumParametervCR 113 114 VBoxWindowCreate 114 115 VBoxWindowDestroy -
trunk/src/VBox/Additions/common/crOpenGL/stub.h
r49214 r51559 343 343 ); 344 344 extern void stubConChromiumParameteriCR(GLint con, GLenum param, GLint value); 345 extern void stubConChromiumParametervCR(GLint con, GLenum target, GLenum type, GLsizei count, const GLvoid *values); 345 346 extern GLboolean stubCtxCreate(ContextInfo *context); 346 347 extern GLboolean stubCtxCheckCreate(ContextInfo *context); -
trunk/src/VBox/Additions/common/crOpenGL/wgl.c
r48999 r51559 289 289 } 290 290 291 DECLEXPORT(BOOL) WINAPI wglShareLists_prox( HGLRC hglrc1, HGLRC hglrc2 )292 {293 CR_DDI_PROLOGUE();294 crWarning( "wglShareLists: unsupported" );295 return 0;296 }297 298 291 DECLEXPORT(void) WINAPI VBoxCtxChromiumParameteriCR(HGLRC hglrc, GLenum param, GLint value) 299 292 { … … 317 310 crHashtableUnlock(stub.contextTable); 318 311 // crHashtableUnlock(stub.windowTable); 312 } 313 314 DECLEXPORT(BOOL) WINAPI wglShareLists_prox( HGLRC hglrc1, HGLRC hglrc2 ) 315 { 316 ContextInfo *context1, *context2; 317 GLint aSpuContexts[2]; 318 319 CR_DDI_PROLOGUE(); 320 321 // crHashtableLock(stub.windowTable); 322 crHashtableLock(stub.contextTable); 323 324 context1 = (ContextInfo *) crHashtableSearch(stub.contextTable, (unsigned long) hglrc1); 325 326 if (!context1) 327 { 328 WARN(("invalid hglrc1")); 329 return FALSE; 330 } 331 332 stubCtxCheckCreate(context1); 333 334 context2 = (ContextInfo *) crHashtableSearch(stub.contextTable, (unsigned long) hglrc2); 335 336 if (!context2) 337 { 338 WARN(("invalid hglrc2")); 339 return FALSE; 340 } 341 342 stubCtxCheckCreate(context2); 343 344 aSpuContexts[0] = context1->spuContext; 345 aSpuContexts[1] = context2->spuContext; 346 347 stubConChromiumParametervCR(CR_CTX_CON(context2), GL_SHARE_LISTS_CR, GL_INT, 2, aSpuContexts); 348 349 crHashtableUnlock(stub.contextTable); 350 351 return TRUE; 319 352 } 320 353 -
trunk/src/VBox/GuestHost/OpenGL/glapi_parser/APIspec.txt
r51200 r51559 8571 8571 chromium nopack 8572 8572 8573 name VBoxConChromiumParametervCR 8574 return void 8575 param con GLint 8576 param target GLenum 8577 paramprop target GL_CURSOR_POSITION_CR GL_DEFAULT_BBOX_CR GL_SCREEN_BBOX_CR GL_OBJECT_BBOX_CR GL_PRINT_STRING_CR GL_MURAL_SIZE_CR GL_NUM_SERVERS_CR GL_NUM_TILES_CR GL_TILE_BOUNDS_CR GL_VERTEX_COUNTS_CR GL_RESET_VERTEX_COUNTERS_CR GL_SET_MAX_VIEWPORT_CR GL_HEAD_SPU_NAME_CR GL_PERF_GET_FRAME_DATA_CR GL_PERF_GET_TIMER_DATA_CR GL_PERF_DUMP_COUNTERS_CR GL_PERF_SET_TOKEN_CR GL_PERF_SET_DUMP_ON_SWAP_CR GL_PERF_SET_DUMP_ON_FINISH_CR GL_PERF_SET_DUMP_ON_FLUSH_CR GL_PERF_START_TIMER_CR GL_PERF_STOP_TIMER_CR GL_WINDOW_SIZE_CR GL_TILE_INFO_CR GL_GATHER_DRAWPIXELS_CR GL_GATHER_PACK_CR GL_GATHER_CONNECT_CR GL_GATHER_POST_SWAPBUFFERS_CR GL_SAVEFRAME_ENABLED_CR GL_SAVEFRAME_FRAMENUM_CR GL_SAVEFRAME_STRIDE_CR GL_SAVEFRAME_SINGLE_CR GL_SAVEFRAME_FILESPEC_CR GL_READBACK_BARRIER_SIZE_CR 8578 param type GLenum 8579 paramprop type GL_BYTE GL_UNSIGNED_BYTE GL_SHORT GL_UNSIGNED_SHORT GL_INT GL_UNSIGNED_INT GL_FLOAT GL_DOUBLE 8580 param count GLsizei 8581 param values const GLvoid * 8582 category VBox 8583 props nolist 8584 chromium nopack 8585 8586 8573 8587 name VBoxWindowCreate 8574 8588 return GLint -
trunk/src/VBox/GuestHost/OpenGL/include/chromium.h
r51313 r51559 734 734 #define GL_CHECK_ZERO_VERT_ARRT 0x8B30 735 735 736 /* share lists */ 737 #define GL_SHARE_LISTS_CR 0x8B31 738 736 739 /**********************************************************************/ 737 740 /***** Chromium-specific API *****/ -
trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h
r51005 r51559 116 116 CRHashTable *rbTable; /* render buffers */ 117 117 118 GLint refCount;118 volatile int32_t refCount; 119 119 GLint id; /*unique shared state id, it's not always matching some existing context id!*/ 120 120 GLint saveCount; … … 308 308 309 309 DECLEXPORT(void) STATE_APIENTRY crStateShareContext(GLboolean value); 310 DECLEXPORT(void) STATE_APIENTRY crStateShareLists(CRContext *pContext1, CRContext *pContext2); 310 311 DECLEXPORT(void) STATE_APIENTRY crStateSetSharedContext(CRContext *pCtx); 311 312 DECLEXPORT(GLboolean) STATE_APIENTRY crStateContextIsShared(CRContext *pCtx); -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c
r51005 r51559 9 9 #include "cr_error.h" 10 10 #include "cr_spu.h" 11 12 #include <iprt/asm.h> 11 13 12 14 #ifdef CHROMIUM_THREADSAFE … … 110 112 crStateFreeShared(CRContext *pContext, CRSharedState *s) 111 113 { 112 s->refCount--; 113 Assert(s->refCount >= 0); 114 if (s->refCount <= 0) { 114 int32_t refCount = ASMAtomicDecS32(&s->refCount); 115 116 Assert(refCount >= 0); 117 if (refCount <= 0) { 115 118 if (s==gSharedState) 116 119 { … … 144 147 return NULL; 145 148 } 146 gSharedState->refCount++;149 ASMAtomicIncS32(&gSharedState->refCount); 147 150 return gSharedState; 148 151 } … … 176 179 crStateFreeShared(pCtx, pCtx->shared); 177 180 pCtx->shared = gSharedState; 178 gSharedState->refCount++;181 ASMAtomicIncS32(&gSharedState->refCount); 179 182 } 180 183 } … … 199 202 } 200 203 } 204 } 205 206 DECLEXPORT(void) STATE_APIENTRY 207 crStateShareLists(CRContext *pContext1, CRContext *pContext2) 208 { 209 CRASSERT(pContext1->shared); 210 CRASSERT(pContext2->shared); 211 212 if (pContext2->shared == pContext1->shared) 213 { 214 return; 215 } 216 217 crStateFreeShared(pContext1, pContext1->shared); 218 pContext1->shared = pContext2->shared; 219 ASMAtomicIncS32(&pContext2->shared->refCount); 201 220 } 202 221 … … 271 290 CRASSERT(shareCtx->shared); 272 291 ctx->shared = shareCtx->shared; 273 ctx->shared->refCount ++;292 ASMAtomicIncS32(&ctx->shared->refCount); 274 293 } 275 294 else { -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c
r51524 r51559 94 94 95 95 switch (target) { 96 case GL_SHARE_LISTS_CR: 97 { 98 CRContextInfo *pCtx[2]; 99 GLint *ai32Values; 100 int i; 101 if (count != 2) 102 { 103 WARN(("GL_SHARE_LISTS_CR invalid cound %d", count)); 104 return; 105 } 106 107 if (type != GL_UNSIGNED_INT && type != GL_INT) 108 { 109 WARN(("GL_SHARE_LISTS_CR invalid type %d", type)); 110 return; 111 } 112 113 ai32Values = (GLint*)values; 114 115 for (i = 0; i < 2; ++i) 116 { 117 const int32_t val = ai32Values[i]; 118 119 if (val == 0) 120 { 121 WARN(("GL_SHARE_LISTS_CR invalid value[%d] %d", i, val)); 122 return; 123 } 124 125 pCtx[i] = (CRContextInfo *) crHashtableSearch(cr_server.contextTable, val); 126 if (!pCtx[i]) 127 { 128 WARN(("GL_SHARE_LISTS_CR invalid pCtx1 for value[%d] %d", i, val)); 129 return; 130 } 131 132 if (!pCtx[i]->pContext) 133 { 134 WARN(("GL_SHARE_LISTS_CR invalid pCtx1 pContext for value[%d] %d", i, val)); 135 return; 136 } 137 } 138 139 crStateShareLists(pCtx[0]->pContext, pCtx[1]->pContext); 140 141 break; 142 } 143 96 144 case GL_SET_MAX_VIEWPORT_CR: 97 145 {
Note:
See TracChangeset
for help on using the changeset viewer.