VirtualBox

Ignore:
Timestamp:
Nov 24, 2010 10:06:02 PM (14 years ago)
Author:
vboxsync
Message:

wddm/3d: propper hide host window on swapchain destruction

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

Legend:

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

    r33530 r34345  
    3030
    3131/* One would increase this whenever definitions in this file are changed */
    32 #define VBOXVIDEOIF_VERSION 7
     32#define VBOXVIDEOIF_VERSION 8
    3333
    3434/* create allocation func */
     
    214214    VBOXWDDM_CONTEXT_TYPE_CUSTOM_2D,
    215215    VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D,
    216     VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL
     216    VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL,
     217    VBOXWDDM_CONTEXT_TYPE_CUSTOM_SESSION
    217218} VBOXWDDM_CONTEXT_TYPE;
    218219
     
    246247            /* adds hidden regions */
    247248            UINT bAddHiddenRects : 1;
    248             UINT Reserved : 29;
     249            /* hide entire window */
     250            UINT bHide : 1;
     251            /* reserved */
     252            UINT Reserved : 28;
    249253        };
    250254        uint32_t Value;
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoMisc.cpp

    r34130 r34345  
    204204    Assert(cRefs < UINT32_MAX/2);
    205205    if (!cRefs)
     206    {
     207        Assert(pSwapchain->pContext);
     208        if (pSwapchain->pContext)
     209        {
     210            NTSTATUS tmpStatus = vboxVdmaPostHideSwapchain(pSwapchain);
     211            Assert(tmpStatus == STATUS_SUCCESS);
     212        }
    206213        vboxWddmMemFree(pSwapchain);
     214    }
    207215}
    208216
     
    313321    Assert(pTst == pSwapchain);
    314322    RemoveEntryList(&pSwapchain->DevExtListEntry);
    315     pSwapchain->pContext = NULL;
     323//    pSwapchain->pContext = NULL;
    316324    pSwapchain->hSwapchainKm = NULL;
    317325    if (pSwapchain->pLastReportedRects)
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp

    r34079 r34345  
    305305    }
    306306    return true;
     307}
     308
     309NTSTATUS vboxVdmaPostHideSwapchain(PVBOXWDDM_SWAPCHAIN pSwapchain)
     310{
     311    Assert(KeGetCurrentIrql() < DISPATCH_LEVEL);
     312    uint32_t cbCmdInternal = VBOXVIDEOCM_CMD_RECTS_INTERNAL_SIZE4CRECTS(0);
     313    PVBOXVIDEOCM_CMD_RECTS_INTERNAL pCmdInternal =
     314            (PVBOXVIDEOCM_CMD_RECTS_INTERNAL)vboxVideoCmCmdCreate(&pSwapchain->pContext->CmContext, cbCmdInternal);
     315    Assert(pCmdInternal);
     316    if (pCmdInternal)
     317    {
     318        pCmdInternal->hSwapchainUm = pSwapchain->hSwapchainUm;
     319        pCmdInternal->Cmd.fFlags.Value = 0;
     320        pCmdInternal->Cmd.fFlags.bAddHiddenRects = 1;
     321        pCmdInternal->Cmd.fFlags.bHide = 1;
     322        pCmdInternal->Cmd.RectsInfo.cRects = 0;
     323        vboxVideoCmCmdSubmit(pCmdInternal, VBOXVIDEOCM_SUBMITSIZE_DEFAULT);
     324        return STATUS_SUCCESS;
     325    }
     326    return STATUS_NO_MEMORY;
    307327}
    308328
     
    914934                            Assert(Status == STATUS_SUCCESS);
    915935                        } break;
     936                        case VBOXVDMAPIPE_CMD_TYPE_RECTSINFO:
     937                        {
     938                            PVBOXVDMAPIPE_CMD_RECTSINFO pRects = (PVBOXVDMAPIPE_CMD_RECTSINFO)pDr;
     939                            Status = vboxVdmaGgDirtyRectsProcess(pRects->pDevExt, pRects->pContext, pRects->pSwapchain, &pRects->ContextsRects);
     940                            Assert(Status == STATUS_SUCCESS);
     941                            vboxVdmaGgCmdDestroy(pDr);
     942                            break;
     943                        }
    916944                        default:
    917945                            AssertBreakpoint();
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h

    r33530 r34345  
    178178{
    179179    VBOXVDMAPIPE_CMD_DR Hdr;
    180     VBOXVDMADDI_CMD DdiCmd;
     180    PDEVICE_EXTENSION pDevExt;
     181    PVBOXWDDM_CONTEXT pContext;
    181182    struct VBOXWDDM_SWAPCHAIN *pSwapchain;
    182183    VBOXVDMAPIPE_RECTS ContextsRects;
     
    302303void vboxVdmaGgCmdDestroy(PVBOXVDMAPIPE_CMD_DR pDr);
    303304
     305NTSTATUS vboxVdmaPostHideSwapchain(PVBOXWDDM_SWAPCHAIN pSwapchain);
     306
    304307#define VBOXVDMAPIPE_CMD_DR_FROM_DDI_CMD(_pCmd) ((PVBOXVDMAPIPE_CMD_DR)(((uint8_t*)(_pCmd)) - RT_OFFSETOF(VBOXVDMAPIPE_CMD_DR, DdiCmd)))
    305308DECLCALLBACK(VOID) vboxVdmaGgDdiCmdDestroy(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD pCmd, PVOID pvContext);
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