1 | /* $Id: VBoxMPVbva.h 37626 2011-06-24 12:01:33Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox WDDM Miniport driver
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2011 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef ___VBoxMPVbva_h___
|
---|
20 | #define ___VBoxMPVbva_h___
|
---|
21 |
|
---|
22 | typedef struct VBOXVBVAINFO
|
---|
23 | {
|
---|
24 | VBOXVIDEOOFFSET offVBVA;
|
---|
25 | uint32_t cbVBVA;
|
---|
26 | VBVABUFFER *pVBVA;
|
---|
27 | BOOL fHwBufferOverflow;
|
---|
28 | VBVARECORD *pRecord;
|
---|
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 vboxVbvaReportCmdOffset(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva, uint32_t offCmd);
|
---|
38 | int vboxVbvaReportDirtyRect(PVBOXMP_DEVEXT pDevExt, struct VBOXWDDM_SOURCE *pSrc, RECT *pRectOrig);
|
---|
39 | BOOL vboxVbvaBufferBeginUpdate(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
|
---|
40 | void vboxVbvaBufferEndUpdate(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
|
---|
41 |
|
---|
42 | #define VBOXVBVA_OP(_op, _pdext, _psrc, _arg) \
|
---|
43 | do { \
|
---|
44 | if (vboxVbvaBufferBeginUpdate(_pdext, &(_psrc)->Vbva)) \
|
---|
45 | { \
|
---|
46 | vboxVbva##_op(_pdext, _psrc, _arg); \
|
---|
47 | vboxVbvaBufferEndUpdate(_pdext, &(_psrc)->Vbva); \
|
---|
48 | } \
|
---|
49 | } while (0)
|
---|
50 |
|
---|
51 | #define VBOXVBVA_OP_WITHLOCK_ATDPC(_op, _pdext, _psrc, _arg) \
|
---|
52 | do { \
|
---|
53 | Assert(KeGetCurrentIrql() == DISPATCH_LEVEL); \
|
---|
54 | KeAcquireSpinLockAtDpcLevel(&(_psrc)->Vbva.Lock); \
|
---|
55 | VBOXVBVA_OP(_op, _pdext, _psrc, _arg); \
|
---|
56 | KeReleaseSpinLockFromDpcLevel(&(_psrc)->Vbva.Lock);\
|
---|
57 | } while (0)
|
---|
58 |
|
---|
59 | #define VBOXVBVA_OP_WITHLOCK(_op, _pdext, _psrc, _arg) \
|
---|
60 | do { \
|
---|
61 | KIRQL OldIrql; \
|
---|
62 | KeAcquireSpinLock(&(_psrc)->Vbva.Lock, &OldIrql); \
|
---|
63 | VBOXVBVA_OP(_op, _pdext, _psrc, _arg); \
|
---|
64 | KeReleaseSpinLock(&(_psrc)->Vbva.Lock, OldIrql); \
|
---|
65 | } while (0)
|
---|
66 |
|
---|
67 |
|
---|
68 | #endif /* #ifndef ___VBoxMPVbva_h___ */
|
---|