1 | /* $Id: VBoxMPVbva.h 82968 2020-02-04 10:35:17Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox WDDM Miniport driver
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011-2020 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef GA_INCLUDED_SRC_WINNT_Graphics_Video_mp_wddm_VBoxMPVbva_h
|
---|
19 | #define GA_INCLUDED_SRC_WINNT_Graphics_Video_mp_wddm_VBoxMPVbva_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include <VBox/cdefs.h> /* for VBOXCALL */
|
---|
25 |
|
---|
26 | typedef struct VBOXVBVAINFO
|
---|
27 | {
|
---|
28 | VBVABUFFERCONTEXT Vbva;
|
---|
29 | D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId;
|
---|
30 | KSPIN_LOCK Lock;
|
---|
31 | } VBOXVBVAINFO;
|
---|
32 |
|
---|
33 | int vboxVbvaEnable(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
|
---|
34 | int vboxVbvaDisable(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
|
---|
35 | int vboxVbvaDestroy(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
|
---|
36 | int vboxVbvaCreate(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva, ULONG offBuffer, ULONG cbBuffer, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId);
|
---|
37 | int vboxVbvaReportDirtyRect(PVBOXMP_DEVEXT pDevExt, struct VBOXWDDM_SOURCE *pSrc, RECT *pRectOrig);
|
---|
38 |
|
---|
39 | #define VBOXVBVA_OP(_op, _pdext, _psrc, _arg) \
|
---|
40 | do { \
|
---|
41 | if (VBoxVBVABufferBeginUpdate(&(_psrc)->Vbva.Vbva, &VBoxCommonFromDeviceExt(_pdext)->guestCtx)) \
|
---|
42 | { \
|
---|
43 | vboxVbva##_op(_pdext, _psrc, _arg); \
|
---|
44 | VBoxVBVABufferEndUpdate(&(_psrc)->Vbva.Vbva); \
|
---|
45 | } \
|
---|
46 | } while (0)
|
---|
47 |
|
---|
48 | #define VBOXVBVA_OP_WITHLOCK_ATDPC(_op, _pdext, _psrc, _arg) \
|
---|
49 | do { \
|
---|
50 | Assert(KeGetCurrentIrql() == DISPATCH_LEVEL); \
|
---|
51 | KeAcquireSpinLockAtDpcLevel(&(_psrc)->Vbva.Lock); \
|
---|
52 | VBOXVBVA_OP(_op, _pdext, _psrc, _arg); \
|
---|
53 | KeReleaseSpinLockFromDpcLevel(&(_psrc)->Vbva.Lock);\
|
---|
54 | } while (0)
|
---|
55 |
|
---|
56 | #define VBOXVBVA_OP_WITHLOCK(_op, _pdext, _psrc, _arg) \
|
---|
57 | do { \
|
---|
58 | KIRQL OldIrql; \
|
---|
59 | KeAcquireSpinLock(&(_psrc)->Vbva.Lock, &OldIrql); \
|
---|
60 | VBOXVBVA_OP(_op, _pdext, _psrc, _arg); \
|
---|
61 | KeReleaseSpinLock(&(_psrc)->Vbva.Lock, OldIrql); \
|
---|
62 | } while (0)
|
---|
63 |
|
---|
64 | #endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_mp_wddm_VBoxMPVbva_h */
|
---|