VirtualBox

Ignore:
Timestamp:
Mar 21, 2012 2:12:23 PM (13 years ago)
Author:
vboxsync
Message:

wddm: remove VBE_DISPI_LFB_PHYSICAL_ADDRESS

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPCommon.cpp

    r40489 r40566  
    3333
    3434    PHYSICAL_ADDRESS FrameBuffer;
    35     FrameBuffer.QuadPart = pPEXT->u.primary.physLFBBase.QuadPart + ulOffset;
     35    FrameBuffer.QuadPart = VBoxCommonFromDeviceExt(pPEXT)->phVRAM.QuadPart + ulOffset;
    3636
    3737    PVOID VideoRamBase = NULL;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h

    r40489 r40566  
    4040    uint32_t cbVRAM;                    /* The VRAM size. */
    4141
     42    PHYSICAL_ADDRESS phVRAM;            /* Physical VRAM base. */
     43
     44    ULONG ulApertureSize;               /* Size of the LFB aperture (>= VRAM size). */
     45
    4246    uint32_t cbMiniportHeap;            /* The size of reserved VRAM for miniport driver heap.
    4347                                         * It is at offset:
     
    128132           ULONG ulVbvaEnabled;                /* Indicates that VBVA mode is enabled. */
    129133           ULONG ulMaxFrameBufferSize;         /* The size of the VRAM allocated for the a single framebuffer. */
    130            PHYSICAL_ADDRESS physLFBBase;       /* Physical linear framebuffer base. */
    131            ULONG ulApertureSize;               /* Size of the LFB aperture (>= VRAM size). */
    132134           BOOLEAN fMouseHidden;               /* Has the mouse cursor been hidden by the guest? */
    133135           VBOXMP_COMMON commonInfo;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPHGSMI.cpp

    r40387 r40566  
    2929 * to talk to the host.
    3030 */
    31 void VBoxSetupDisplaysHGSMI(PVBOXMP_COMMON pCommon,
    32                             uint32_t AdapterMemorySize, uint32_t fCaps)
     31void VBoxSetupDisplaysHGSMI(PVBOXMP_COMMON pCommon, PHYSICAL_ADDRESS phVRAM, uint32_t ulApertureSize,
     32                            uint32_t cbVRAM, uint32_t fCaps)
    3333{
    3434    /** @todo I simply converted this from Windows error codes.  That is wrong,
     
    4242
    4343    memset(pCommon, 0, sizeof(*pCommon));
    44     pCommon->cbVRAM    = AdapterMemorySize;
     44    pCommon->phVRAM = phVRAM;
     45    pCommon->ulApertureSize = ulApertureSize;
     46    pCommon->cbVRAM    = cbVRAM;
    4547    pCommon->cDisplays = 1;
    4648    pCommon->bHGSMI    = VBoxHGSMIIsSupported();
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPHGSMI.h

    r36867 r40566  
    2323
    2424RT_C_DECLS_BEGIN
    25 void VBoxSetupDisplaysHGSMI(PVBOXMP_COMMON pCommon, uint32_t AdapterMemorySize, uint32_t fCaps);
     25void VBoxSetupDisplaysHGSMI(PVBOXMP_COMMON pCommon, PHYSICAL_ADDRESS phVRAM, uint32_t ulApertureSize, uint32_t cbVRAM, uint32_t fCaps);
    2626void VBoxFreeDisplaysHGSMI(PVBOXMP_COMMON pCommon);
    2727RT_C_DECLS_END
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp

    r40373 r40566  
    13861386        {
    13871387            PHYSICAL_ADDRESS PhysicalAddress = {0};
    1388             PhysicalAddress.QuadPart = VBE_DISPI_LFB_PHYSICAL_ADDRESS + offData;
     1388            PhysicalAddress.QuadPart = VBoxCommonFromDeviceExt(pDevExt)->phVRAM.QuadPart + offData;
    13891389            pMgr->pvData = (uint8_t*)MmMapIoSpace(PhysicalAddress, cbData, MmNonCached);
    13901390            Assert(pMgr->pvData);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r40483 r40566  
    609609}
    610610
    611 NTSTATUS vboxWddmPickResources(PVBOXMP_DEVEXT pContext, PDXGK_DEVICE_INFO pDeviceInfo, PULONG pAdapterMemorySize)
     611typedef struct VBOXWDDM_HWRESOURCES
     612{
     613    PHYSICAL_ADDRESS phVRAM;
     614    ULONG cbVRAM;
     615    ULONG ulApertureSize;
     616} VBOXWDDM_HWRESOURCES, *PVBOXWDDM_HWRESOURCES;
     617
     618NTSTATUS vboxWddmPickResources(PVBOXMP_DEVEXT pDevExt, PDXGK_DEVICE_INFO pDeviceInfo, PVBOXWDDM_HWRESOURCES pHwResources)
    612619{
    613620    NTSTATUS Status = STATUS_SUCCESS;
    614621    USHORT DispiId;
    615     *pAdapterMemorySize = VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES;
     622    memset(pHwResources, 0, sizeof (*pHwResources));
     623    pHwResources->cbVRAM = VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES;
    616624
    617625    VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID);
     
    630638        * an ULONG from the data port without setting an index before.
    631639        */
    632        *pAdapterMemorySize = VBoxVideoCmnPortReadUlong(VBE_DISPI_IOPORT_DATA);
     640       pHwResources->cbVRAM = VBoxVideoCmnPortReadUlong(VBE_DISPI_IOPORT_DATA);
    633641       if (VBoxHGSMIIsSupported ())
    634642       {
     
    648656                           break;
    649657                       case CmResourceTypeMemory:
     658                           /* we assume there is one memory segment */
     659                           Assert(pHwResources->phVRAM.QuadPart == 0);
     660                           pHwResources->phVRAM = pPRc->u.Memory.Start;
     661                           Assert(pHwResources->phVRAM.QuadPart != 0);
     662                           pHwResources->ulApertureSize = pPRc->u.Memory.Length;
     663                           Assert(pHwResources->cbVRAM <= pHwResources->ulApertureSize);
    650664                           break;
    651665                       case CmResourceTypeDma:
     
    907921        )
    908922    {
    909         PVBOXMP_DEVEXT pContext = (PVBOXMP_DEVEXT)MiniportDeviceContext;
    910 
    911         vboxWddmVGuidGet(pContext);
     923        PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)MiniportDeviceContext;
     924
     925        vboxWddmVGuidGet(pDevExt);
    912926
    913927        /* Save DeviceHandle and function pointers supplied by the DXGKRNL_INTERFACE structure passed to DxgkInterface. */
    914         memcpy(&pContext->u.primary.DxgkInterface, DxgkInterface, sizeof (DXGKRNL_INTERFACE));
     928        memcpy(&pDevExt->u.primary.DxgkInterface, DxgkInterface, sizeof (DXGKRNL_INTERFACE));
    915929
    916930        /* Allocate a DXGK_DEVICE_INFO structure, and call DxgkCbGetDeviceInformation to fill in the members of that structure, which include the registry path, the PDO, and a list of translated resources for the display adapter represented by MiniportDeviceContext. Save selected members (ones that the display miniport driver will need later)
    917931         * of the DXGK_DEVICE_INFO structure in the context block represented by MiniportDeviceContext. */
    918932        DXGK_DEVICE_INFO DeviceInfo;
    919         Status = pContext->u.primary.DxgkInterface.DxgkCbGetDeviceInformation (pContext->u.primary.DxgkInterface.DeviceHandle, &DeviceInfo);
     933        Status = pDevExt->u.primary.DxgkInterface.DxgkCbGetDeviceInformation (pDevExt->u.primary.DxgkInterface.DeviceHandle, &DeviceInfo);
    920934        if (Status == STATUS_SUCCESS)
    921935        {
    922             ULONG AdapterMemorySize;
    923             Status = vboxWddmPickResources(pContext, &DeviceInfo, &AdapterMemorySize);
     936            VBOXWDDM_HWRESOURCES HwRc;
     937            Status = vboxWddmPickResources(pDevExt, &DeviceInfo, &HwRc);
    924938            if (Status == STATUS_SUCCESS)
    925939            {
     
    931945                 * with old guest additions.
    932946                 */
    933                 VBoxSetupDisplaysHGSMI(VBoxCommonFromDeviceExt(pContext),
    934                                        AdapterMemorySize,
     947                VBoxSetupDisplaysHGSMI(VBoxCommonFromDeviceExt(pDevExt),
     948                                       HwRc.phVRAM, HwRc.ulApertureSize, HwRc.cbVRAM,
    935949                                       VBVACAPS_COMPLETEGCMD_BY_IOREAD | VBVACAPS_IRQ);
    936                 if (VBoxCommonFromDeviceExt(pContext)->bHGSMI)
     950                if (VBoxCommonFromDeviceExt(pDevExt)->bHGSMI)
    937951                {
    938                     vboxWddmSetupDisplays(pContext);
    939                     if (!VBoxCommonFromDeviceExt(pContext)->bHGSMI)
    940                         VBoxFreeDisplaysHGSMI(VBoxCommonFromDeviceExt(pContext));
     952                    vboxWddmSetupDisplays(pDevExt);
     953                    if (!VBoxCommonFromDeviceExt(pDevExt)->bHGSMI)
     954                        VBoxFreeDisplaysHGSMI(VBoxCommonFromDeviceExt(pDevExt));
    941955                }
    942                 if (VBoxCommonFromDeviceExt(pContext)->bHGSMI)
     956                if (VBoxCommonFromDeviceExt(pDevExt)->bHGSMI)
    943957                {
    944958                    LOGREL(("using HGSMI"));
    945                     *NumberOfVideoPresentSources = VBoxCommonFromDeviceExt(pContext)->cDisplays;
    946                     *NumberOfChildren = VBoxCommonFromDeviceExt(pContext)->cDisplays;
     959                    *NumberOfVideoPresentSources = VBoxCommonFromDeviceExt(pDevExt)->cDisplays;
     960                    *NumberOfChildren = VBoxCommonFromDeviceExt(pDevExt)->cDisplays;
    947961                    LOG(("sources(%d), children(%d)", *NumberOfVideoPresentSources, *NumberOfChildren));
    948962
    949                     vboxVdmaDdiNodesInit(pContext);
    950                     vboxVideoCmInit(&pContext->CmMgr);
    951                     InitializeListHead(&pContext->SwapchainList3D);
    952                     pContext->cContexts3D = 0;
    953                     ExInitializeFastMutex(&pContext->ContextMutex);
    954                     KeInitializeSpinLock(&pContext->SynchLock);
    955 
    956                     VBoxMPCmnInitCustomVideoModes(pContext);
    957                     VBoxWddmInvalidateVideoModesInfo(pContext);
     963                    vboxVdmaDdiNodesInit(pDevExt);
     964                    vboxVideoCmInit(&pDevExt->CmMgr);
     965                    InitializeListHead(&pDevExt->SwapchainList3D);
     966                    pDevExt->cContexts3D = 0;
     967                    ExInitializeFastMutex(&pDevExt->ContextMutex);
     968                    KeInitializeSpinLock(&pDevExt->SynchLock);
     969
     970                    VBoxMPCmnInitCustomVideoModes(pDevExt);
     971                    VBoxWddmInvalidateVideoModesInfo(pDevExt);
    958972#if 0
    959                     vboxShRcTreeInit(pContext);
     973                    vboxShRcTreeInit(pDevExt);
    960974#endif
    961975
    962976#ifdef VBOX_WITH_VIDEOHWACCEL
    963                     vboxVhwaInit(pContext);
     977                    vboxVhwaInit(pDevExt);
    964978#endif
    965979                }
     
    15671581    LOGF(("ENTER, context(0x%x), Query type (%d)", hAdapter, pQueryAdapterInfo->Type));
    15681582    NTSTATUS Status = STATUS_SUCCESS;
    1569     PVBOXMP_DEVEXT pContext = (PVBOXMP_DEVEXT)hAdapter;
     1583    PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)hAdapter;
    15701584
    15711585    vboxVDbgBreakFv();
     
    15871601            pCaps->MaxOverlays = 0;
    15881602#ifdef VBOX_WITH_VIDEOHWACCEL
    1589             for (int i = 0; i < VBoxCommonFromDeviceExt(pContext)->cDisplays; ++i)
    1590             {
    1591                 if ( pContext->aSources[i].Vhwa.Settings.fFlags & VBOXVHWA_F_ENABLED)
    1592                     pCaps->MaxOverlays += pContext->aSources[i].Vhwa.Settings.cOverlaysSupported;
     1603            for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i)
     1604            {
     1605                if ( pDevExt->aSources[i].Vhwa.Settings.fFlags & VBOXVHWA_F_ENABLED)
     1606                    pCaps->MaxOverlays += pDevExt->aSources[i].Vhwa.Settings.cOverlaysSupported;
    15931607            }
    15941608#endif
     
    16391653                DXGK_SEGMENTDESCRIPTOR* pDr = pQsOut->pSegmentDescriptor;
    16401654                /* we are requested to provide segment information */
    1641                 pDr->BaseAddress.QuadPart = 0; /* VBE_DISPI_LFB_PHYSICAL_ADDRESS; */
    1642                 pDr->CpuTranslatedAddress.QuadPart = VBE_DISPI_LFB_PHYSICAL_ADDRESS;
     1655                pDr->BaseAddress.QuadPart = 0;
     1656                pDr->CpuTranslatedAddress = VBoxCommonFromDeviceExt(pDevExt)->phVRAM;
    16431657                /* make sure the size is page aligned */
    16441658                /* @todo: need to setup VBVA buffers and adjust the mem size here */
    1645                 pDr->Size = vboxWddmVramCpuVisibleSegmentSize(pContext);
     1659                pDr->Size = vboxWddmVramCpuVisibleSegmentSize(pDevExt);
    16461660                pDr->NbOfBanks = 0;
    16471661                pDr->pBankRangeTable = 0;
     
    16561670                /* make sure the size is page aligned */
    16571671                /* @todo: need to setup VBVA buffers and adjust the mem size here */
    1658                 pDr->Size = vboxWddmVramCpuInvisibleSegmentSize(pContext);
     1672                pDr->Size = vboxWddmVramCpuInvisibleSegmentSize(pDevExt);
    16591673                pDr->NbOfBanks = 0;
    16601674                pDr->pBankRangeTable = 0;
     
    16761690                memset (pQi, 0, sizeof (VBOXWDDM_QI));
    16771691                pQi->u32Version = VBOXVIDEOIF_VERSION;
    1678                 pQi->cInfos = VBoxCommonFromDeviceExt(pContext)->cDisplays;
     1692                pQi->cInfos = VBoxCommonFromDeviceExt(pDevExt)->cDisplays;
    16791693#ifdef VBOX_WITH_VIDEOHWACCEL
    1680                 for (int i = 0; i < VBoxCommonFromDeviceExt(pContext)->cDisplays; ++i)
     1694                for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i)
    16811695                {
    1682                     pQi->aInfos[i] = pContext->aSources[i].Vhwa.Settings;
     1696                    pQi->aInfos[i] = pDevExt->aSources[i].Vhwa.Settings;
    16831697                }
    16841698#endif
     
    17121726    LOGF(("ENTER, context(0x%x)", hAdapter));
    17131727    NTSTATUS Status = STATUS_SUCCESS;
    1714     PVBOXMP_DEVEXT pContext = (PVBOXMP_DEVEXT)hAdapter;
     1728    PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)hAdapter;
    17151729
    17161730    vboxVDbgBreakFv();
     
    17261740//    }
    17271741
    1728     pDevice->pAdapter = pContext;
     1742    pDevice->pAdapter = pDevExt;
    17291743    pDevice->hDevice = pCreateDevice->hDevice;
    17301744
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/xpdm/VBoxMPDriver.cpp

    r40489 r40566  
    5050    VP_STATUS rc;
    5151    USHORT DispiId;
    52     ULONG AdapterMemorySize = VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES;
     52    ULONG cbVRAM = VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES;
     53    PHYSICAL_ADDRESS phVRAM = {0};
     54    ULONG ulApertureSize = 0;
    5355
    5456    PAGED_CODE();
     
    7375     * an ULONG from the data port without setting an index before.
    7476     */
    75     AdapterMemorySize = VideoPortReadPortUlong((PULONG)VBE_DISPI_IOPORT_DATA);
     77    cbVRAM = VideoPortReadPortUlong((PULONG)VBE_DISPI_IOPORT_DATA);
    7678
    7779    /* Write hw information to registry, so that it's visible in windows property dialog */
     
    8385    VBOXMP_WARN_VPS(rc);
    8486    rc = VideoPortSetRegistryParameters(pExt, L"HardwareInformation.MemorySize",
    85                                         &AdapterMemorySize, sizeof(ULONG));
     87                                        &cbVRAM, sizeof(ULONG));
    8688    VBOXMP_WARN_VPS(rc);
    8789    rc = VideoPortSetRegistryParameters(pExt, L"HardwareInformation.AdapterString",
     
    121123
    122124        /* The first range is the framebuffer. We require that information. */
    123         pExt->u.primary.physLFBBase    = tmpRanges[0].RangeStart;
    124         pExt->u.primary.ulApertureSize = tmpRanges[0].RangeLength;
     125        phVRAM = tmpRanges[0].RangeStart;
     126        ulApertureSize = tmpRanges[0].RangeLength;
    125127    }
    126128
     
    143145     * with old guest additions.
    144146     */
    145     VBoxSetupDisplaysHGSMI(&pExt->u.primary.commonInfo, AdapterMemorySize, 0);
     147    VBoxSetupDisplaysHGSMI(&pExt->u.primary.commonInfo, phVRAM, ulApertureSize, cbVRAM, 0);
    146148
    147149    if (pExt->u.primary.commonInfo.bHGSMI)
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/xpdm/VBoxMPIOCTL.cpp

    r40489 r40566  
    7575    LOGF(("framebuffer offset %#x", pExt->ulFrameBufferOffset));
    7676
    77     framebuffer.QuadPart = pExt->u.primary.physLFBBase.QuadPart + pExt->ulFrameBufferOffset;
     77    framebuffer.QuadPart = VBoxCommonFromDeviceExt(pExt)->phVRAM.QuadPart + pExt->ulFrameBufferOffset;
    7878
    7979    pMapInfo->VideoRamBase = pRequestedAddress->RequestedVirtualAddress;
     
    145145    }
    146146
    147     shareAddress.QuadPart = pExt->u.primary.physLFBBase.QuadPart + pExt->ulFrameBufferOffset;
     147    shareAddress.QuadPart = VBoxCommonFromDeviceExt(pExt)->phVRAM.QuadPart + pExt->ulFrameBufferOffset;
    148148
    149149    pStatus->Status = VideoPortMapMemory(pExt, shareAddress, &size, &inIoSpace, &virtualAddress);
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