VirtualBox

Ignore:
Timestamp:
May 25, 2010 5:26:57 PM (15 years ago)
Author:
vboxsync
Message:

wddm: driver update w/o reboot working; dummy context creation in CreateDevice

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

Legend:

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

    r29742 r29798  
    861861                                PVIDEO_POINTER_ATTRIBUTES pointerAttr,
    862862                                uint32_t cbLength);
    863 #ifndef VBOXWDDM
     863
     864#ifdef VBOXWDDM
     865int VBoxFreeDisplaysHGSMI(PDEVICE_EXTENSION PrimaryExtension);
     866#else
    864867DECLCALLBACK(void) hgsmiHostCmdComplete (HVBOXVIDEOHGSMI hHGSMI, struct _VBVAHOSTCMD * pCmd);
    865868DECLCALLBACK(int) hgsmiHostCmdRequest (HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, struct _VBVAHOSTCMD ** ppCmd);
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp

    r29742 r29798  
    10451045}
    10461046
     1047#ifdef VBOXWDDM
     1048int VBoxFreeDisplaysHGSMI(PDEVICE_EXTENSION PrimaryExtension)
     1049{
     1050    int rc;
     1051    for (int i = PrimaryExtension->cSources-1; i >= 0; --i)
     1052    {
     1053        rc = vboxVbvaDisable(PrimaryExtension, &PrimaryExtension->aSources[i].Vbva);
     1054        AssertRC(rc);
     1055        if (RT_SUCCESS(rc))
     1056        {
     1057            rc = vboxVbvaDestroy(PrimaryExtension, &PrimaryExtension->aSources[i].Vbva);
     1058            AssertRC(rc);
     1059            if (RT_SUCCESS(rc))
     1060            {
     1061                rc = vboxVdmaDisable(PrimaryExtension, &PrimaryExtension->u.primary.Vdma);
     1062                AssertRC(rc);
     1063                if (RT_SUCCESS(rc))
     1064                {
     1065                    rc = vboxVdmaDestroy(PrimaryExtension, &PrimaryExtension->u.primary.Vdma);
     1066                    AssertRC(rc);
     1067                    if (RT_SUCCESS(rc))
     1068                    {
     1069                        /*rc = */VBoxUnmapAdapterMemory(PrimaryExtension, &PrimaryExtension->u.primary.pvMiniportHeap, PrimaryExtension->u.primary.cbMiniportHeap);
     1070/*
     1071                        AssertRC(rc);
     1072                        if (RT_SUCCESS(rc))
     1073*/
     1074                        {
     1075                            HGSMIHeapDestroy(&PrimaryExtension->u.primary.hgsmiAdapterHeap);
     1076
     1077                            /* Map the adapter information. It will be needed for HGSMI IO. */
     1078                            /*rc = */VBoxUnmapAdapterMemory(PrimaryExtension, &PrimaryExtension->u.primary.pvAdapterInformation, VBVA_ADAPTER_INFORMATION_SIZE);
     1079/*
     1080                            AssertRC(rc);
     1081                            if (RT_FAILURE(rc))
     1082                                drprintf((__FUNCTION__"VBoxUnmapAdapterMemory PrimaryExtension->u.primary.pvAdapterInformation failed, rc(%d)\n", rc));
     1083*/
     1084
     1085                        }
     1086                    }
     1087                }
     1088            }
     1089        }
     1090    }
     1091
     1092    return rc;
     1093}
     1094#endif
    10471095
    10481096/*
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVbva.cpp

    r29432 r29798  
    3939        VBVAENABLE *pEnable = &pEnableEx->Base;
    4040        pEnable->u32Flags  = bEnable? VBVA_F_ENABLE: VBVA_F_DISABLE;
    41         pEnable->u32Flags |= VBVA_F_EXTENDED;
     41        pEnable->u32Flags |= VBVA_F_EXTENDED | VBVA_F_ABSOFFSET;
    4242        pEnable->u32Offset = (uint32_t)pVbva->offVBVA;
    4343        pEnable->i32Result = VERR_NOT_SUPPORTED;
     
    119119}
    120120
     121int vboxVbvaDestroy(PDEVICE_EXTENSION pDevExt, VBOXVBVAINFO *pVbva)
     122{
     123    int rc = VINF_SUCCESS;
     124    /*rc = */VBoxUnmapAdapterMemory(pDevExt, (void**)&pVbva->pVBVA, pVbva->cbVBVA);
     125/*
     126    AssertRC(rc);
     127    if (RT_SUCCESS(rc))
     128*/
     129        memset(pVbva, 0, sizeof(VBOXVBVAINFO));
     130/*
     131    else
     132        drprintf((__FUNCTION__": VBoxUnmapAdapterMemory failed, rc (%d)\n", rc));
     133*/
     134    return rc;
     135}
     136
    121137/*
    122138 * Private operations.
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVbva.h

    r28800 r29798  
    2525int vboxVbvaEnable (struct _DEVICE_EXTENSION* pDevExt, VBOXVBVAINFO *pVbva);
    2626int vboxVbvaDisable (struct _DEVICE_EXTENSION* pDevExt, VBOXVBVAINFO *pVbva);
     27int vboxVbvaDestroy(PDEVICE_EXTENSION pDevExt, VBOXVBVAINFO *pVbva);
    2728int vboxVbvaCreate(struct _DEVICE_EXTENSION* pDevExt, VBOXVBVAINFO *pVbva, ULONG offBuffer, ULONG cbBuffer, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId);
    2829int vboxVbvaReportCmdOffset (struct _DEVICE_EXTENSION* pDevExt, VBOXVBVAINFO *pVbva, uint32_t offCmd);
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp

    r29745 r29798  
    403403    }
    404404}
     405
     406void vboxVHWAFree(PDEVICE_EXTENSION pDevExt)
     407{
     408    /* we do not allocate/map anything, just issue a Disable command
     409     * to ensure all pending commands are flushed */
     410    for (uint32_t i = 0; i < pDevExt->cSources; ++i)
     411    {
     412        vboxVHWADisable(pDevExt, i);
     413    }
     414}
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.h

    r29742 r29798  
    5252int vboxVHWADisable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId);
    5353void vboxVHWAInit(PDEVICE_EXTENSION pDevExt);
     54void vboxVHWAFree(PDEVICE_EXTENSION pDevExt);
    5455
    5556#endif /* #ifndef ___VBoxVideoVhwa_h___ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r29742 r29798  
    595595}
    596596
     597static void vboxWddmDevExtZeroinit(PDEVICE_EXTENSION pDevExt, CONST PDEVICE_OBJECT pPDO)
     598{
     599    memset(pDevExt, 0, sizeof (DEVICE_EXTENSION));
     600    pDevExt->pPDO = pPDO;
     601#ifdef VBOXWDDM_RENDER_FROM_SHADOW
     602    for (int i = 0; i < RT_ELEMENTS(pDevExt->aSources); ++i)
     603    {
     604        pDevExt->aSources[i].offVram = VBOXVIDEOOFFSET_VOID;
     605    }
     606#endif
     607}
     608
    597609/* driver callbacks */
    598610NTSTATUS DxgkDdiAddDevice(
     
    613625    if (pContext)
    614626    {
    615         pContext->pPDO = PhysicalDeviceObject;
     627        vboxWddmDevExtZeroinit(pContext, PhysicalDeviceObject);
    616628        *MiniportDeviceContext = pContext;
    617 #ifdef VBOXWDDM_RENDER_FROM_SHADOW
    618         for (int i = 0; i < RT_ELEMENTS(pContext->aSources); ++i)
    619         {
    620             pContext->aSources[i].offVram = VBOXVIDEOOFFSET_VOID;
    621         }
    622 #endif
    623629    }
    624630    else
     
    694700                {
    695701                    drprintf(("VBoxVideoWddm: HGSMI failed to initialize, returning err\n"));
     702
     703                    VbglTerminate();
    696704                    /* @todo: report a better status */
    697705                    Status = STATUS_UNSUCCESSFUL;
     
    729737    dfprintf(("==> "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext));
    730738
    731     AssertBreakpoint();
    732     /* @todo: fixme: implement */
    733 
    734     dfprintf(("<== "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext));
    735 
    736     return STATUS_SUCCESS;
     739    vboxVDbgBreakF();
     740
     741    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)MiniportDeviceContext;
     742    NTSTATUS Status = STATUS_SUCCESS;
     743
     744    /* do everything we did on DxgkDdiStartDevice in the reverse order */
     745#ifdef VBOX_WITH_VIDEOHWACCEL
     746    vboxVHWAFree(pDevExt);
     747#endif
     748
     749    int rc = VBoxFreeDisplaysHGSMI(pDevExt);
     750    AssertRC(rc);
     751    if (RT_SUCCESS(rc))
     752    {
     753        VbglTerminate();
     754
     755        /* revert back to the state we were right after the DxgkDdiAddDevice */
     756        vboxWddmDevExtZeroinit(pDevExt, pDevExt->pPDO);
     757    }
     758    else
     759        Status = STATUS_UNSUCCESSFUL;
     760
     761    return Status;
    737762}
    738763
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