VirtualBox

Changeset 28031 in vbox


Ignore:
Timestamp:
Apr 7, 2010 8:00:22 AM (15 years ago)
Author:
vboxsync
Message:

wddm: more correct visible VRAM size reporting + some cleaning

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  
    348348    ULONG vramSize = DeviceExtension->pPrimary->u.primary.ulMaxFrameBufferSize;
    349349#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
    351355
    352356    gPreferredVideoMode = 0;
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h

    r27997 r28031  
    607607UINT vboxWddmCalcBitsPerPixel(D3DDDIFORMAT format);
    608608
    609 DECLINLINE(ULONG) vboxWddmVramReportedSize(PDEVICE_EXTENSION pDevExt)
     609DECLINLINE(ULONG) vboxWddmVramCpuVisibleSize(PDEVICE_EXTENSION pDevExt)
    610610{
    611611    /* all memory layout info should be initialized */
     
    613613    /* page aligned */
    614614    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
     618DECLINLINE(ULONG) vboxWddmVramCpuVisibleSegmentSize(PDEVICE_EXTENSION pDevExt)
     619{
     620    return vboxWddmVramCpuVisibleSize(pDevExt);
     621}
     622
     623#ifdef VBOXWDDM_WITH_FAKE_SEGMENT
     624DECLINLINE(ULONG) vboxWddmVramCpuInvisibleSegmentSize(PDEVICE_EXTENSION pDevExt)
     625{
     626    return vboxWddmVramCpuVisibleSegmentSize(pDevExt);
     627}
     628#endif
    625629
    626630DECLINLINE(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  
    934934                            - VBVA_ADAPTER_INFORMATION_SIZE;
    935935
    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;
    939940
    940941        /* Align down to 4096 bytes. */
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoShgsmi.h

    r27307 r28031  
    1919#include <iprt/cdefs.h>
    2020#include <VBox/VBoxVideo.h>
     21#include "../VBoxVideo.h"
    2122
    2223typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext);
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h

    r27383 r28031  
    1919#include <iprt/cdefs.h>
    2020#include <VBox/VBoxVideo.h>
     21#include "../VBoxVideo.h"
    2122
    2223/* DMA commands are currently submitted over HGSMI */
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.h

    r28011 r28031  
    1616#ifndef ___VBoxVideoVidPn_h___
    1717#define ___VBoxVideoVidPn_h___
     18
     19#include "../VBoxVideo.h"
    1820
    1921#define VBOXVDPN_C_DISPLAY_HBLANK_SIZE 200
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r28011 r28031  
    143143        pView->u32ViewIndex     = pPrimaryInfo->VidPnSourceId;
    144144        pView->u32ViewOffset    = (uint32_t)offVram;
    145         pView->u32ViewSize      = vboxWddmVramReportedSegmentSize(pDevExt)/pDevExt->cSources;
     145        pView->u32ViewSize      = vboxWddmVramCpuVisibleSegmentSize(pDevExt)/pDevExt->cSources;
    146146
    147147        pView->u32MaxScreenSize = pView->u32ViewSize;
     
    11691169             * DXGK_QUERYSEGMENTIN *pQsIn = (DXGK_QUERYSEGMENTIN*)pQueryAdapterInfo->pInputData; */
    11701170            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
    11711176            if (!pQsOut->pSegmentDescriptor)
    11721177            {
    11731178                /* 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)
    11771182            {
    11781183                AssertBreakpoint();
     
    11881193                /* make sure the size is page aligned */
    11891194                /* @todo: need to setup VBVA buffers and adjust the mem size here */
    1190                 pDr->Size = vboxWddmVramReportedSegmentSize(pContext);
     1195                pDr->Size = vboxWddmVramCpuVisibleSegmentSize(pContext);
    11911196                pDr->NbOfBanks = 0;
    11921197                pDr->pBankRangeTable = 0;
     
    11941199                pDr->Flags.Value = 0;
    11951200                pDr->Flags.CpuVisible = 1;
    1196 
     1201#ifdef VBOXWDDM_WITH_FAKE_SEGMENT
    11971202                ++pDr;
    11981203                /* create cpu-invisible segment of the same size */
     
    12011206                /* make sure the size is page aligned */
    12021207                /* @todo: need to setup VBVA buffers and adjust the mem size here */
    1203                 pDr->Size = vboxWddmVramReportedSegmentSize(pContext);
     1208                pDr->Size = vboxWddmVramCpuInvisibleSegmentSize(pContext);
    12041209                pDr->NbOfBanks = 0;
    12051210                pDr->pBankRangeTable = 0;
    12061211                pDr->CommitLimit = pDr->Size;
    12071212                pDr->Flags.Value = 0;
     1213#endif
    12081214
    12091215                pQsOut->PagingBufferSegmentId = 0;
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h

    r27997 r28031  
    1717#define ___VBoxVideoWddm_h___
    1818
     19#include "../VBoxVideo.h"
     20
    1921/* one page size */
    2022#define VBOXWDDM_C_DMA_BUFFER_SIZE         0x1000
     
    2426#define VBOXWDDM_C_POINTER_MAX_WIDTH  64
    2527#define VBOXWDDM_C_POINTER_MAX_HEIGHT 64
     28
     29#define VBOXWDDM_C_VDMA_BUFFER_SIZE   (64*_1K)
     30
     31//#define VBOXWDDM_WITH_FAKE_SEGMENT
    2632
    2733#define VBOXWDDM_ROUNDBOUND(_v, _b) (((_v) + ((_b) - 1)) & ~((_b) - 1))
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