VirtualBox

Ignore:
Timestamp:
Jun 15, 2010 10:31:34 PM (15 years ago)
Author:
vboxsync
Message:

wddm/2d: overlay create/update in UMD

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoIf.h

    r29966 r30215  
    108108} VBOXVHWA_INFO;
    109109
     110#define VBOXWDDM_OVERLAY_F_CKEY_DST      0x00000001
     111#define VBOXWDDM_OVERLAY_F_CKEY_DSTRANGE 0x00000002
     112#define VBOXWDDM_OVERLAY_F_CKEY_SRC      0x00000004
     113#define VBOXWDDM_OVERLAY_F_CKEY_SRCRANGE 0x00000008
     114#define VBOXWDDM_OVERLAY_F_BOB           0x00000010
     115#define VBOXWDDM_OVERLAY_F_INTERLEAVED   0x00000020
     116#define VBOXWDDM_OVERLAY_F_MIRROR_LR     0x00000040
     117#define VBOXWDDM_OVERLAY_F_MIRROR_UD     0x00000080
     118#define VBOXWDDM_OVERLAY_F_DEINTERLACED  0x00000100
     119
     120typedef struct VBOXWDDM_OVERLAY_DESC
     121{
     122    uint32_t fFlags;
     123    UINT DstColorKeyLow;
     124    UINT DstColorKeyHigh;
     125    UINT SrcColorKeyLow;
     126    UINT SrcColorKeyHigh;
     127} VBOXWDDM_OVERLAY_DESC, *PVBOXWDDM_OVERLAY_DESC;
     128
     129/* the dirty rect info is valid */
     130#define VBOXWDDM_DIRTYREGION_F_VALID      0x00000001
     131#define VBOXWDDM_DIRTYREGION_F_RECT_VALID 0x00000002
     132
     133typedef struct VBOXWDDM_DIRTYREGION
     134{
     135    uint32_t fFlags; /* <-- see VBOXWDDM_DIRTYREGION_F_xxx flags above */
     136    RECT Rect;
     137} VBOXWDDM_DIRTYREGION, *PVBOXWDDM_DIRTYREGION;
     138
     139typedef struct VBOXWDDM_OVERLAY_INFO
     140{
     141    VBOXWDDM_OVERLAY_DESC OverlayDesc;
     142    VBOXWDDM_DIRTYREGION DirtyRegion; /* <- the dirty region of the overlay surface */
     143} VBOXWDDM_OVERLAY_INFO, *PVBOXWDDM_OVERLAY_INFO;
     144
     145typedef struct VBOXWDDM_OVERLAYFLIP_INFO
     146{
     147    VBOXWDDM_DIRTYREGION DirtyRegion; /* <- the dirty region of the overlay surface */
     148} VBOXWDDM_OVERLAYFLIP_INFO, *PVBOXWDDM_OVERLAYFLIP_INFO;
     149
    110150/* query info func */
    111151typedef struct VBOXWDDM_QI
     
    195235}
    196236
     237DECLINLINE(void) vboxWddmRectUnite(RECT *pR, const RECT *pR2Unite)
     238{
     239    pR->left = RT_MIN(pR->left, pR2Unite->left);
     240    pR->top = RT_MIN(pR->top, pR2Unite->top);
     241    pR->right = RT_MAX(pR->right, pR2Unite->right);
     242    pR->bottom = RT_MAX(pR->bottom, pR2Unite->bottom);
     243}
     244
     245DECLINLINE(void) vboxWddmDirtyRegionAddRect(PVBOXWDDM_DIRTYREGION pInfo, const RECT *pRect)
     246{
     247    if (!(pInfo->fFlags & VBOXWDDM_DIRTYREGION_F_VALID))
     248    {
     249        pInfo->fFlags = VBOXWDDM_DIRTYREGION_F_VALID;
     250        if (pRect)
     251        {
     252            pInfo->fFlags |= VBOXWDDM_DIRTYREGION_F_RECT_VALID;
     253            pInfo->Rect = *pRect;
     254        }
     255    }
     256    else if (!!(pInfo->fFlags & VBOXWDDM_DIRTYREGION_F_RECT_VALID))
     257    {
     258        if (pRect)
     259            vboxWddmRectUnite(&pInfo->Rect, pRect);
     260        else
     261            pInfo->fFlags &= ~VBOXWDDM_DIRTYREGION_F_RECT_VALID;
     262    }
     263}
     264
     265DECLINLINE(void) vboxWddmDirtyRegionUnite(PVBOXWDDM_DIRTYREGION pInfo, const PVBOXWDDM_DIRTYREGION pInfo2)
     266{
     267    if (pInfo2->fFlags & VBOXWDDM_DIRTYREGION_F_VALID)
     268    {
     269        if (pInfo2->fFlags & VBOXWDDM_DIRTYREGION_F_RECT_VALID)
     270            vboxWddmDirtyRegionAddRect(pInfo, &pInfo2->Rect);
     271        else
     272            vboxWddmDirtyRegionAddRect(pInfo, NULL);
     273    }
     274}
     275
     276DECLINLINE(void) vboxWddmDirtyRegionClear(PVBOXWDDM_DIRTYREGION pInfo)
     277{
     278    pInfo->fFlags = 0;
     279}
     280
    197281#endif /* #ifndef ___VBoxVideoIf_h___ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp

    r30169 r30215  
    335335static void vboxVHWAInitSrc(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
    336336{
    337     Assert(srcId < pDevExt->u.primary.cDisplays);
     337    Assert(srcId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays);
    338338    VBOXVHWA_INFO *pSettings = &pDevExt->aSources[srcId].Vhwa.Settings;
    339339    memset (pSettings, 0, sizeof (VBOXVHWA_INFO));
     
    408408    /* we do not allocate/map anything, just issue a Disable command
    409409     * to ensure all pending commands are flushed */
    410     for (uint32_t i = 0; i < pDevExt->u.primary.cDisplays; ++i)
     410    for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)
    411411    {
    412412        vboxVHWADisable(pDevExt, i);
     
    660660int vboxVhwaHlpGetSurfInfo(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pSurf)
    661661{
    662     for (uint32_t i = 0; i < pDevExt->u.primary.cDisplays; ++i)
     662    for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)
    663663    {
    664664        PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[i];
     
    708708int vboxVhwaHlpCheckInit(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId)
    709709{
    710     Assert(VidPnSourceId < pDevExt->u.primary.cDisplays);
    711     if (VidPnSourceId >= pDevExt->u.primary.cDisplays)
     710    Assert(VidPnSourceId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays);
     711    if (VidPnSourceId >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays)
    712712        return VERR_INVALID_PARAMETER;
    713713
     
    748748int vboxVhwaHlpCheckTerm(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId)
    749749{
    750     Assert(VidPnSourceId < pDevExt->u.primary.cDisplays);
    751     if (VidPnSourceId >= pDevExt->u.primary.cDisplays)
     750    Assert(VidPnSourceId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays);
     751    if (VidPnSourceId >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays)
    752752        return VERR_INVALID_PARAMETER;
    753753
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r30169 r30215  
    10421042    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext));
    10431043    Assert(ChildRelationsSize == (pDevExt->u.primary.cDisplays + 1)*sizeof(DXGK_CHILD_DESCRIPTOR));
    1044     for (UINT i = 0; i < pDevExt->u.primary.cDisplays; ++i)
     1044    for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)
    10451045    {
    10461046        ChildRelations[i].ChildDeviceType = TypeVideoOutput;
     
    12321232            pCaps->MaxOverlays = 0;
    12331233#ifdef VBOX_WITH_VIDEOHWACCEL
    1234             for (uint32_t i = 0; i < pContext->u.primary.cDisplays; ++i)
     1234            for (int i = 0; i < pContext->u.primary.cDisplays; ++i)
    12351235            {
    12361236                if ( pContext->aSources[i].Vhwa.Settings.fFlags & VBOXVHWA_F_ENABLED)
     
    13231323                pQi->cInfos = pContext->u.primary.cDisplays;
    13241324#ifdef VBOX_WITH_VIDEOHWACCEL
    1325                 for (uint32_t i = 0; i < pContext->u.primary.cDisplays; ++i)
     1325                for (int i = 0; i < pContext->u.primary.cDisplays; ++i)
    13261326                {
    13271327                    pQi->aInfos[i] = pContext->aSources[i].Vhwa.Settings;
     
    26442644            if (Status == STATUS_SUCCESS && bSupported)
    26452645            {
    2646                 for (UINT id = 0; id < pContext->u.primary.cDisplays; ++id)
     2646                for (int id = 0; id < pContext->u.primary.cDisplays; ++id)
    26472647                {
    26482648                    D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet;
     
    26752675                if (Status == STATUS_SUCCESS && bSupported)
    26762676                {
    2677                     for (UINT id = 0; id < pContext->u.primary.cDisplays; ++id)
     2677                    for (int id = 0; id < pContext->u.primary.cDisplays; ++id)
    26782678                    {
    26792679                        D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet;
     
    27852785    if (Status == STATUS_SUCCESS)
    27862786    {
    2787         for (uint32_t i = 0; i < pDevExt->u.primary.cDisplays; ++i)
     2787        for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)
    27882788        {
    27892789            Status = vboxVidPnCheckAddMonitorModes(pDevExt, i, D3DKMDT_MCO_DRIVER, &Resolution, 1, 0);
     
    29022902    NTSTATUS Status = STATUS_SUCCESS;
    29032903    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter;
    2904     Assert(pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId);
    2905     if (pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId)
     2904    Assert((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId);
     2905    if ((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId)
    29062906    {
    29072907        PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceAddress->VidPnSourceId];
     
    29702970    NTSTATUS Status = STATUS_SUCCESS;
    29712971    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter;
    2972     Assert(pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId);
    2973     if (pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId)
     2972    Assert((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId);
     2973    if ((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId)
    29742974    {
    29752975        PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceVisibility->VidPnSourceId];
     
    30363036        {
    30373037            /* clear all current primaries */
    3038             for (UINT i = 0; i < pDevExt->u.primary.cDisplays; ++i)
     3038            for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i)
    30393039            {
    30403040                vboxWddmAssignPrimary(pDevExt, &pDevExt->aSources[i], NULL, i);
     
    31833183    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter;
    31843184
    3185     Assert(pDevExt->u.primary.cDisplays > pGetScanLine->VidPnTargetId);
     3185    Assert((UINT)pDevExt->u.primary.cDisplays > pGetScanLine->VidPnTargetId);
    31863186    VBOXWDDM_TARGET *pTarget = &pDevExt->aTargets[pGetScanLine->VidPnTargetId];
    31873187    Assert(pTarget->HeightTotal);
     
    31923192    {
    31933193        uint32_t curScanLine = pTarget->ScanLineState;
    3194         BOOLEAN bVBlanck;
    31953194        ++pTarget->ScanLineState;
    31963195        if (pTarget->ScanLineState >= pTarget->HeightTotal)
     
    34583457
    34593458    D3DDDI_VIDEO_PRESENT_SOURCE_ID id = pAllocation->SurfDesc.VidPnSourceId;
    3460     if (id >=  pDevExt->u.primary.cDisplays)
     3459    if (id >= (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays)
    34613460        return false;
    34623461
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