VirtualBox

Changeset 43487 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 1, 2012 11:53:15 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
81047
Message:

crOpenGL/wddm: basics for miniport-based visible rects processing (guest part); export flushToHost command

Location:
trunk/src/VBox
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/context.c

    r42520 r43487  
    108108}
    109109
     110void stubConFlush(GLint con)
     111{
     112    if (con)
     113        stub.spu->dispatch_table.VBoxConFlush(con);
     114    else
     115        crError("stubConFlush called with null connection");
     116}
     117
    110118static void stubWindowCleanupForContextsCB(unsigned long key, void *data1, void *data2)
    111119{
     
    190198    if (stub.bRunningUnderWDDM)
    191199    {
    192         crError("Should not be here: WindowCreate/Destroy & VBoxPackGetInjectID recuire connection id!");
     200        crError("Should not be here: WindowCreate/Destroy & VBoxPackGetInjectID require connection id!");
    193201        winInfo->mapped = 0;
    194202    }
  • trunk/src/VBox/Additions/common/crOpenGL/defs.py

    r42499 r43487  
    496496crSwapBuffers
    497497crGetProcAddress
    498 VBoxCreateContext"""
     498VBoxCreateContext
     499VBoxGetWindowId
     500VBoxFlushToHost"""
    499501#print "DllMain"
  • trunk/src/VBox/Additions/common/crOpenGL/defs64.py

    r42499 r43487  
    477477crSwapBuffers
    478478crGetProcAddress
    479 VBoxCreateContext"""
     479VBoxCreateContext
     480VBoxGetWindowId
     481VBoxFlushToHost"""
    480482#print "DllMain"
  • trunk/src/VBox/Additions/common/crOpenGL/load.c

    r42536 r43487  
    974974    }
    975975}
    976 # endif
     976# endif /* VBOX_WITH_WDDM */
    977977
    978978static void stubSyncTrCheckWindowsCB(unsigned long key, void *data1, void *data2)
     
    10541054                    stub.trackWindowVisibleRgn = 0;
    10551055                    stub.bRunningUnderWDDM = true;
     1056#ifdef VBOX_WDDM_MINIPORT_WITH_VISIBLE_RECTS
     1057                    crError("should not be here, visible rects should be processed in miniport!");
     1058#endif
    10561059                }
    10571060            }
     
    11641167    return 0;
    11651168}
    1166 #endif
     1169#endif /* CR_NEWWINTRACK */
    11671170
    11681171/**
     
    12041207        disable_sync = 1;
    12051208    }
     1209#elif defined(WINDOWS) && defined(VBOX_WITH_WDDM) && defined(VBOX_WDDM_MINIPORT_WITH_VISIBLE_RECTS)
     1210    if (GetModuleHandle(VBOX_MODNAME_DISPD3D))
     1211    {
     1212        disable_sync = 1;
     1213        crDebug("running with " VBOX_MODNAME_DISPD3D);
     1214        stub.trackWindowVisibleRgn = 0;
     1215        stub.bRunningUnderWDDM = true;
     1216    }
    12061217#endif
    12071218
     
    13671378#ifdef VDBG_VEHANDLER
    13681379static PVOID g_VBoxWDbgVEHandler = NULL;
     1380static DWORD g_VBoxWDbgVEHExit = 1;
    13691381LONG WINAPI vboxVDbgVectoredHandler(struct _EXCEPTION_POINTERS *pExceptionInfo)
    13701382{
     
    13821394        case EXCEPTION_ILLEGAL_INSTRUCTION:
    13831395            CRASSERT(0);
     1396            if (g_VBoxWDbgVEHExit)
     1397                exit(1);
    13841398            break;
    13851399        default:
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c

    r42591 r43487  
    131131    CRASSERT(thread->packer);
    132132    packspuFlush((void *) thread);
     133#else
     134    crError("VBoxConFlush not implemented!");
    133135#endif
    134136}
  • trunk/src/VBox/Additions/common/crOpenGL/stub.h

    r42518 r43487  
    355355
    356356extern void stubForcedFlush(GLint con);
     357extern void stubConFlush(GLint con);
    357358extern void APIENTRY stub_GetChromiumParametervCR( GLenum target, GLuint index, GLenum type, GLsizei count, GLvoid *values );
    358359
  • trunk/src/VBox/Additions/common/crOpenGL/wgl.c

    r42499 r43487  
    325325}
    326326
     327GLint WINAPI VBoxGetWindowId( HDC hdc )
     328{
     329    WindowInfo *window = stubGetWindowInfo(hdc);
     330    if (!window)
     331    {
     332        CRASSERT(0);
     333        crWarning("stubGetWindowInfo: window not found!");
     334        return 0;
     335    }
     336    if (!window->spuWindow)
     337    {
     338        CRASSERT(0);
     339        crWarning("stubGetWindowInfo: window is null!");
     340        return 0;
     341    }
     342    return window->spuWindow;
     343}
     344
    327345HGLRC WINAPI wglCreateContext_prox( HDC hdc )
    328346{
    329347    return VBoxCreateContext(hdc, NULL);
     348}
     349
     350void WINAPI VBoxFlushToHost ( HGLRC hglrc )
     351{
     352    ContextInfo *context;
     353
     354    CR_DDI_PROLOGUE();
     355
     356//    crHashtableLock(stub.windowTable);
     357    crHashtableLock(stub.contextTable);
     358
     359    context = (ContextInfo *) crHashtableSearch(stub.contextTable, (unsigned long) hglrc);
     360
     361    if (context)
     362        stubConFlush(CR_CTX_CON(context));
     363
     364    crHashtableUnlock(stub.contextTable);
     365//    crHashtableUnlock(stub.windowTable);
    330366}
    331367
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_pack.h

    r42028 r43487  
    118118extern DECLEXPORT(int) crPackMaxOpcodes( int buffer_size );
    119119extern DECLEXPORT(int) crPackMaxData( int buffer_size );
    120 extern DECLEXPORT(void) crPackInitBuffer( CRPackBuffer *buffer, void *buf, int size, int mtu );
     120extern DECLEXPORT(void) crPackInitBuffer( CRPackBuffer *buffer, void *buf, int size, int mtu
     121#ifdef IN_RING0
     122        , unsigned int num_opcodes
     123#endif
     124        );
    121125extern DECLEXPORT(void) crPackFlushFunc( CRPackContext *pc, CRPackFlushFunc ff );
    122126extern DECLEXPORT(void) crPackFlushArg( CRPackContext *pc, void *flush_arg );
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_buffer.c

    r42028 r43487  
    150150        CRPackBuffer *buf = pc->currentBuffer;
    151151        CRASSERT(buf);
    152         crPackInitBuffer( buf, buf->pack, buf->size, buf->mtu );
     152        crPackInitBuffer( buf, buf->pack, buf->size, buf->mtu
     153#ifdef IN_RING0
     154                , 0
     155#endif
     156                );
    153157        pc->buffer.geometry_only = geom_only;   /* restore the flag */
    154158        pc->buffer.holds_BeginEnd = holds_BeginEnd;
     
    222226 *              be somewhat smaller than the buffer size.
    223227 */
    224 void crPackInitBuffer( CRPackBuffer *buf, void *pack, int size, int mtu )
    225 {
     228void crPackInitBuffer( CRPackBuffer *buf, void *pack, int size, int mtu
     229#ifdef IN_RING0
     230        , unsigned int num_opcodes
     231#endif
     232        )
     233{
     234#ifndef IN_RING0
    226235        unsigned int num_opcodes;
     236#endif
    227237
    228238        CRASSERT(mtu <= size);
     
    232242        buf->pack = pack;
    233243
    234         num_opcodes = crPackMaxOpcodes( buf->size );
     244#ifdef IN_RING0
     245        if(!num_opcodes)
     246#endif
     247        {
     248            num_opcodes = crPackMaxOpcodes( buf->size );
     249        }
    235250
    236251        buf->data_start    =
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_visibleregion.c

    r33475 r43487  
    2323#endif
    2424
    25 void PACK_APIENTRY crPackWindowVisibleRegion( GLint window, GLint cRects, GLint * pRects )
     25void PACK_APIENTRY crPackWindowVisibleRegion( CR_PACKER_CONTEXT_ARGDECL GLint window, GLint cRects, GLint * pRects )
    2626{
    2727    GLint i, size, cnt;
     
    5050}
    5151
    52 void PACK_APIENTRY crPackWindowVisibleRegionSWAP( GLint window, GLint cRects, GLint * pRects )
     52void PACK_APIENTRY crPackWindowVisibleRegionSWAP( CR_PACKER_CONTEXT_ARGDECL  GLint window, GLint cRects, GLint * pRects )
    5353{
    5454    crError( "crPackWindowVisibleRegionSWAP unimplemented and shouldn't be called" );
  • trunk/src/VBox/GuestHost/OpenGL/packer/packer.py

    r33475 r43487  
    114114    """Emit a packer function."""
    115115    if is_swapped:
    116         print 'void PACK_APIENTRY crPack%sSWAP( %s )' % (func_name, apiutil.MakeDeclarationString(params))
    117     else:
    118         print 'void PACK_APIENTRY crPack%s( %s )' % (func_name, apiutil.MakeDeclarationString(params))
     116        print 'void PACK_APIENTRY crPack%sSWAP( %s )' % (func_name, apiutil.MakeDeclarationStringWithContext('CR_PACKER_CONTEXT', params))
     117    else:
     118        print 'void PACK_APIENTRY crPack%s( %s )' % (func_name, apiutil.MakeDeclarationStringWithContext('CR_PACKER_CONTEXT', params))
    119119    print '{'
    120120    print '\tCR_GET_PACKER_CONTEXT(pc);'
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