VirtualBox

Changeset 49420 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Nov 8, 2013 3:54:02 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
90501
Message:

forward-port and adopt VHWA fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r49311 r49420  
    38103810#ifdef VBOX_WITH_VIDEOHWACCEL
    38113811
    3812 void Display::handleVHWACommandProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVHWACMD pCommand)
     3812#ifndef S_FALSE
     3813# define S_FALSE ((HRESULT)1L)
     3814#endif
     3815
     3816int Display::handleVHWACommandProcess(PVBOXVHWACMD pCommand)
    38133817{
    38143818    unsigned id = (unsigned)pCommand->iDisplay;
    38153819    int rc = VINF_SUCCESS;
    3816     if (id < mcMonitors)
    3817     {
    3818         IFramebuffer *pFramebuffer = maFramebuffers[id].pFramebuffer;
    3819 #ifdef DEBUG_misha
    3820         Assert (pFramebuffer);
    3821 #endif
    3822 
    3823         if (pFramebuffer != NULL)
    3824         {
    3825             HRESULT hr = pFramebuffer->ProcessVHWACommand((BYTE*)pCommand);
    3826             if (FAILED(hr))
    3827             {
    3828                 rc = (hr == E_NOTIMPL) ? VERR_NOT_IMPLEMENTED : VERR_GENERAL_FAILURE;
    3829             }
    3830         }
    3831         else
    3832         {
    3833             rc = VERR_NOT_IMPLEMENTED;
    3834         }
    3835     }
    3836     else
    3837     {
    3838         rc = VERR_INVALID_PARAMETER;
    3839     }
    3840 
    3841     if (RT_FAILURE(rc))
    3842     {
    3843         /* tell the guest the command is complete */
    3844         pCommand->Flags &= (~VBOXVHWACMD_FLAG_HG_ASYNCH);
    3845         pCommand->rc = rc;
    3846     }
    3847 }
    3848 
    3849 DECLCALLBACK(void) Display::displayVHWACommandProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVHWACMD pCommand)
     3820    if (id >= mcMonitors)
     3821        return VERR_INVALID_PARAMETER;
     3822
     3823    ComPtr<IFramebuffer> pFramebuffer;
     3824    AutoReadLock arlock(this COMMA_LOCKVAL_SRC_POS);
     3825    pFramebuffer = maFramebuffers[id].pFramebuffer;
     3826    arlock.release();
     3827
     3828    if (pFramebuffer == NULL)
     3829        return VERR_INVALID_STATE; /* notify we can not handle request atm */
     3830
     3831    HRESULT hr = pFramebuffer->ProcessVHWACommand((BYTE*)pCommand);
     3832    if (hr == S_FALSE)
     3833        return VINF_SUCCESS;
     3834    else if (SUCCEEDED(hr))
     3835        return VINF_CALLBACK_RETURN;
     3836    else if (hr == E_ACCESSDENIED)
     3837        return VERR_INVALID_STATE; /* notify we can not handle request atm */
     3838    else if (hr == E_NOTIMPL)
     3839        return VERR_NOT_IMPLEMENTED;
     3840    return VERR_GENERAL_FAILURE;
     3841}
     3842
     3843DECLCALLBACK(int) Display::displayVHWACommandProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVHWACMD pCommand)
    38503844{
    38513845    PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
    38523846
    3853     pDrv->pDisplay->handleVHWACommandProcess(pInterface, pCommand);
     3847    return pDrv->pDisplay->handleVHWACommandProcess(pCommand);
    38543848}
    38553849#endif
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