VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.h

Last change on this file was 98103, checked in by vboxsync, 17 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1/* $Id: VBoxMPVbva.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox WDDM Miniport driver
4 */
5
6/*
7 * Copyright (C) 2011-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef GA_INCLUDED_SRC_WINNT_Graphics_Video_mp_wddm_VBoxMPVbva_h
29#define GA_INCLUDED_SRC_WINNT_Graphics_Video_mp_wddm_VBoxMPVbva_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include <VBox/cdefs.h> /* for VBOXCALL */
35
36typedef struct VBOXVBVAINFO
37{
38 VBVABUFFERCONTEXT Vbva;
39 D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId;
40 KSPIN_LOCK Lock;
41} VBOXVBVAINFO;
42
43int vboxVbvaEnable(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
44int vboxVbvaDisable(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
45int vboxVbvaDestroy(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
46int vboxVbvaCreate(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva, ULONG offBuffer, ULONG cbBuffer, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId);
47int vboxVbvaReportDirtyRect(PVBOXMP_DEVEXT pDevExt, struct VBOXWDDM_SOURCE *pSrc, RECT *pRectOrig);
48
49#define VBOXVBVA_OP(_op, _pdext, _psrc, _arg) \
50 do { \
51 if (VBoxVBVABufferBeginUpdate(&(_psrc)->Vbva.Vbva, &VBoxCommonFromDeviceExt(_pdext)->guestCtx)) \
52 { \
53 vboxVbva##_op(_pdext, _psrc, _arg); \
54 VBoxVBVABufferEndUpdate(&(_psrc)->Vbva.Vbva); \
55 } \
56 } while (0)
57
58#define VBOXVBVA_OP_WITHLOCK_ATDPC(_op, _pdext, _psrc, _arg) \
59 do { \
60 Assert(KeGetCurrentIrql() == DISPATCH_LEVEL); \
61 KeAcquireSpinLockAtDpcLevel(&(_psrc)->Vbva.Lock); \
62 VBOXVBVA_OP(_op, _pdext, _psrc, _arg); \
63 KeReleaseSpinLockFromDpcLevel(&(_psrc)->Vbva.Lock);\
64 } while (0)
65
66#define VBOXVBVA_OP_WITHLOCK(_op, _pdext, _psrc, _arg) \
67 do { \
68 KIRQL OldIrql; \
69 KeAcquireSpinLock(&(_psrc)->Vbva.Lock, &OldIrql); \
70 VBOXVBVA_OP(_op, _pdext, _psrc, _arg); \
71 KeReleaseSpinLock(&(_psrc)->Vbva.Lock, OldIrql); \
72 } while (0)
73
74#endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_mp_wddm_VBoxMPVbva_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use