VirtualBox

Changeset 44887 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 1, 2013 3:20:32 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84055
Message:

crOpenGL: more window attr handling fixes

Location:
trunk/src/VBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_hash.h

    r44860 r44887  
    4848DECLEXPORT(GLboolean) crHashtableIsKeyUsed( const CRHashTable *h, GLuint id );
    4949DECLEXPORT(void) crHashtableWalk( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *data);
     50/* walk the hashtable w/o holding the table lock */
     51DECLEXPORT(void) crHashtableWalkUnlocked( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *data);
    5052/*Returns GL_TRUE if given hashtable hold the data, pKey is updated with key value for data in this case*/
    5153DECLEXPORT(GLboolean) crHashtableGetDataKey(CRHashTable *pHash, void *pData, unsigned long *pKey);
  • trunk/src/VBox/GuestHost/OpenGL/util/hash.c

    r44860 r44887  
    421421}
    422422
    423 void crHashtableWalk( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *dataPtr2)
     423void crHashtableWalkUnlocked( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *dataPtr2)
    424424{
    425425    int i;
    426426    CRHashNode *entry, *next;
    427427
    428     if (!hash)
    429         return;
    430 
    431 #ifdef CHROMIUM_THREADSAFE
    432     crLockMutex(&hash->mutex);
    433 #endif
    434428    for (i = 0; i < CR_NUM_BUCKETS; i++)
    435429    {
     
    445439        }
    446440    }
     441}
     442
     443void crHashtableWalk( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *dataPtr2)
     444{
     445    if (!hash)
     446        return;
     447
     448#ifdef CHROMIUM_THREADSAFE
     449    crLockMutex(&hash->mutex);
     450#endif
     451    crHashtableWalkUnlocked(hash, walkFunc , dataPtr2);
    447452#ifdef CHROMIUM_THREADSAFE
    448453    crUnlockMutex(&hash->mutex);
  • trunk/src/VBox/GuestHost/OpenGL/util/util.def

    r44766 r44887  
    8383crHashtableNumElements
    8484crHashtableWalk
     85crHashtableWalkUnlocked
    8586crHashtableAllocRegisterKey
    8687crAllocHashtable
     
    148149crHashtableDeleteBlock
    149150crHashtableIsKeyUsed
    150 crHashtableWalk
    151151crMatrixInit
    152152crMatrixInitFromString
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c

    r44886 r44887  
    421421        showIt = 0;
    422422    else
    423         showIt = window->BltInfo.Base.id != CR_RENDER_DEFAULT_WINDOW_ID;
    424 
     423        showIt = (id != CR_RENDER_DEFAULT_WINDOW_ID);
    425424
    426425    /*
     
    813812        crWarning("RTCritSectEnter failed rc %d", rc);
    814813    }
     814}
     815
     816static void renderspuVBoxCompositorClearAllCB(unsigned long key, void *data1, void *data2)
     817{
     818    WindowInfo *window = (WindowInfo *) data1;
     819    renderspuVBoxCompositorSet(window, NULL);
     820}
     821
     822void renderspuVBoxCompositorClearAll()
     823{
     824    /* we need to clear window compositor, which is not that trivial though,
     825     * since the lock order used in presentation thread is compositor lock() -> hash table lock (aquired for id->window resolution)
     826     * this is why, to prevent potential deadlocks, we use crHashtableWalkUnlocked that does not hold the table lock
     827     * we are can be sure noone will modify the table here since renderspuVBoxCompositorClearAll can be called in the command (hgcm) thread only,
     828     * and the table can be modified from that thread only as well */
     829    crHashtableWalkUnlocked(render_spu.windowTable, renderspuVBoxCompositorClearAllCB, NULL);
    815830}
    816831
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h

    r44860 r44887  
    393393extern int renderspuCreateFunctions( SPUNamedFunctionTable table[] );
    394394extern void renderspuVBoxCompositorSet( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor);
     395extern void renderspuVBoxCompositorClearAll();
    395396extern struct VBOXVR_SCR_COMPOSITOR * renderspuVBoxCompositorAcquire( WindowInfo *window);
    396397extern int renderspuVBoxCompositorTryAcquire(WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR **ppCompositor);
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c

    r44860 r44887  
    431431static int renderSPUCleanup(void)
    432432{
     433    renderspuVBoxCompositorClearAll();
    433434    crFreeHashtable(render_spu.contextTable, DeleteContextCallback);
    434435    render_spu.contextTable = NULL;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette