VirtualBox

Ignore:
Timestamp:
Feb 24, 2010 7:48:02 PM (15 years ago)
Author:
vboxsync
Message:

wddm: more impl

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

Legend:

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

    r26630 r26767  
    24642464}
    24652465
     2466
     2467BOOLEAN FASTCALL VBoxVideoSetCurrentModePerform(PDEVICE_EXTENSION DeviceExtension,
     2468        USHORT width, USHORT height, USHORT bpp)
     2469{
     2470    /* set the mode characteristics */
     2471    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_XRES);
     2472    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, width);
     2473    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_YRES);
     2474    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, height);
     2475    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_BPP);
     2476    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, bpp);
     2477    /* enable the mode */
     2478    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE);
     2479    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED);
     2480    /** @todo read from the port to see if the mode switch was successful */
     2481
     2482    /* Tell the host that we now support graphics in the additions.
     2483     * @todo: Keep old behaviour, because VBoxVideoResetDevice is called on every graphics
     2484     *        mode switch and causes an OFF/ON sequence which is not handled by frontends
     2485     *        (for example Qt GUI debug build asserts when seamless is being enabled).
     2486     */
     2487    // VBoxVideoSetGraphicsCap(TRUE);
     2488
     2489    return TRUE;
     2490}
     2491
     2492#ifndef VBOXWDDM
     2493
    24662494/**
    24672495 * VBoxVideoSetCurrentMode
     
    24702498 */
    24712499BOOLEAN FASTCALL VBoxVideoSetCurrentMode(PDEVICE_EXTENSION DeviceExtension,
    2472 #ifndef VBOXWDDM
    2473                                          PVIDEO_MODE RequestedMode, PSTATUS_BLOCK StatusBlock
    2474 #else
    2475                                          D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId,
    2476                                          PVBOXWDDM_SOURCE ModeInfo
    2477 #endif
    2478                                          )
    2479 {
    2480 #ifndef VBOXWDDM
     2500                                         PVIDEO_MODE RequestedMode, PSTATUS_BLOCK StatusBlock)
     2501{
    24812502    PVIDEO_MODE_INFORMATION ModeInfo;
    24822503
     
    24992520    }
    25002521
    2501     /* set the mode characteristics */
    2502     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_XRES);
    2503     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->VisScreenWidth);
    2504     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_YRES);
    2505     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->VisScreenHeight);
    2506     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_BPP);
    2507     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->BitsPerPlane);
    2508     /* enable the mode */
    2509     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE);
    2510     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED);
    2511     /** @todo read from the port to see if the mode switch was successful */
    2512 
    2513     /* Tell the host that we now support graphics in the additions.
    2514      * @todo: Keep old behaviour, because VBoxVideoResetDevice is called on every graphics
    2515      *        mode switch and causes an OFF/ON sequence which is not handled by frontends
    2516      *        (for example Qt GUI debug build asserts when seamless is being enabled).
    2517      */
    2518     // VBoxVideoSetGraphicsCap(TRUE);
    2519 #else
    2520     Assert(!srcId);
    2521 
    2522     if (srcId)
    2523     {
    2524         dprintf(("VBoxVideo::VBoxVideoSetCurrentMode: Skipping for ? non-primary ? source ? %d\n",
    2525                 srcId));
    2526         return TRUE;
    2527     }
    2528 
    2529     /* set the mode characteristics */
    2530     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_XRES);
    2531     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->pAllocation->u.SurfInfo.width);
    2532     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_YRES);
    2533     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->pAllocation->u.SurfInfo.height);
    2534     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_BPP);
    2535     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->pAllocation->u.SurfInfo.bpp);
    2536     /* enable the mode */
    2537     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE);
    2538     VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED);
    2539     /** @todo read from the port to see if the mode switch was successful */
    2540 
    2541     /* Tell the host that we now support graphics in the additions.
    2542      * @todo: Keep old behaviour, because VBoxVideoResetDevice is called on every graphics
    2543      *        mode switch and causes an OFF/ON sequence which is not handled by frontends
    2544      *        (for example Qt GUI debug build asserts when seamless is being enabled).
    2545      */
    2546     // VBoxVideoSetGraphicsCap(TRUE);
    2547 
    2548 #endif
    2549     return TRUE;
    2550 }
    2551 
    2552 #ifndef VBOXWDDM
     2522    return VBoxVideoSetCurrentModePerform(DeviceExtension,
     2523            (USHORT)ModeInfo->VisScreenWidth,
     2524                    (USHORT)ModeInfo->VisScreenHeight,
     2525                    (USHORT)ModeInfo->BitsPerPlane);
     2526}
    25532527
    25542528/*
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h

    r26630 r26767  
    573573DECLINLINE(ULONG) vboxWddmVramReportedSize(PDEVICE_EXTENSION pDevExt)
    574574{
     575    /* all memory layout info should be initialized */
     576    Assert(pDevExt->u.primary.Vdma.CmdHeap.area.offBase);
     577    /* page aligned */
     578    Assert(!(pDevExt->u.primary.Vdma.CmdHeap.area.offBase & 0xfff));
    575579    return pDevExt->u.primary.Vdma.CmdHeap.area.offBase;
    576580}
     
    652656#endif
    653657
     658void* vboxHGSMIBufferAlloc(PDEVICE_EXTENSION PrimaryExtension,
     659                         HGSMISIZE cbData,
     660                         uint8_t u8Ch,
     661                         uint16_t u16Op);
     662void vboxHGSMIBufferFree (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer);
     663int vboxHGSMIBufferSubmit (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer);
     664
     665BOOLEAN FASTCALL VBoxVideoSetCurrentModePerform(PDEVICE_EXTENSION DeviceExtension,
     666        USHORT width, USHORT height, USHORT bpp);
     667
    654668BOOLEAN FASTCALL VBoxVideoSetCurrentMode(
    655669   PDEVICE_EXTENSION DeviceExtension,
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp

    r26556 r26767  
    186186typedef FNHGSMICALLFINALIZE *PFNHGSMICALLFINALIZE;
    187187
    188 void* VBoxHGSMIBufferAlloc (PDEVICE_EXTENSION PrimaryExtension,
     188void* vboxHGSMIBufferAlloc(PDEVICE_EXTENSION PrimaryExtension,
    189189                         HGSMISIZE cbData,
    190190                         uint8_t u8Ch,
     
    197197}
    198198
    199 void* VBoxHGSMIBufferAlloc (PDEVICE_EXTENSION PrimaryExtension,
    200                          uint8_t u8Ch,
    201                          uint16_t u16Op,
    202                          HGSMISIZE cbData)
     199void vboxHGSMIBufferFree (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer)
    203200{
    204201#ifdef VBOXWDDM
    205202    /* @todo: add synchronization */
    206203#endif
    207     return HGSMIHeapAlloc (&PrimaryExtension->u.primary.hgsmiAdapterHeap, cbData, u8Ch, u16Op);
    208 }
    209 
    210 void VBoxHGSMIBufferFree (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer)
    211 {
    212 #ifdef VBOXWDDM
    213     /* @todo: add synchronization */
    214 #endif
    215204    HGSMIHeapFree (&PrimaryExtension->u.primary.hgsmiAdapterHeap, pvBuffer);
    216205}
    217206
    218 int VBoxHGSMIBufferSubmit (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer)
     207int vboxHGSMIBufferSubmit (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer)
    219208{
    220209    /* Initialize the buffer and get the offset for port IO. */
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r26667 r26767  
    4747}
    4848
     49//VBOXVIDEOOFFSET vboxWddmVRAMAddressToOffset(PDEVICE_EXTENSION pDevExt, PHYSICAL_ADDRESS phAddress)
     50//{
     51//    Assert(phAddress.QuadPart >= VBE_DISPI_LFB_PHYSICAL_ADDRESS);
     52//    if (phAddress.QuadPart < VBE_DISPI_LFB_PHYSICAL_ADDRESS)
     53//        return VBOXVIDEOOFFSET_VOID;
     54//
     55//    VBOXVIDEOOFFSET off = phAddress.QuadPart - VBE_DISPI_LFB_PHYSICAL_ADDRESS;
     56//    Assert(off < pDevExt->u.primary.cbVRAM);
     57//    if (off >= pDevExt->u.primary.cbVRAM)
     58//        return VBOXVIDEOOFFSET_VOID;
     59//
     60//    return off;
     61//}
     62
     63VBOXVIDEOOFFSET vboxWddmValidatePrimary(PVBOXWDDM_ALLOCATION pAllocation)
     64{
     65    Assert(pAllocation);
     66    if (!pAllocation)
     67    {
     68        drprintf((__FUNCTION__": no allocation specified for Source\n"));
     69        return VBOXVIDEOOFFSET_VOID;
     70    }
     71
     72    Assert(pAllocation->SegmentId);
     73    if (!pAllocation->SegmentId)
     74    {
     75        drprintf((__FUNCTION__": allocation is not paged in\n"));
     76        return VBOXVIDEOOFFSET_VOID;
     77    }
     78
     79    VBOXVIDEOOFFSET offVram = pAllocation->offVram;
     80    Assert(offVram != VBOXVIDEOOFFSET_VOID);
     81    if (offVram == VBOXVIDEOOFFSET_VOID)
     82        drprintf((__FUNCTION__": VRAM pffset is not defined\n"));
     83
     84    return offVram;
     85}
     86
     87NTSTATUS vboxWddmGhDisplayPostInfoScreen (PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pAllocation)
     88{
     89    VBOXVIDEOOFFSET offVram = pAllocation->offVram;
     90    Assert(offVram != VBOXVIDEOOFFSET_VOID);
     91    if (offVram == VBOXVIDEOOFFSET_VOID)
     92        return STATUS_INVALID_PARAMETER;
     93
     94    PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE pPrimaryInfo = VBOXWDDM_ALLOCATION_BODY(pAllocation, VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE);
     95    /* Issue the screen info command. */
     96    void *p = vboxHGSMIBufferAlloc (pDevExt,
     97                                      sizeof (VBVAINFOSCREEN),
     98                                      HGSMI_CH_VBVA,
     99                                      VBVA_INFO_SCREEN);
     100    Assert(p);
     101    if (p)
     102    {
     103        VBVAINFOSCREEN *pScreen = (VBVAINFOSCREEN *)p;
     104
     105        pScreen->u32ViewIndex    = pPrimaryInfo->VidPnSourceId;
     106        pScreen->i32OriginX      = 0;
     107        pScreen->i32OriginY      = 0;
     108        pScreen->u32StartOffset  = offVram;
     109        pScreen->u32LineSize     = pAllocation->u.SurfInfo.pitch;
     110        pScreen->u32Width        = pAllocation->u.SurfInfo.width;
     111        pScreen->u32Height       = pAllocation->u.SurfInfo.height;
     112        pScreen->u16BitsPerPixel = (uint16_t)pAllocation->u.SurfInfo.bpp;
     113        pScreen->u16Flags        = VBVA_SCREEN_F_ACTIVE;
     114
     115        vboxHGSMIBufferSubmit (pDevExt, p);
     116
     117        vboxHGSMIBufferFree (pDevExt, p);
     118    }
     119
     120    return STATUS_SUCCESS;
     121}
     122
     123NTSTATUS vboxWddmGhDisplayPostInfoView (PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pAllocation)
     124{
     125    VBOXVIDEOOFFSET offVram = pAllocation->offVram;
     126    Assert(offVram != VBOXVIDEOOFFSET_VOID);
     127    if (offVram == VBOXVIDEOOFFSET_VOID)
     128        return STATUS_INVALID_PARAMETER;
     129
     130    PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE pPrimaryInfo = VBOXWDDM_ALLOCATION_BODY(pAllocation, VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE);
     131    /* Issue the screen info command. */
     132    void *p = vboxHGSMIBufferAlloc (pDevExt,
     133                                      sizeof (VBVAINFOVIEW),
     134                                      HGSMI_CH_VBVA,
     135                                      VBVA_INFO_VIEW);
     136    Assert(p);
     137    if (p)
     138    {
     139        VBVAINFOVIEW *pView = (VBVAINFOVIEW *)p;
     140
     141        pView->u32ViewIndex     = pPrimaryInfo->VidPnSourceId;
     142        pView->u32ViewOffset    = offVram;
     143        pView->u32ViewSize      = vboxWddmVramReportedSize(pDevExt)/pDevExt->u.primary.cDisplays;
     144
     145        pView->u32MaxScreenSize = pView->u32ViewSize;
     146
     147        vboxHGSMIBufferSubmit (pDevExt, p);
     148
     149        vboxHGSMIBufferFree (pDevExt, p);
     150    }
     151
     152    return STATUS_SUCCESS;
     153}
     154
     155NTSTATUS vboxWddmGhDisplaySetMode (PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pAllocation)
     156{
     157    PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE pPrimaryInfo = VBOXWDDM_ALLOCATION_BODY(pAllocation, VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE);
     158    if (pPrimaryInfo->VidPnSourceId)
     159        return STATUS_SUCCESS;
     160
     161    if (VBoxVideoSetCurrentModePerform(pDevExt, pAllocation->u.SurfInfo.width,
     162            pAllocation->u.SurfInfo.height, pAllocation->u.SurfInfo.bpp))
     163        return STATUS_SUCCESS;
     164
     165    AssertBreakpoint();
     166    drprintf((__FUNCTION__": VBoxVideoSetCurrentModePerform failed\n"));
     167    return STATUS_UNSUCCESSFUL;
     168}
     169
     170
     171NTSTATUS vboxWddmGhDisplaySetInfo(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource)
     172{
     173    PVBOXWDDM_ALLOCATION pAllocation = pSource->pAllocation;
     174    VBOXVIDEOOFFSET offVram = vboxWddmValidatePrimary(pAllocation);
     175    Assert(offVram != VBOXVIDEOOFFSET_VOID);
     176    if (offVram == VBOXVIDEOOFFSET_VOID)
     177        return STATUS_INVALID_PARAMETER;
     178
     179    /*
     180     * Set the current mode into the hardware.
     181     */
     182    NTSTATUS Status = vboxWddmGhDisplaySetMode (pDevExt, pAllocation);
     183    Assert(Status == STATUS_SUCCESS);
     184    if (Status == STATUS_SUCCESS)
     185    {
     186        Status = vboxWddmGhDisplayPostInfoView (pDevExt, pAllocation);
     187        Assert(Status == STATUS_SUCCESS);
     188        if (Status == STATUS_SUCCESS)
     189        {
     190            Status = vboxWddmGhDisplayPostInfoScreen (pDevExt, pAllocation);
     191            Assert(Status == STATUS_SUCCESS);
     192            if (Status != STATUS_SUCCESS)
     193                drprintf((__FUNCTION__": vboxWddmGhDisplayPostInfoScreen failed\n"));
     194        }
     195        else
     196            drprintf((__FUNCTION__": vboxWddmGhDisplayPostInfoView failed\n"));
     197    }
     198    else
     199        drprintf((__FUNCTION__": vboxWddmGhDisplaySetMode failed\n"));
     200
     201    return Status;
     202}
     203
    49204#if 0
    50 void vboxWddmProcessDisplayInfo (PPDEV ppdev)
    51 {
    52     if (ppdev->bHGSMISupported)
    53     {
    54         /* Issue the screen info command. */
    55         void *p = HGSMIHeapAlloc (&ppdev->hgsmiDisplayHeap,
    56                                   sizeof (VBVAINFOSCREEN),
    57                                   HGSMI_CH_VBVA,
    58                                   VBVA_INFO_SCREEN);
    59         if (!p)
    60         {
    61             DISPDBG((0, "VBoxDISP::VBoxProcessDisplayInfo: HGSMIHeapAlloc failed\n"));
    62         }
    63         else
    64         {
    65             VBVAINFOSCREEN *pScreen = (VBVAINFOSCREEN *)p;
    66 
    67             pScreen->u32ViewIndex    = ppdev->iDevice;
    68             pScreen->i32OriginX      = ppdev->ptlDevOrg.x;
    69             pScreen->i32OriginY      = ppdev->ptlDevOrg.y;
    70             pScreen->u32StartOffset  = 0;
    71             pScreen->u32LineSize     = ppdev->lDeltaScreen > 0?ppdev->lDeltaScreen: -ppdev->lDeltaScreen;
    72             pScreen->u32Width        = ppdev->cxScreen;
    73             pScreen->u32Height       = ppdev->cyScreen;
    74             pScreen->u16BitsPerPixel = (uint16_t)ppdev->ulBitCount;
    75             pScreen->u16Flags        = VBVA_SCREEN_F_ACTIVE;
    76 
    77             vboxHGSMIBufferSubmit (ppdev, p);
    78 
    79             HGSMIHeapFree (&ppdev->hgsmiDisplayHeap, p);
    80         }
    81     }
    82 
    83     return;
    84 }
    85205
    86206NTSTATUS vboxWddmGhInitPrimary(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, D3DKMDT_VIDPN_SOURCE_MODE *pVidPnSourceModeInfo)
     
    11071227                /* make sure the size is page aligned */
    11081228                /* @todo: need to setup VBVA buffers and adjust the mem size here */
    1109                 pQsOut->pSegmentDescriptor->Size = (pContext->u.primary.cbVRAM - VBVA_ADAPTER_INFORMATION_SIZE - pContext->u.primary.cbMiniportHeap) & (~0xfffUL);
     1229                pQsOut->pSegmentDescriptor->Size = vboxWddmVramReportedSize(pContext);
    11101230                pQsOut->pSegmentDescriptor->NbOfBanks = 0;
    11111231                pQsOut->pSegmentDescriptor->pBankRangeTable = 0;
     
    15171637        Assert(pPatchList->AllocationIndex < pPatch->AllocationListSize);
    15181638        const DXGK_ALLOCATIONLIST *pAllocationList = &pPatch->pAllocationList[pPatchList->AllocationIndex];
    1519         if (pAllocationList->PhysicalAddress.QuadPart)
     1639        if (pAllocationList->SegmentId)
    15201640        {
    15211641            Assert(pPatchList->PatchOffset < (pPatch->DmaBufferPrivateDataSubmissionEndOffset - pPatch->DmaBufferPrivateDataSubmissionStartOffset));
    1522             *((PHYSICAL_ADDRESS*)(pBuf+pPatchList->PatchOffset)) = pAllocationList->PhysicalAddress;
     1642            *((VBOXVIDEOOFFSET*)(pBuf+pPatchList->PatchOffset)) = (VBOXVIDEOOFFSET)pAllocationList->PhysicalAddress.QuadPart;
    15231643        }
    15241644        else
     
    20792199            Assert(pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE);
    20802200            PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE pPrimary = VBOXWDDM_ALLOCATION_BODY(pAllocation, VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE);
    2081             pAllocation->phAddress = pSetVidPnSourceAddress->PrimaryAddress;
     2201            pAllocation->offVram = (VBOXVIDEOOFFSET)pSetVidPnSourceAddress->PrimaryAddress.QuadPart;
     2202            pAllocation->SegmentId = pSetVidPnSourceAddress->PrimarySegment;
     2203            Assert (pAllocation->SegmentId);
    20822204            Assert (!pPrimary->bVisible);
    20832205            if (pPrimary->bVisible)
    20842206            {
    2085                 /* @todo: should not generally happen, but still inform host*/
     2207                /* should not generally happen, but still inform host*/
     2208                Status = vboxWddmGhDisplaySetInfo(pDevExt, pSource);
     2209                Assert(Status == STATUS_SUCCESS);
     2210                if (Status != STATUS_SUCCESS)
     2211                    drprintf((__FUNCTION__": vboxWddmGhDisplaySetInfo failed, Status (0x%x)\n", Status));
    20862212            }
    20872213        }
     
    21102236    )
    21112237{
    2112     return STATUS_NOT_IMPLEMENTED;
     2238    /* DxgkDdiSetVidPnSourceVisibility should be made pageable. */
     2239    PAGED_CODE();
     2240
     2241    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     2242
     2243    NTSTATUS Status = STATUS_SUCCESS;
     2244    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter;
     2245    Assert(pDevExt->cSources > pSetVidPnSourceVisibility->VidPnSourceId);
     2246    if (pDevExt->cSources > pSetVidPnSourceVisibility->VidPnSourceId)
     2247    {
     2248        PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceVisibility->VidPnSourceId];
     2249        PVBOXWDDM_ALLOCATION pAllocation = pSource->pAllocation;
     2250        PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE pPrimary = VBOXWDDM_ALLOCATION_BODY(pAllocation, VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE);
     2251
     2252        Assert(pPrimary->bVisible != pSetVidPnSourceVisibility->Visible);
     2253        if (pPrimary->bVisible != pSetVidPnSourceVisibility->Visible)
     2254        {
     2255            pPrimary->bVisible = pSetVidPnSourceVisibility->Visible;
     2256            if (pPrimary->bVisible)
     2257            {
     2258                Status = vboxWddmGhDisplaySetInfo(pDevExt, pSource);
     2259                Assert(Status == STATUS_SUCCESS);
     2260                if (Status != STATUS_SUCCESS)
     2261                    drprintf((__FUNCTION__": vboxWddmGhDisplaySetInfo failed, Status (0x%x)\n", Status));
     2262            }
     2263        }
     2264    }
     2265    else
     2266    {
     2267        drprintf((__FUNCTION__": invalid VidPnSourceId (%d), should be smaller than (%d)\n", pSetVidPnSourceVisibility->VidPnSourceId, pDevExt->cSources));
     2268        Status = STATUS_INVALID_PARAMETER;
     2269    }
     2270
     2271    dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter));
     2272
     2273    return Status;
    21132274}
    21142275
     
    21202281    )
    21212282{
     2283
    21222284    return STATUS_NOT_IMPLEMENTED;
    21232285}
     
    23682530                    if (vboxWddmPixFormatConversionSupported(pSrcAlloc->u.SurfInfo.format, pDstAlloc->u.SurfInfo.format))
    23692531                    {
    2370                         memset(pPresent->pPatchLocationListOut, 0, 3*sizeof (D3DDDI_PATCHLOCATIONLIST));
    2371                         pPresent->pPatchLocationListOut->PatchOffset = 0;
     2532                        memset(pPresent->pPatchLocationListOut, 0, 2*sizeof (D3DDDI_PATCHLOCATIONLIST));
     2533//                        pPresent->pPatchLocationListOut->PatchOffset = 0;
     2534//                        ++pPresent->pPatchLocationListOut;
     2535                        pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, offSrc);
     2536                        pPresent->pPatchLocationListOut->AllocationIndex = 0;
    23722537                        ++pPresent->pPatchLocationListOut;
    2373                         pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, phSrc);
    2374                         pPresent->pPatchLocationListOut->AllocationIndex = DXGK_PRESENT_SOURCE_INDEX;
    2375                         ++pPresent->pPatchLocationListOut;
    2376                         pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, phDst);
    2377                         pPresent->pPatchLocationListOut->AllocationIndex = DXGK_PRESENT_DESTINATION_INDEX;
     2538                        pPresent->pPatchLocationListOut->PatchOffset = VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, offDst);
     2539                        pPresent->pPatchLocationListOut->AllocationIndex = 1;
    23782540                        ++pPresent->pPatchLocationListOut;
    23792541
     
    23812543                        pCmd->u32CmdSpecific = 0;
    23822544                        PVBOXVDMACMD_DMA_PRESENT_BLT pTransfer = VBOXVDMACMD_BODY(pCmd, VBOXVDMACMD_DMA_PRESENT_BLT);
    2383                         pTransfer->phSrc = pSrc->PhysicalAddress.QuadPart;
    2384                         pTransfer->phDst = pDst->PhysicalAddress.QuadPart;
     2545                        pTransfer->offSrc = (VBOXVIDEOOFFSET)pSrc->PhysicalAddress.QuadPart;
     2546                        pTransfer->offDst = (VBOXVIDEOOFFSET)pDst->PhysicalAddress.QuadPart;
    23852547                        vboxWddmSurfDescFromAllocation(pSrcAlloc, &pTransfer->srcDesc);
    23862548                        vboxWddmSurfDescFromAllocation(pDstAlloc, &pTransfer->dstDesc);
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h

    r26667 r26767  
    6767{
    6868    VBOXWDDM_ALLOC_TYPE enmType;
    69     PHYSICAL_ADDRESS phAddress;
    70     BOOLEAN bPagedIn;
     69    VBOXVIDEOOFFSET offVram;
     70    UINT SegmentId;
    7171    union
    7272    {
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