VirtualBox

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

Last change on this file since 42092 was 37626, checked in by vboxsync, 13 years ago

wddm/3d: fix card resets

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
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
22typedef 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
33int vboxVbvaEnable(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
34int vboxVbvaDisable(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
35int vboxVbvaDestroy(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
36int vboxVbvaCreate(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva, ULONG offBuffer, ULONG cbBuffer, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId);
37int vboxVbvaReportCmdOffset(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva, uint32_t offCmd);
38int vboxVbvaReportDirtyRect(PVBOXMP_DEVEXT pDevExt, struct VBOXWDDM_SOURCE *pSrc, RECT *pRectOrig);
39BOOL vboxVbvaBufferBeginUpdate(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva);
40void 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___ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette