Changeset 41058 in vbox for trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
- Timestamp:
- Apr 25, 2012 9:42:29 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
r40961 r41058 247 247 { 248 248 int rc; 249 VBOXUHGSMI_BUFFER_TYPE_FLAGS Flags = {0}; 249 250 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); 254 253 AssertRC(rc); 255 254 if (RT_SUCCESS(rc)) 256 255 { 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); 261 258 AssertRC(rc); 262 259 if (RT_SUCCESS(rc)) … … 373 370 if (!buf) 374 371 { 372 VBOXUHGSMI_BUFFER_TYPE_FLAGS Flags = {0}; 375 373 crDebug("Buffer pool %p was empty; allocating new %d byte buffer.", 376 374 (void *) pClient->bufpool, 377 375 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); 381 377 AssertRC(rc); 382 378 if (RT_FAILURE(rc)) … … 529 525 // * which is needed for getting the result */ 530 526 } 531 532 #ifdef RT_OS_WINDOWS533 #define CRVBOXHGSMI_BUF_WAIT(_pBub) WaitForSingleObject((_pBub)->hSynch, INFINITE);534 #else535 # error "Port Me!!"536 #endif537 538 DECLINLINE(void) _crVBoxHGSMIWaitCmd(PCRVBOXHGSMI_CLIENT pClient)539 {540 int rc = CRVBOXHGSMI_BUF_WAIT(pClient->pCmdBuffer);541 CRASSERT(rc == 0);542 }543 527 #endif 544 528 … … 1845 1829 aSubmit[1].fFlags.bHostWriteOnly = 1; 1846 1830 1847 rc = pClient->pHgsmi->pfnBufferSubmit Asynch(pClient->pHgsmi, aSubmit, 2);1831 rc = pClient->pHgsmi->pfnBufferSubmit(pClient->pHgsmi, aSubmit, 2); 1848 1832 AssertRC(rc); 1849 1833 if (RT_FAILURE(rc)) 1850 1834 { 1851 crError("pfnBufferSubmit Asynchfailed with %d \n", rc);1835 crError("pfnBufferSubmit failed with %d \n", rc); 1852 1836 return; 1853 1837 } 1854 1855 _crVBoxHGSMIWaitCmd(pClient);1856 1838 1857 1839 parms = (CRVBOXHGSMIREAD *)_crVBoxHGSMICmdBufferLockRo(pClient, sizeof (*parms)); … … 1979 1961 aSubmit[2].fFlags.Value = 0; 1980 1962 1981 rc = pClient->pHgsmi->pfnBufferSubmit Asynch(pClient->pHgsmi, aSubmit, 3);1963 rc = pClient->pHgsmi->pfnBufferSubmit(pClient->pHgsmi, aSubmit, 3); 1982 1964 AssertRC(rc); 1983 1965 if (RT_FAILURE(rc)) 1984 1966 { 1985 crError("pfnBufferSubmit Asynchfailed with %d \n", rc);1967 crError("pfnBufferSubmit failed with %d \n", rc); 1986 1968 break; 1987 1969 } 1988 1989 _crVBoxHGSMIWaitCmd(pClient);1990 1970 1991 1971 parms = (CRVBOXHGSMIWRITEREAD *)_crVBoxHGSMICmdBufferLockRo(pClient, sizeof (*parms)); … … 2015 1995 else if (VERR_BUFFER_OVERFLOW == rc) 2016 1996 { 1997 VBOXUHGSMI_BUFFER_TYPE_FLAGS Flags = {0}; 2017 1998 PVBOXUHGSMI_BUFFER pOldBuf = pClient->pHGBuffer; 2018 1999 CRASSERT(!pClient->pvHGBuffer); … … 2020 2001 crDebug("Reallocating host buffer from %d to %d bytes", conn->cbHostBufferAllocated, cbWriteback); 2021 2002 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); 2024 2004 AssertRC(rc); 2025 2005 if (RT_SUCCESS(rc)) … … 2090 2070 aSubmit[1].fFlags.bHostReadOnly = 1; 2091 2071 2092 rc = pClient->pHgsmi->pfnBufferSubmit Asynch(pClient->pHgsmi, aSubmit, 2);2072 rc = pClient->pHgsmi->pfnBufferSubmit(pClient->pHgsmi, aSubmit, 2); 2093 2073 AssertRC(rc); 2094 2074 if (RT_SUCCESS(rc)) 2095 2075 { 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 2102 2076 callRes = _crVBoxHGSMICmdBufferGetRc(pClient); 2103 2077 } … … 2105 2079 { 2106 2080 /* we can not recover at this point, report error & exit */ 2107 crError("pfnBufferSubmit Asynchfailed with %d \n", rc);2081 crError("pfnBufferSubmit failed with %d \n", rc); 2108 2082 } 2109 2083 } … … 2129 2103 aSubmit[1].fFlags.bHostReadOnly = 1; 2130 2104 2131 rc = pClient->pHgsmi->pfnBufferSubmit Asynch(pClient->pHgsmi, aSubmit, 2);2105 rc = pClient->pHgsmi->pfnBufferSubmit(pClient->pHgsmi, aSubmit, 2); 2132 2106 AssertRC(rc); 2133 2107 if (RT_SUCCESS(rc)) 2134 2108 { 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 2141 2109 callRes = _crVBoxHGSMICmdBufferGetRc(pClient); 2142 2110 }
Note:
See TracChangeset
for help on using the changeset viewer.