Changeset 26767 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Feb 24, 2010 7:48:02 PM (15 years ago)
- 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 2464 2464 } 2465 2465 2466 2467 BOOLEAN 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 2466 2494 /** 2467 2495 * VBoxVideoSetCurrentMode … … 2470 2498 */ 2471 2499 BOOLEAN 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 { 2481 2502 PVIDEO_MODE_INFORMATION ModeInfo; 2482 2503 … … 2499 2520 } 2500 2521 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 } 2553 2527 2554 2528 /* -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r26630 r26767 573 573 DECLINLINE(ULONG) vboxWddmVramReportedSize(PDEVICE_EXTENSION pDevExt) 574 574 { 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)); 575 579 return pDevExt->u.primary.Vdma.CmdHeap.area.offBase; 576 580 } … … 652 656 #endif 653 657 658 void* vboxHGSMIBufferAlloc(PDEVICE_EXTENSION PrimaryExtension, 659 HGSMISIZE cbData, 660 uint8_t u8Ch, 661 uint16_t u16Op); 662 void vboxHGSMIBufferFree (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer); 663 int vboxHGSMIBufferSubmit (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer); 664 665 BOOLEAN FASTCALL VBoxVideoSetCurrentModePerform(PDEVICE_EXTENSION DeviceExtension, 666 USHORT width, USHORT height, USHORT bpp); 667 654 668 BOOLEAN FASTCALL VBoxVideoSetCurrentMode( 655 669 PDEVICE_EXTENSION DeviceExtension, -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r26556 r26767 186 186 typedef FNHGSMICALLFINALIZE *PFNHGSMICALLFINALIZE; 187 187 188 void* VBoxHGSMIBufferAlloc(PDEVICE_EXTENSION PrimaryExtension,188 void* vboxHGSMIBufferAlloc(PDEVICE_EXTENSION PrimaryExtension, 189 189 HGSMISIZE cbData, 190 190 uint8_t u8Ch, … … 197 197 } 198 198 199 void* VBoxHGSMIBufferAlloc (PDEVICE_EXTENSION PrimaryExtension, 200 uint8_t u8Ch, 201 uint16_t u16Op, 202 HGSMISIZE cbData) 199 void vboxHGSMIBufferFree (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer) 203 200 { 204 201 #ifdef VBOXWDDM 205 202 /* @todo: add synchronization */ 206 203 #endif 207 return HGSMIHeapAlloc (&PrimaryExtension->u.primary.hgsmiAdapterHeap, cbData, u8Ch, u16Op);208 }209 210 void VBoxHGSMIBufferFree (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer)211 {212 #ifdef VBOXWDDM213 /* @todo: add synchronization */214 #endif215 204 HGSMIHeapFree (&PrimaryExtension->u.primary.hgsmiAdapterHeap, pvBuffer); 216 205 } 217 206 218 int VBoxHGSMIBufferSubmit (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer)207 int vboxHGSMIBufferSubmit (PDEVICE_EXTENSION PrimaryExtension, void *pvBuffer) 219 208 { 220 209 /* Initialize the buffer and get the offset for port IO. */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r26667 r26767 47 47 } 48 48 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 63 VBOXVIDEOOFFSET 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 87 NTSTATUS 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 123 NTSTATUS 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 155 NTSTATUS 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 171 NTSTATUS 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 49 204 #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 else64 {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 }85 205 86 206 NTSTATUS vboxWddmGhInitPrimary(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, D3DKMDT_VIDPN_SOURCE_MODE *pVidPnSourceModeInfo) … … 1107 1227 /* make sure the size is page aligned */ 1108 1228 /* @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); 1110 1230 pQsOut->pSegmentDescriptor->NbOfBanks = 0; 1111 1231 pQsOut->pSegmentDescriptor->pBankRangeTable = 0; … … 1517 1637 Assert(pPatchList->AllocationIndex < pPatch->AllocationListSize); 1518 1638 const DXGK_ALLOCATIONLIST *pAllocationList = &pPatch->pAllocationList[pPatchList->AllocationIndex]; 1519 if (pAllocationList-> PhysicalAddress.QuadPart)1639 if (pAllocationList->SegmentId) 1520 1640 { 1521 1641 Assert(pPatchList->PatchOffset < (pPatch->DmaBufferPrivateDataSubmissionEndOffset - pPatch->DmaBufferPrivateDataSubmissionStartOffset)); 1522 *(( PHYSICAL_ADDRESS*)(pBuf+pPatchList->PatchOffset)) = pAllocationList->PhysicalAddress;1642 *((VBOXVIDEOOFFSET*)(pBuf+pPatchList->PatchOffset)) = (VBOXVIDEOOFFSET)pAllocationList->PhysicalAddress.QuadPart; 1523 1643 } 1524 1644 else … … 2079 2199 Assert(pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE); 2080 2200 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); 2082 2204 Assert (!pPrimary->bVisible); 2083 2205 if (pPrimary->bVisible) 2084 2206 { 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)); 2086 2212 } 2087 2213 } … … 2110 2236 ) 2111 2237 { 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; 2113 2274 } 2114 2275 … … 2120 2281 ) 2121 2282 { 2283 2122 2284 return STATUS_NOT_IMPLEMENTED; 2123 2285 } … … 2368 2530 if (vboxWddmPixFormatConversionSupported(pSrcAlloc->u.SurfInfo.format, pDstAlloc->u.SurfInfo.format)) 2369 2531 { 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; 2372 2537 ++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; 2378 2540 ++pPresent->pPatchLocationListOut; 2379 2541 … … 2381 2543 pCmd->u32CmdSpecific = 0; 2382 2544 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; 2385 2547 vboxWddmSurfDescFromAllocation(pSrcAlloc, &pTransfer->srcDesc); 2386 2548 vboxWddmSurfDescFromAllocation(pDstAlloc, &pTransfer->dstDesc); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h
r26667 r26767 67 67 { 68 68 VBOXWDDM_ALLOC_TYPE enmType; 69 PHYSICAL_ADDRESS phAddress;70 BOOLEAN bPagedIn;69 VBOXVIDEOOFFSET offVram; 70 UINT SegmentId; 71 71 union 72 72 {
Note:
See TracChangeset
for help on using the changeset viewer.