VirtualBox

Ignore:
Timestamp:
Apr 25, 2012 9:42:29 PM (13 years ago)
Author:
vboxsync
Message:

crHgsmi cleanup & adjustments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c

    r40961 r41058  
    247247{
    248248    int rc;
     249    VBOXUHGSMI_BUFFER_TYPE_FLAGS Flags = {0};
    249250    pClient->pHgsmi = pHgsmi;
    250     rc = pHgsmi->pfnBufferCreate(pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(1),
    251                             VBOXUHGSMI_SYNCHOBJECT_TYPE_EVENT,
    252                             NULL,
    253                             &pClient->pCmdBuffer);
     251    Flags.fCommand = 1;
     252    rc = pHgsmi->pfnBufferCreate(pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(1), Flags, &pClient->pCmdBuffer);
    254253    AssertRC(rc);
    255254    if (RT_SUCCESS(rc))
    256255    {
    257         rc = pHgsmi->pfnBufferCreate(pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(1),
    258                                         VBOXUHGSMI_SYNCHOBJECT_TYPE_EVENT,
    259                                         NULL,
    260                                         &pClient->pHGBuffer);
     256        Flags.Value = 0;
     257        rc = pHgsmi->pfnBufferCreate(pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(1), Flags, &pClient->pHGBuffer);
    261258        AssertRC(rc);
    262259        if (RT_SUCCESS(rc))
     
    373370    if (!buf)
    374371    {
     372        VBOXUHGSMI_BUFFER_TYPE_FLAGS Flags = {0};
    375373        crDebug("Buffer pool %p was empty; allocating new %d byte buffer.",
    376374                        (void *) pClient->bufpool,
    377375                        cbSize);
    378         rc = pClient->pHgsmi->pfnBufferCreate(pClient->pHgsmi, cbSize,
    379                                 VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE, NULL,
    380                                 &buf);
     376        rc = pClient->pHgsmi->pfnBufferCreate(pClient->pHgsmi, cbSize, Flags, &buf);
    381377        AssertRC(rc);
    382378        if (RT_FAILURE(rc))
     
    529525//                                                       * which is needed for getting the result */
    530526}
    531 
    532 #ifdef RT_OS_WINDOWS
    533 #define CRVBOXHGSMI_BUF_WAIT(_pBub) WaitForSingleObject((_pBub)->hSynch, INFINITE);
    534 #else
    535 # error "Port Me!!"
    536 #endif
    537 
    538 DECLINLINE(void) _crVBoxHGSMIWaitCmd(PCRVBOXHGSMI_CLIENT pClient)
    539 {
    540     int rc = CRVBOXHGSMI_BUF_WAIT(pClient->pCmdBuffer);
    541     CRASSERT(rc == 0);
    542 }
    543527#endif
    544528
     
    18451829    aSubmit[1].fFlags.bHostWriteOnly = 1;
    18461830
    1847     rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 2);
     1831    rc = pClient->pHgsmi->pfnBufferSubmit(pClient->pHgsmi, aSubmit, 2);
    18481832    AssertRC(rc);
    18491833    if (RT_FAILURE(rc))
    18501834    {
    1851         crError("pfnBufferSubmitAsynch failed with %d \n", rc);
     1835        crError("pfnBufferSubmit failed with %d \n", rc);
    18521836        return;
    18531837    }
    1854 
    1855     _crVBoxHGSMIWaitCmd(pClient);
    18561838
    18571839    parms = (CRVBOXHGSMIREAD *)_crVBoxHGSMICmdBufferLockRo(pClient, sizeof (*parms));
     
    19791961        aSubmit[2].fFlags.Value = 0;
    19801962
    1981         rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 3);
     1963        rc = pClient->pHgsmi->pfnBufferSubmit(pClient->pHgsmi, aSubmit, 3);
    19821964        AssertRC(rc);
    19831965        if (RT_FAILURE(rc))
    19841966        {
    1985             crError("pfnBufferSubmitAsynch failed with %d \n", rc);
     1967            crError("pfnBufferSubmit failed with %d \n", rc);
    19861968            break;
    19871969        }
    1988 
    1989         _crVBoxHGSMIWaitCmd(pClient);
    19901970
    19911971        parms = (CRVBOXHGSMIWRITEREAD *)_crVBoxHGSMICmdBufferLockRo(pClient, sizeof (*parms));
     
    20151995            else if (VERR_BUFFER_OVERFLOW == rc)
    20161996            {
     1997                VBOXUHGSMI_BUFFER_TYPE_FLAGS Flags = {0};
    20171998                PVBOXUHGSMI_BUFFER pOldBuf = pClient->pHGBuffer;
    20181999                CRASSERT(!pClient->pvHGBuffer);
     
    20202001                crDebug("Reallocating host buffer from %d to %d bytes", conn->cbHostBufferAllocated, cbWriteback);
    20212002
    2022                 rc = pClient->pHgsmi->pfnBufferCreate(pClient->pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(cbWriteback),
    2023                                 VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE, NULL, &pClient->pHGBuffer);
     2003                rc = pClient->pHgsmi->pfnBufferCreate(pClient->pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(cbWriteback), Flags, &pClient->pHGBuffer);
    20242004                AssertRC(rc);
    20252005                if (RT_SUCCESS(rc))
     
    20902070        aSubmit[1].fFlags.bHostReadOnly = 1;
    20912071
    2092         rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 2);
     2072        rc = pClient->pHgsmi->pfnBufferSubmit(pClient->pHgsmi, aSubmit, 2);
    20932073        AssertRC(rc);
    20942074        if (RT_SUCCESS(rc))
    20952075        {
    2096             _crVBoxHGSMIWaitCmd(pClient);
    2097                 /* @todo: do we need to wait for completion actually?
    2098                  * NOTE: in case we do not need completion,
    2099                  * we MUST specify bDoNotSignalCompletion flag for the command buffer */
    2100 //                CRVBOXHGSMI_BUF_WAIT(pClient->pCmdBuffer);
    2101 
    21022076            callRes = _crVBoxHGSMICmdBufferGetRc(pClient);
    21032077        }
     
    21052079        {
    21062080            /* we can not recover at this point, report error & exit */
    2107             crError("pfnBufferSubmitAsynch failed with %d \n", rc);
     2081            crError("pfnBufferSubmit failed with %d \n", rc);
    21082082        }
    21092083    }
     
    21292103        aSubmit[1].fFlags.bHostReadOnly = 1;
    21302104
    2131         rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 2);
     2105        rc = pClient->pHgsmi->pfnBufferSubmit(pClient->pHgsmi, aSubmit, 2);
    21322106        AssertRC(rc);
    21332107        if (RT_SUCCESS(rc))
    21342108        {
    2135             _crVBoxHGSMIWaitCmd(pClient);
    2136                 /* @todo: do we need to wait for completion actually?
    2137                  * NOTE: in case we do not need completion,
    2138                  * we MUST specify bDoNotSignalCompletion flag for the command buffer */
    2139 //                CRVBOXHGSMI_BUF_WAIT(pClient->pCmdBuffer);
    2140 
    21412109            callRes = _crVBoxHGSMICmdBufferGetRc(pClient);
    21422110        }
Note: See TracChangeset for help on using the changeset viewer.

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