VirtualBox

Ignore:
Timestamp:
Aug 16, 2010 10:59:01 AM (14 years ago)
Author:
vboxsync
Message:

wddm: multimonitor support

File:
1 edited

Legend:

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

    r30973 r31687  
    8787}
    8888
    89 NTSTATUS vboxWddmGhDisplayPostInfoScreen (PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pAllocation)
     89NTSTATUS vboxWddmGhDisplayPostInfoScreen (PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pAllocation, POINT * pVScreenPos)
    9090{
    9191    VBOXVIDEOOFFSET offVram = pAllocation->offVram;
     
    105105
    106106        pScreen->u32ViewIndex    = pAllocation->SurfDesc.VidPnSourceId;
    107         pScreen->i32OriginX      = 0;
    108         pScreen->i32OriginY      = 0;
     107        pScreen->i32OriginX      = pVScreenPos->x;
     108        pScreen->i32OriginY      = pVScreenPos->y;
    109109        pScreen->u32StartOffset  = 0; //(uint32_t)offVram; /* we pretend the view is located at the start of each framebuffer */
    110110        pScreen->u32LineSize     = pAllocation->SurfDesc.pitch;
     
    169169}
    170170
     171NTSTATUS vboxWddmGhDisplayUpdateScreenPos(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource, POINT *pVScreenPos)
     172{
     173    if (pSource->VScreenPos.x == pVScreenPos->x
     174            && pSource->VScreenPos.y == pVScreenPos->y)
     175        return STATUS_SUCCESS;
     176
     177    pSource->VScreenPos = *pVScreenPos;
     178
     179    PVBOXWDDM_ALLOCATION pAllocation = VBOXWDDM_FB_ALLOCATION(pSource);
     180    NTSTATUS Status = vboxWddmGhDisplayPostInfoScreen(pDevExt, pAllocation, &pSource->VScreenPos);
     181    Assert(Status == STATUS_SUCCESS);
     182    return Status;
     183}
    171184
    172185NTSTATUS vboxWddmGhDisplaySetInfo(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource)
    173186{
    174 
    175 #ifndef VBOXWDDM_RENDER_FROM_SHADOW
    176     PVBOXWDDM_ALLOCATION pAllocation = pSource->pPrimaryAllocation;
    177 #else
    178     PVBOXWDDM_ALLOCATION pAllocation = pSource->pShadowAllocation;
    179 #endif
     187    PVBOXWDDM_ALLOCATION pAllocation = VBOXWDDM_FB_ALLOCATION(pSource);
    180188    VBOXVIDEOOFFSET offVram = vboxWddmValidatePrimary(pAllocation);
    181189    Assert(offVram != VBOXVIDEOOFFSET_VOID);
     
    194202        if (Status == STATUS_SUCCESS)
    195203        {
    196             Status = vboxWddmGhDisplayPostInfoScreen(pDevExt, pAllocation);
     204            Status = vboxWddmGhDisplayPostInfoScreen(pDevExt, pAllocation, &pSource->VScreenPos);
    197205            Assert(Status == STATUS_SUCCESS);
    198206            if (Status != STATUS_SUCCESS)
     
    16991707    DXGKARG_DESCRIBEALLOCATION*  pDescribeAllocation)
    17001708{
    1701 //    dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
     1709    dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
    17021710
    17031711    vboxVDbgBreakFv();
     
    17121720    pDescribeAllocation->PrivateDriverFormatAttribute = 0;
    17131721
    1714 //    dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
     1722    dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
    17151723
    17161724    return STATUS_SUCCESS;
     
    20582066}
    20592067
    2060 static void vboxWddmSubmitBltCmd(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_CONTEXT pContext, PVBOXWDDM_DMA_PRESENT_BLT pBlt)
     2068static void vboxWddmSubmitBltCmd(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource, PVBOXWDDM_CONTEXT pContext, PVBOXWDDM_DMA_PRESENT_BLT pBlt)
    20612069{
    20622070    PVBOXVDMAPIPE_CMD_RECTSINFO pRectsCmd = (PVBOXVDMAPIPE_CMD_RECTSINFO)vboxVdmaGgCmdCreate(&pDevExt->u.primary.Vdma.DmaGg, VBOXVDMAPIPE_CMD_TYPE_RECTSINFO, RT_OFFSETOF(VBOXVDMAPIPE_CMD_RECTSINFO, ContextsRects.UpdateRects.aRects[pBlt->DstRects.UpdateRects.cRects]));
     
    20662074        pRectsCmd->pContext = pContext;
    20672075        memcpy(&pRectsCmd->ContextsRects, &pBlt->DstRects, RT_OFFSETOF(VBOXVDMAPIPE_RECTS, UpdateRects.aRects[pBlt->DstRects.UpdateRects.cRects]));
     2076        vboxWddmRectTranslate(&pRectsCmd->ContextsRects.ContextRect, pSource->VScreenPos.x, pSource->VScreenPos.y);
     2077        for (UINT i = 0; i < pRectsCmd->ContextsRects.UpdateRects.cRects; ++i)
     2078        {
     2079            vboxWddmRectTranslate(&pRectsCmd->ContextsRects.UpdateRects.aRects[i], pSource->VScreenPos.x, pSource->VScreenPos.y);
     2080        }
    20682081        NTSTATUS tmpStatus = vboxVdmaGgCmdSubmit(&pDevExt->u.primary.Vdma.DmaGg, &pRectsCmd->Hdr);
    20692082        Assert(tmpStatus == STATUS_SUCCESS);
     
    21112124            vboxWddmCheckUpdateShadowAddress(pDevExt, pSource, pPrivateData->SrcAllocInfo.segmentIdAlloc, pPrivateData->SrcAllocInfo.offAlloc);
    21122125            PVBOXWDDM_DMA_PRESENT_RENDER_FROM_SHADOW pRFS = (PVBOXWDDM_DMA_PRESENT_RENDER_FROM_SHADOW)pPrivateData;
     2126            vboxWddmRectTranslate(&pRFS->rect, pSource->VScreenPos.x, pSource->VScreenPos.y);
    21132127            uint32_t cDMACmdsOutstanding = ASMAtomicReadU32(&pDevExt->cDMACmdsOutstanding);
    21142128            if (!cDMACmdsOutstanding)
     
    21632177                                    rect = pBlt->DstRects.ContextRect;
    21642178
     2179                                vboxWddmRectTranslate(&rect, pSource->VScreenPos.x, pSource->VScreenPos.y);
     2180
    21652181                                uint32_t cDMACmdsOutstanding = ASMAtomicReadU32(&pDevExt->cDMACmdsOutstanding);
    21662182                                if (!cDMACmdsOutstanding)
     
    21712187                                    VBOXVBVA_OP_WITHLOCK_ATDPC(ReportDirtyRect, pDevExt, &pSource->Vbva, &rect);
    21722188                                }
    2173                                 vboxWddmSubmitBltCmd(pDevExt, pContext, pBlt);
     2189                                vboxWddmSubmitBltCmd(pDevExt, pSource, pContext, pBlt);
    21742190                                break;
    21752191                            }
     
    21802196                                if (pSrcAlloc->fRcFlags.RenderTarget)
    21812197                                {
    2182                                     vboxWddmSubmitBltCmd(pDevExt, pContext, pBlt);
     2198                                    vboxWddmSubmitBltCmd(pDevExt, pSource, pContext, pBlt);
    21832199                                }
    21842200                                break;
     
    22222238            {
    22232239                PVBOXWDDM_ALLOCATION pAlloc = pPrivateData->SrcAllocInfo.pAlloc;
     2240                VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pPrivateData->SrcAllocInfo.srcId];
    22242241                pRectsCmd->pContext = pContext;
    22252242                RECT r;
    2226                 r.top = 0;
    2227                 r.left = 0;
    2228                 r.right = pAlloc->SurfDesc.width;
    2229                 r.bottom = pAlloc->SurfDesc.height;
     2243                r.left = pSource->VScreenPos.x;
     2244                r.top = pSource->VScreenPos.y;
     2245                r.right = pAlloc->SurfDesc.width + pSource->VScreenPos.x;
     2246                r.bottom = pAlloc->SurfDesc.height + pSource->VScreenPos.y;
    22302247                pRectsCmd->ContextsRects.ContextRect = r;
    22312248                pRectsCmd->ContextsRects.UpdateRects.cRects = 1;
     
    28432860                Status = STATUS_SUCCESS;
    28442861                break;
     2862            case VBOXESC_SCREENLAYOUT:
     2863            {
     2864                Assert(pEscape->PrivateDriverDataSize >= sizeof (VBOXDISPIFESCAPE_SCREENLAYOUT));
     2865                if (pEscape->PrivateDriverDataSize >= sizeof (VBOXDISPIFESCAPE_SCREENLAYOUT))
     2866                {
     2867                    PVBOXDISPIFESCAPE_SCREENLAYOUT pLo = (PVBOXDISPIFESCAPE_SCREENLAYOUT)pEscapeHdr;
     2868                    Assert(pLo->ScreenLayout.cScreens <= (UINT)pDevExt->u.primary.cDisplays);
     2869                    for (UINT i = 0; i < pLo->ScreenLayout.cScreens; ++i)
     2870                    {
     2871                        PVBOXSCREENLAYOUT_ELEMENT pEl = &pLo->ScreenLayout.aScreens[i];
     2872                        Assert(pEl->VidPnSourceId < (UINT)pDevExt->u.primary.cDisplays);
     2873                        if (pEl->VidPnSourceId < (UINT)pDevExt->u.primary.cDisplays)
     2874                        {
     2875                            PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pEl->VidPnSourceId];
     2876                            NTSTATUS tmpStatus = vboxWddmGhDisplayUpdateScreenPos(pDevExt, pSource, &pEl->pos);
     2877                            Assert(tmpStatus == STATUS_SUCCESS);
     2878                        }
     2879                    }
     2880                    Status = STATUS_SUCCESS;
     2881                    break;
     2882                }
     2883                else
     2884                {
     2885                    drprintf((__FUNCTION__": VBOXESC_SCREENLAYOUT: incorrect buffer size (%d) < sizeof (VBOXDISPIFESCAPE_SCREENLAYOUT) (%d)\n",
     2886                            pEscape->PrivateDriverDataSize, sizeof (VBOXDISPIFESCAPE_SCREENLAYOUT)));
     2887                    AssertBreakpoint();
     2888                    Status = STATUS_INVALID_PARAMETER;
     2889                }
     2890            }
    28452891            case VBOXESC_REINITVIDEOMODES:
    28462892                VBoxWddmInvalidateModesTable(pDevExt);
     
    29252971    PAGED_CODE();
    29262972
    2927 //    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     2973    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
    29282974
    29292975    vboxVDbgBreakFv();
     
    30163062    pIsSupportedVidPnArg->IsVidPnSupported = bSupported;
    30173063
    3018 //    dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter));
     3064    dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter));
    30193065
    30203066    return Status;
     
    31333179    PAGED_CODE();
    31343180
    3135 //    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     3181    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
    31363182
    31373183    vboxVDbgBreakFv();
     
    31803226        drprintf((__FUNCTION__ ": DxgkCbQueryVidPnInterface failed Status(0x%x)\n", Status));
    31813227
    3182 //    dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter));
     3228    dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter));
    31833229
    31843230    return Status;
     
    34853531    DXGKARG_GETSCANLINE*  pGetScanLine)
    34863532{
    3487 //    dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
     3533    dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
    34883534
    34893535    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter;
     
    35133559    }
    35143560
    3515 //    dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
     3561    dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
    35163562
    35173563    return STATUS_SUCCESS;
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