Changeset 28031 in vbox
- Timestamp:
- Apr 7, 2010 8:00:22 AM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r27992 r28031 348 348 ULONG vramSize = DeviceExtension->pPrimary->u.primary.ulMaxFrameBufferSize; 349 349 #else 350 ULONG vramSize = vboxWddmVramReportedSegmentSize(DeviceExtension); 350 ULONG vramSize = vboxWddmVramCpuVisibleSegmentSize(DeviceExtension); 351 #ifndef VBOXWDDM_WITH_FAKE_SEGMENT 352 /* at least two surfaces will be needed: primary & shadow */ 353 vramSize /= 2; 354 #endif 351 355 352 356 gPreferredVideoMode = 0; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r27997 r28031 607 607 UINT vboxWddmCalcBitsPerPixel(D3DDDIFORMAT format); 608 608 609 DECLINLINE(ULONG) vboxWddmVram ReportedSize(PDEVICE_EXTENSION pDevExt)609 DECLINLINE(ULONG) vboxWddmVramCpuVisibleSize(PDEVICE_EXTENSION pDevExt) 610 610 { 611 611 /* all memory layout info should be initialized */ … … 613 613 /* page aligned */ 614 614 Assert(!(pDevExt->u.primary.Vdma.CmdHeap.area.offBase & 0xfff)); 615 return pDevExt->u.primary.Vdma.CmdHeap.area.offBase; 616 } 617 618 DECLINLINE(ULONG) vboxWddmVramReportedSegmentSize(PDEVICE_EXTENSION pDevExt) 619 { 620 ULONG size = vboxWddmVramReportedSize(pDevExt); 621 size /= 2; 622 size &= ~0xfffUL; 623 return size; 624 } 615 return pDevExt->u.primary.Vdma.CmdHeap.area.offBase & ~0xfffUL; 616 } 617 618 DECLINLINE(ULONG) vboxWddmVramCpuVisibleSegmentSize(PDEVICE_EXTENSION pDevExt) 619 { 620 return vboxWddmVramCpuVisibleSize(pDevExt); 621 } 622 623 #ifdef VBOXWDDM_WITH_FAKE_SEGMENT 624 DECLINLINE(ULONG) vboxWddmVramCpuInvisibleSegmentSize(PDEVICE_EXTENSION pDevExt) 625 { 626 return vboxWddmVramCpuVisibleSegmentSize(pDevExt); 627 } 628 #endif 625 629 626 630 DECLINLINE(VOID) vboxWddmAssignPrimary(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource, PVBOXWDDM_ALLOCATION pAllocation, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId) -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r27997 r28031 934 934 - VBVA_ADAPTER_INFORMATION_SIZE; 935 935 936 /* use 25% od VRAM for DMA command buffer 937 * @todo: ^^^? */ 938 ULONG ulSize = ulAvailable / 4; 936 ULONG ulSize = ulAvailable / 2; 937 938 if (ulSize > VBOXWDDM_C_VDMA_BUFFER_SIZE) 939 ulSize = VBOXWDDM_C_VDMA_BUFFER_SIZE; 939 940 940 941 /* Align down to 4096 bytes. */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoShgsmi.h
r27307 r28031 19 19 #include <iprt/cdefs.h> 20 20 #include <VBox/VBoxVideo.h> 21 #include "../VBoxVideo.h" 21 22 22 23 typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h
r27383 r28031 19 19 #include <iprt/cdefs.h> 20 20 #include <VBox/VBoxVideo.h> 21 #include "../VBoxVideo.h" 21 22 22 23 /* DMA commands are currently submitted over HGSMI */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.h
r28011 r28031 16 16 #ifndef ___VBoxVideoVidPn_h___ 17 17 #define ___VBoxVideoVidPn_h___ 18 19 #include "../VBoxVideo.h" 18 20 19 21 #define VBOXVDPN_C_DISPLAY_HBLANK_SIZE 200 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r28011 r28031 143 143 pView->u32ViewIndex = pPrimaryInfo->VidPnSourceId; 144 144 pView->u32ViewOffset = (uint32_t)offVram; 145 pView->u32ViewSize = vboxWddmVram ReportedSegmentSize(pDevExt)/pDevExt->cSources;145 pView->u32ViewSize = vboxWddmVramCpuVisibleSegmentSize(pDevExt)/pDevExt->cSources; 146 146 147 147 pView->u32MaxScreenSize = pView->u32ViewSize; … … 1169 1169 * DXGK_QUERYSEGMENTIN *pQsIn = (DXGK_QUERYSEGMENTIN*)pQueryAdapterInfo->pInputData; */ 1170 1170 DXGK_QUERYSEGMENTOUT *pQsOut = (DXGK_QUERYSEGMENTOUT*)pQueryAdapterInfo->pOutputData; 1171 #ifdef VBOXWDDM_WITH_FAKE_SEGMENT 1172 # define VBOXWDDM_SEGMENTS_COUNT 2 1173 #else 1174 # define VBOXWDDM_SEGMENTS_COUNT 1 1175 #endif 1171 1176 if (!pQsOut->pSegmentDescriptor) 1172 1177 { 1173 1178 /* we are requested to provide the number of segments we support */ 1174 pQsOut->NbSegment = 2;1175 } 1176 else if (pQsOut->NbSegment != 2)1179 pQsOut->NbSegment = VBOXWDDM_SEGMENTS_COUNT; 1180 } 1181 else if (pQsOut->NbSegment != VBOXWDDM_SEGMENTS_COUNT) 1177 1182 { 1178 1183 AssertBreakpoint(); … … 1188 1193 /* make sure the size is page aligned */ 1189 1194 /* @todo: need to setup VBVA buffers and adjust the mem size here */ 1190 pDr->Size = vboxWddmVram ReportedSegmentSize(pContext);1195 pDr->Size = vboxWddmVramCpuVisibleSegmentSize(pContext); 1191 1196 pDr->NbOfBanks = 0; 1192 1197 pDr->pBankRangeTable = 0; … … 1194 1199 pDr->Flags.Value = 0; 1195 1200 pDr->Flags.CpuVisible = 1; 1196 1201 #ifdef VBOXWDDM_WITH_FAKE_SEGMENT 1197 1202 ++pDr; 1198 1203 /* create cpu-invisible segment of the same size */ … … 1201 1206 /* make sure the size is page aligned */ 1202 1207 /* @todo: need to setup VBVA buffers and adjust the mem size here */ 1203 pDr->Size = vboxWddmVram ReportedSegmentSize(pContext);1208 pDr->Size = vboxWddmVramCpuInvisibleSegmentSize(pContext); 1204 1209 pDr->NbOfBanks = 0; 1205 1210 pDr->pBankRangeTable = 0; 1206 1211 pDr->CommitLimit = pDr->Size; 1207 1212 pDr->Flags.Value = 0; 1213 #endif 1208 1214 1209 1215 pQsOut->PagingBufferSegmentId = 0; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h
r27997 r28031 17 17 #define ___VBoxVideoWddm_h___ 18 18 19 #include "../VBoxVideo.h" 20 19 21 /* one page size */ 20 22 #define VBOXWDDM_C_DMA_BUFFER_SIZE 0x1000 … … 24 26 #define VBOXWDDM_C_POINTER_MAX_WIDTH 64 25 27 #define VBOXWDDM_C_POINTER_MAX_HEIGHT 64 28 29 #define VBOXWDDM_C_VDMA_BUFFER_SIZE (64*_1K) 30 31 //#define VBOXWDDM_WITH_FAKE_SEGMENT 26 32 27 33 #define VBOXWDDM_ROUNDBOUND(_v, _b) (((_v) + ((_b) - 1)) & ~((_b) - 1))
Note:
See TracChangeset
for help on using the changeset viewer.