VirtualBox

Ignore:
Timestamp:
Jun 18, 2010 9:51:03 PM (15 years ago)
Author:
vboxsync
Message:

wddm/2d: bugfixing + more impl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp

    r30308 r30317  
    201201}
    202202
    203 void vboxVHWAFreeHostInfo1(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO1* pInfo)
     203void vboxVhwaFreeHostInfo1(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO1* pInfo)
    204204{
    205205    VBOXVHWACMD* pCmd = VBOXVHWACMD_HEAD(pInfo);
     
    207207}
    208208
    209 void vboxVHWAFreeHostInfo2(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO2* pInfo)
     209void vboxVhwaFreeHostInfo2(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO2* pInfo)
    210210{
    211211    VBOXVHWACMD* pCmd = VBOXVHWACMD_HEAD(pInfo);
     
    213213}
    214214
    215 VBOXVHWACMD_QUERYINFO1* vboxVHWAQueryHostInfo1(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
     215VBOXVHWACMD_QUERYINFO1* vboxVhwaQueryHostInfo1(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
    216216{
    217217    VBOXVHWACMD* pCmd = vboxVhwaCommandCreate(pDevExt, srcId, VBOXVHWACMD_TYPE_QUERY_INFO1, sizeof(VBOXVHWACMD_QUERYINFO1));
     
    221221    if (!pCmd)
    222222    {
    223         drprintf((0, "VBoxDISP::vboxVHWAQueryHostInfo1: vboxVHWACommandCreate failed\n"));
     223        drprintf((0, "VBoxDISP::vboxVhwaQueryHostInfo1: vboxVhwaCommandCreate failed\n"));
    224224        return NULL;
    225225    }
     
    245245}
    246246
    247 VBOXVHWACMD_QUERYINFO2* vboxVHWAQueryHostInfo2(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, uint32_t numFourCC)
     247VBOXVHWACMD_QUERYINFO2* vboxVhwaQueryHostInfo2(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, uint32_t numFourCC)
    248248{
    249249    VBOXVHWACMD* pCmd = vboxVhwaCommandCreate(pDevExt, srcId, VBOXVHWACMD_TYPE_QUERY_INFO2, VBOXVHWAINFO2_SIZE(numFourCC));
     
    252252    if (!pCmd)
    253253    {
    254         drprintf((0, "VBoxDISP::vboxVHWAQueryHostInfo2: vboxVHWACommandCreate failed\n"));
     254        drprintf((0, "VBoxDISP::vboxVhwaQueryHostInfo2: vboxVhwaCommandCreate failed\n"));
    255255        return NULL;
    256256    }
     
    277277}
    278278
    279 int vboxVHWAEnable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
     279int vboxVhwaEnable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
    280280{
    281281    int rc = VERR_GENERAL_FAILURE;
     
    286286    if (!pCmd)
    287287    {
    288         drprintf((0, "VBoxDISP::vboxVHWAEnable: vboxVHWACommandCreate failed\n"));
     288        drprintf((0, "VBoxDISP::vboxVhwaEnable: vboxVhwaCommandCreate failed\n"));
    289289        return rc;
    290290    }
     
    305305}
    306306
    307 int vboxVHWADisable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
     307int vboxVhwaDisable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
    308308{
    309309    int rc = VERR_GENERAL_FAILURE;
     
    314314    if (!pCmd)
    315315    {
    316         drprintf((0, "VBoxDISP::vboxVHWADisable: vboxVHWACommandCreate failed\n"));
     316        drprintf((0, "VBoxDISP::vboxVhwaDisable: vboxVhwaCommandCreate failed\n"));
    317317        return rc;
    318318    }
     
    333333}
    334334
    335 static void vboxVHWAInitSrc(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
     335static void vboxVhwaInitSrc(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
    336336{
    337337    Assert(srcId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays);
     
    339339    memset (pSettings, 0, sizeof (VBOXVHWA_INFO));
    340340
    341     VBOXVHWACMD_QUERYINFO1* pInfo1 = vboxVHWAQueryHostInfo1(pDevExt, srcId);
     341    VBOXVHWACMD_QUERYINFO1* pInfo1 = vboxVhwaQueryHostInfo1(pDevExt, srcId);
    342342    if (pInfo1)
    343343    {
     
    379379                        && (pInfo1->u.out.caps & VBOXVHWA_CAPS_OVERLAYFOURCC))
    380380                {
    381                     VBOXVHWACMD_QUERYINFO2* pInfo2 = vboxVHWAQueryHostInfo2(pDevExt, srcId, pInfo1->u.out.numFourCC);
     381                    VBOXVHWACMD_QUERYINFO2* pInfo2 = vboxVhwaQueryHostInfo2(pDevExt, srcId, pInfo1->u.out.numFourCC);
    382382                    if (pInfo2)
    383383                    {
     
    387387                            ++pSettings->cFormats;
    388388                        }
    389                         vboxVHWAFreeHostInfo2(pDevExt, pInfo2);
     389                        vboxVhwaFreeHostInfo2(pDevExt, pInfo2);
    390390                    }
    391391                }
    392392            }
    393393        }
    394         vboxVHWAFreeHostInfo1(pDevExt, pInfo1);
    395     }
    396 }
    397 
    398 void vboxVHWAInit(PDEVICE_EXTENSION pDevExt)
     394        vboxVhwaFreeHostInfo1(pDevExt, pInfo1);
     395    }
     396}
     397
     398void vboxVhwaInit(PDEVICE_EXTENSION pDevExt)
    399399{
    400400    for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)
    401401    {
    402         vboxVHWAInitSrc(pDevExt, (D3DDDI_VIDEO_PRESENT_SOURCE_ID)i);
    403     }
    404 }
    405 
    406 void vboxVHWAFree(PDEVICE_EXTENSION pDevExt)
     402        vboxVhwaInitSrc(pDevExt, (D3DDDI_VIDEO_PRESENT_SOURCE_ID)i);
     403    }
     404}
     405
     406void vboxVhwaFree(PDEVICE_EXTENSION pDevExt)
    407407{
    408408    /* we do not allocate/map anything, just issue a Disable command
     
    410410    for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)
    411411    {
    412         vboxVHWADisable(pDevExt, i);
     412        vboxVhwaDisable(pDevExt, i);
    413413    }
    414414}
     
    715715    if (cNew == 1)
    716716    {
    717         rc = vboxVhwaHlpCreatePrimary(pDevExt, pSource, VidPnSourceId);
     717        rc = vboxVhwaEnable(pDevExt, VidPnSourceId);
    718718        AssertRC(rc);
     719        if (RT_SUCCESS(rc))
     720        {
     721            rc = vboxVhwaHlpCreatePrimary(pDevExt, pSource, VidPnSourceId);
     722            AssertRC(rc);
     723            if (RT_FAILURE(rc))
     724            {
     725                int tmpRc = vboxVhwaDisable(pDevExt, VidPnSourceId);
     726                AssertRC(tmpRc);
     727            }
     728        }
    719729    }
    720730    else
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