VirtualBox

Ignore:
Timestamp:
Jun 28, 2010 9:16:59 PM (14 years ago)
Author:
vboxsync
Message:

wddm/3d: visible regions bugfixes fixes

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

Legend:

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

    r30441 r30484  
    120120#include "wddm/VBoxVideoShgsmi.h"
    121121#include "wddm/VBoxVideoCm.h"
     122#include "wddm/VBoxVideoVdma.h"
    122123#include "wddm/VBoxVideoWddm.h"
    123 #include "wddm/VBoxVideoVdma.h"
    124124#include "wddm/VBoxVideoVidPn.h"
    125125#ifdef VBOXWDDM_WITH_VBVA
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoCm.cpp

    r30462 r30484  
    7171    cbSize = VBOXWDDM_ROUNDBOUND(cbSize, 8);
    7272
     73    Assert(pContext->pSession);
    7374    if (!pContext->pSession)
    7475        return NULL;
     
    8687        pCmd->CmdHdr.cbCmd = pCmd->cbMaxCmdSize;
    8788    }
    88     return pCmd;
     89    return VBOXVIDEOCM_BODY(pCmd, void);
    8990}
    9091
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp

    r30441 r30484  
    149149        else
    150150        {
     151            KeReleaseSpinLock(&pPipe->SinchLock, OldIrql);
    151152            Status = STATUS_INVALID_PIPE_STATE;
    152153            break;
     
    172173                break;
    173174        }
    174         Assert(enmState > VBOXVDMAPIPE_STATE_OPENNED);
    175         Status = STATUS_PIPE_CLOSING;
     175        else
     176        {
     177            Assert(enmState == VBOXVDMAPIPE_STATE_CLOSING);
     178            Status = STATUS_PIPE_CLOSING;
     179            break;
     180        }
    176181    } while (1);
    177182
     
    207212}
    208213
    209 PVBOXVDMAPIPE_CMD_DR vboxVdmaGgCmdCreate(PVBOXVDMAGG pVdma, uint32_t cbCmd)
    210 {
    211     return (PVBOXVDMAPIPE_CMD_DR)vboxWddmMemAllocZero(cbCmd);
     214PVBOXVDMAPIPE_CMD_DR vboxVdmaGgCmdCreate(PVBOXVDMAGG pVdma, VBOXVDMAPIPE_CMD_TYPE enmType, uint32_t cbCmd)
     215{
     216    PVBOXVDMAPIPE_CMD_DR pHdr = (PVBOXVDMAPIPE_CMD_DR)vboxWddmMemAllocZero(cbCmd);
     217    Assert(pHdr);
     218    if (pHdr)
     219    {
     220        pHdr->enmType = enmType;
     221        return pHdr;
     222    }
     223    return NULL;
    212224}
    213225
     
    262274    PVBOXWDDM_CONTEXT pContext = pRectsInfo->pContext;
    263275    PDEVICE_EXTENSION pDevExt = pContext->pDevice->pAdapter;
    264     RECT * pContextRect = &pRectsInfo->ContextRect;
    265     PVBOXWDDM_RECTS_INFO pRects = &pRectsInfo->UpdateRects;
     276    RECT * pContextRect = &pRectsInfo->ContextsRects.ContextRect;
     277    PVBOXWDDM_RECTS_INFO pRects = &pRectsInfo->ContextsRects.UpdateRects;
    266278    NTSTATUS Status = STATUS_SUCCESS;
    267279    PVBOXVIDEOCM_CMD_RECTS pCmd = NULL;
     
    355367        }
    356368    }
    357     InsertHeadList(&pDevExt->ContextList3D, &pContext->ListEntry);
    358369    ExReleaseFastMutex(&pDevExt->ContextMutex);
    359370
     
    450461}
    451462
    452 NTSTATUS vboxVdmaGgCmdPost(PVBOXVDMAGG pVdma, PVBOXVDMAPIPE_CMD_DR pCmd)
     463NTSTATUS vboxVdmaGgCmdSubmit(PVBOXVDMAGG pVdma, PVBOXVDMAPIPE_CMD_DR pCmd)
    453464{
    454465    return vboxVdmaPipeCltCmdPut(&pVdma->CmdPipe, &pCmd->PipeHdr);
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h

    r30441 r30484  
    6969#define VBOXVDMAPIPE_CMD_DR_FROM_ENTRY(_pE)  ( (PVBOXVDMAPIPE_CMD_DR)VBOXVDMAPIPE_CMD_HDR_FROM_ENTRY(_pE) )
    7070
     71typedef struct VBOXVDMAPIPE_RECTS
     72{
     73    RECT ContextRect;
     74    VBOXWDDM_RECTS_INFO UpdateRects;
     75} VBOXVDMAPIPE_RECTS, *PVBOXVDMAPIPE_RECTS;
     76
    7177typedef struct VBOXVDMAPIPE_CMD_RECTSINFO
    7278{
    7379    VBOXVDMAPIPE_CMD_DR Hdr;
    74     PVBOXWDDM_CONTEXT pContext;
    75     RECT ContextRect;
    76     VBOXWDDM_RECTS_INFO UpdateRects;
     80    struct VBOXWDDM_CONTEXT *pContext;
     81    VBOXVDMAPIPE_RECTS ContextsRects;
    7782} VBOXVDMAPIPE_CMD_RECTSINFO, *PVBOXVDMAPIPE_CMD_RECTSINFO;
    7883
     
    112117#define VBOXVDMACBUF_DR_SIZE(_cbData) (VBOXVDMACBUF_DR_DATA_OFFSET() + (_cbData))
    113118#define VBOXVDMACBUF_DR_DATA(_pDr) ( ((uint8_t*)(_pDr)) + VBOXVDMACBUF_DR_DATA_OFFSET() )
     119
     120NTSTATUS vboxVdmaGgCmdSubmit(PVBOXVDMAGG pVdma, PVBOXVDMAPIPE_CMD_DR pCmd);
     121PVBOXVDMAPIPE_CMD_DR vboxVdmaGgCmdCreate(PVBOXVDMAGG pVdma, VBOXVDMAPIPE_CMD_TYPE enmType, uint32_t cbCmd);
     122void vboxVdmaGgCmdDestroy(PVBOXVDMAPIPE_CMD_DR pDr);
     123
    114124#endif /* #ifndef ___VBoxVideoVdma_h___ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r30462 r30484  
    20762076            break;
    20772077        }
     2078#endif
    20782079        case VBOXVDMACMD_TYPE_DMA_PRESENT_BLT:
    20792080        {
     
    20852086                {
    20862087                    RECT rect;
    2087                     Assert(pBlt->DstRects.cRects);
    2088                     if (pBlt->DstRects.cRects > 1)
     2088                    if (pBlt->DstRects.UpdateRects.cRects)
    20892089                    {
    2090                         rect = pBlt->DstRects.aRects[1];
    2091                         for (UINT i = 2; i < pBlt->DstRects.cRects; ++i)
     2090                        rect = pBlt->DstRects.UpdateRects.aRects[0];
     2091                        for (UINT i = 1; i < pBlt->DstRects.UpdateRects.cRects; ++i)
    20922092                        {
    2093                             vboxWddmRectUnited(&rect, &rect, &pBlt->DstRects.aRects[i]);
     2093                            vboxWddmRectUnited(&rect, &rect, &pBlt->DstRects.UpdateRects.aRects[i]);
    20942094                        }
    20952095                    }
    20962096                    else
    2097                         rect = pBlt->DstRects.aRects[0];
     2097                        rect = pBlt->DstRects.ContextRect;
    20982098
    20992099                    VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pPrivateData->SrcAllocInfo.srcId];
    21002100                    VBOXVBVA_OP(ReportDirtyRect, pDevExt, &pSource->Vbva, &rect);
     2101                }
     2102
     2103                PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pSubmitCommand->hContext;
     2104                Assert(pContext);
     2105                Assert(pContext->pDevice);
     2106                Assert(pContext->pDevice->pAdapter == pDevExt);
     2107                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]));
     2108                Assert(pRectsCmd);
     2109                if (pRectsCmd)
     2110                {
     2111                    pRectsCmd->pContext = pContext;
     2112                    pRectsCmd->ContextsRects = pBlt->DstRects;
     2113                    NTSTATUS tmpStatus = vboxVdmaGgCmdSubmit(&pDevExt->u.primary.Vdma.DmaGg, &pRectsCmd->Hdr);
     2114                    Assert(tmpStatus == STATUS_SUCCESS);
     2115                    if (tmpStatus != STATUS_SUCCESS)
     2116                        vboxVdmaGgCmdDestroy(&pRectsCmd->Hdr);
    21012117                }
    21022118            }
     
    21162132            break;
    21172133        }
    2118 
    2119 #endif
    21202134        default:
    21212135        {
     
    37563770                    PVBOXWDDM_DMA_PRESENT_BLT pBlt = (PVBOXWDDM_DMA_PRESENT_BLT)pPrivateData;
    37573771                    pBlt->SrcRect = pPresent->SrcRect;
    3758                     pBlt->DstRects.cRects = 1;
    3759                     pBlt->DstRects.aRects[0] = pPresent->DstRect;
    3760                     UINT cbHead = RT_OFFSETOF(VBOXWDDM_DMA_PRESENT_BLT, DstRects.aRects[1]);
     3772                    pBlt->DstRects.ContextRect = pPresent->DstRect;
     3773                    pBlt->DstRects.UpdateRects.cRects = 0;
     3774                    UINT cbHead = RT_OFFSETOF(VBOXWDDM_DMA_PRESENT_BLT, DstRects.UpdateRects.aRects[0]);
    37613775                    Assert(pPresent->SubRectCnt > pPresent->MultipassOffset);
    37623776                    UINT cbRects = (pPresent->SubRectCnt - pPresent->MultipassOffset) * sizeof (RECT);
     
    37683782                    {
    37693783                        cbCmd -= cbRects;
    3770                         memcpy(&pBlt->DstRects.aRects[pPresent->MultipassOffset + 1], pPresent->pDstSubRects, cbRects);
    3771                         pBlt->DstRects.cRects += cbRects/sizeof (RECT);
     3784                        memcpy(&pBlt->DstRects.UpdateRects.aRects[pPresent->MultipassOffset], pPresent->pDstSubRects, cbRects);
     3785                        pBlt->DstRects.UpdateRects.cRects += cbRects/sizeof (RECT);
    37723786                    }
    37733787                    else
     
    37753789                        UINT cbFitingRects = (cbCmd/sizeof (RECT)) * sizeof (RECT);
    37763790                        Assert(cbFitingRects);
    3777                         memcpy(&pBlt->DstRects.aRects[pPresent->MultipassOffset + 1], pPresent->pDstSubRects, cbFitingRects);
     3791                        memcpy(&pBlt->DstRects.UpdateRects.aRects[pPresent->MultipassOffset], pPresent->pDstSubRects, cbFitingRects);
    37783792                        cbCmd -= cbFitingRects;
    37793793                        pPresent->MultipassOffset += cbFitingRects/sizeof (RECT);
    3780                         pBlt->DstRects.cRects += cbFitingRects/sizeof (RECT);
     3794                        pBlt->DstRects.UpdateRects.cRects += cbFitingRects/sizeof (RECT);
    37813795                        Assert(pPresent->SubRectCnt > pPresent->MultipassOffset);
    37823796                        Status = STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER;
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h

    r30441 r30484  
    180180    VBOXWDDM_DMA_PRIVATEDATA_HDR Hdr;
    181181    RECT SrcRect;
    182     VBOXWDDM_RECTS_INFO DstRects;
     182    VBOXVDMAPIPE_RECTS DstRects;
    183183}VBOXWDDM_DMA_PRESENT_BLT, *PVBOXWDDM_DMA_PRESENT_BLT;
    184184
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