1 | /* $Id: VBoxDispVHWA.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox XPDM Display driver, helper functions which interacts with our miniport driver
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011-2024 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_disp_xpdm_VBoxDispVHWA_h
|
---|
29 | #define GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_xpdm_VBoxDispVHWA_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include "VBoxDisp.h"
|
---|
35 |
|
---|
36 | #ifdef VBOX_WITH_VIDEOHWACCEL
|
---|
37 | typedef struct _VBOXDISPVHWAINFO
|
---|
38 | {
|
---|
39 | uint32_t caps;
|
---|
40 | uint32_t caps2;
|
---|
41 | uint32_t colorKeyCaps;
|
---|
42 | uint32_t stretchCaps;
|
---|
43 | uint32_t surfaceCaps;
|
---|
44 | uint32_t numOverlays;
|
---|
45 | uint32_t numFourCC;
|
---|
46 | HGSMIOFFSET FourCC;
|
---|
47 | ULONG_PTR offVramBase;
|
---|
48 | BOOLEAN bEnabled;
|
---|
49 | } VBOXDISPVHWAINFO;
|
---|
50 | #endif
|
---|
51 |
|
---|
52 | typedef struct _VBOXVHWAREGION
|
---|
53 | {
|
---|
54 | RECTL Rect;
|
---|
55 | bool bValid;
|
---|
56 | }VBOXVHWAREGION, *PVBOXVHWAREGION;
|
---|
57 |
|
---|
58 | typedef struct _VBOXVHWASURFDESC
|
---|
59 | {
|
---|
60 | VBOXVHWA_SURFHANDLE hHostHandle;
|
---|
61 | volatile uint32_t cPendingBltsSrc;
|
---|
62 | volatile uint32_t cPendingBltsDst;
|
---|
63 | volatile uint32_t cPendingFlipsCurr;
|
---|
64 | volatile uint32_t cPendingFlipsTarg;
|
---|
65 | #ifdef DEBUG
|
---|
66 | volatile uint32_t cFlipsCurr;
|
---|
67 | volatile uint32_t cFlipsTarg;
|
---|
68 | #endif
|
---|
69 | bool bVisible;
|
---|
70 | VBOXVHWAREGION UpdatedMemRegion;
|
---|
71 | VBOXVHWAREGION NonupdatedMemRegion;
|
---|
72 | }VBOXVHWASURFDESC, *PVBOXVHWASURFDESC;
|
---|
73 |
|
---|
74 | typedef DECLCALLBACKTYPE(void, FNVBOXVHWACMDCOMPLETION,(PVBOXDISPDEV pDev, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_HOST *pCmd,
|
---|
75 | void *pvContext));
|
---|
76 | typedef FNVBOXVHWACMDCOMPLETION *PFNVBOXVHWACMDCOMPLETION;
|
---|
77 |
|
---|
78 | void VBoxDispVHWAInit(PVBOXDISPDEV pDev);
|
---|
79 | int VBoxDispVHWAEnable(PVBOXDISPDEV pDev);
|
---|
80 | int VBoxDispVHWADisable(PVBOXDISPDEV pDev);
|
---|
81 | int VBoxDispVHWAInitHostInfo1(PVBOXDISPDEV pDev);
|
---|
82 | int VBoxDispVHWAInitHostInfo2(PVBOXDISPDEV pDev, DWORD *pFourCC);
|
---|
83 |
|
---|
84 | VBOXVHWACMD RT_UNTRUSTED_VOLATILE_HOST *VBoxDispVHWACommandCreate(PVBOXDISPDEV pDev, VBOXVHWACMD_TYPE enmCmd, VBOXVHWACMD_LENGTH cbCmd);
|
---|
85 | void VBoxDispVHWACommandRelease(PVBOXDISPDEV pDev, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_HOST *pCmd);
|
---|
86 | BOOL VBoxDispVHWACommandSubmit(PVBOXDISPDEV pDev, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_HOST*pCmd);
|
---|
87 | void VBoxDispVHWACommandSubmitAsynch(PVBOXDISPDEV pDev, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_HOST *pCmd,
|
---|
88 | PFNVBOXVHWACMDCOMPLETION pfnCompletion, void * pContext);
|
---|
89 | void VBoxDispVHWACommandSubmitAsynchAndComplete(PVBOXDISPDEV pDev, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_HOST *pCmd);
|
---|
90 | void VBoxDispVHWACommandCheckHostCmds(PVBOXDISPDEV pDev);
|
---|
91 |
|
---|
92 | PVBOXVHWASURFDESC VBoxDispVHWASurfDescAlloc();
|
---|
93 | void VBoxDispVHWASurfDescFree(PVBOXVHWASURFDESC pDesc);
|
---|
94 |
|
---|
95 | uint64_t VBoxDispVHWAVramOffsetFromPDEV(PVBOXDISPDEV pDev, ULONG_PTR offPdev);
|
---|
96 |
|
---|
97 | void VBoxDispVHWARectUnited(RECTL * pDst, RECTL * pRect1, RECTL * pRect2);
|
---|
98 | bool VBoxDispVHWARectIsEmpty(RECTL * pRect);
|
---|
99 | bool VBoxDispVHWARectIntersect(RECTL * pRect1, RECTL * pRect2);
|
---|
100 | bool VBoxDispVHWARectInclude(RECTL * pRect1, RECTL * pRect2);
|
---|
101 | bool VBoxDispVHWARegionIntersects(PVBOXVHWAREGION pReg, RECTL * pRect);
|
---|
102 | bool VBoxDispVHWARegionIncludes(PVBOXVHWAREGION pReg, RECTL * pRect);
|
---|
103 | bool VBoxDispVHWARegionIncluded(PVBOXVHWAREGION pReg, RECTL * pRect);
|
---|
104 | void VBoxDispVHWARegionSet(PVBOXVHWAREGION pReg, RECTL * pRect);
|
---|
105 | void VBoxDispVHWARegionAdd(PVBOXVHWAREGION pReg, RECTL * pRect);
|
---|
106 | void VBoxDispVHWARegionInit(PVBOXVHWAREGION pReg);
|
---|
107 | void VBoxDispVHWARegionClear(PVBOXVHWAREGION pReg);
|
---|
108 | bool VBoxDispVHWARegionValid(PVBOXVHWAREGION pReg);
|
---|
109 | void VBoxDispVHWARegionTrySubstitute(PVBOXVHWAREGION pReg, const RECTL *pRect);
|
---|
110 |
|
---|
111 | uint32_t VBoxDispVHWAFromDDCAPS(uint32_t caps);
|
---|
112 | uint32_t VBoxDispVHWAToDDCAPS(uint32_t caps);
|
---|
113 | uint32_t VBoxDispVHWAFromDDSCAPS(uint32_t caps);
|
---|
114 | uint32_t VBoxDispVHWAToDDSCAPS(uint32_t caps);
|
---|
115 | uint32_t VBoxDispVHWAFromDDPFS(uint32_t caps);
|
---|
116 | uint32_t VBoxDispVHWAToDDPFS(uint32_t caps);
|
---|
117 | uint32_t VBoxDispVHWAFromDDCKEYCAPS(uint32_t caps);
|
---|
118 | uint32_t VBoxDispVHWAToDDCKEYCAPS(uint32_t caps);
|
---|
119 | uint32_t VBoxDispVHWAToDDBLTs(uint32_t caps);
|
---|
120 | uint32_t VBoxDispVHWAFromDDBLTs(uint32_t caps);
|
---|
121 | uint32_t VBoxDispVHWAFromDDCAPS2(uint32_t caps);
|
---|
122 | uint32_t VBoxDispVHWAToDDCAPS2(uint32_t caps);
|
---|
123 | uint32_t VBoxDispVHWAFromDDOVERs(uint32_t caps);
|
---|
124 | uint32_t VBoxDispVHWAToDDOVERs(uint32_t caps);
|
---|
125 | uint32_t VBoxDispVHWAFromDDCKEYs(uint32_t caps);
|
---|
126 | uint32_t VBoxDispVHWAToDDCKEYs(uint32_t caps);
|
---|
127 |
|
---|
128 | int VBoxDispVHWAFromDDSURFACEDESC(VBOXVHWA_SURFACEDESC RT_UNTRUSTED_VOLATILE_HOST *pVHWADesc, DDSURFACEDESC *pDdDesc);
|
---|
129 | int VBoxDispVHWAFromDDPIXELFORMAT(VBOXVHWA_PIXELFORMAT RT_UNTRUSTED_VOLATILE_HOST *pVHWAFormat, DDPIXELFORMAT *pDdFormat);
|
---|
130 | void VBoxDispVHWAFromDDOVERLAYFX(VBOXVHWA_OVERLAYFX RT_UNTRUSTED_VOLATILE_HOST *pVHWAOverlay, DDOVERLAYFX *pDdOverlay);
|
---|
131 | void VBoxDispVHWAFromDDCOLORKEY(VBOXVHWA_COLORKEY RT_UNTRUSTED_VOLATILE_HOST *pVHWACKey, DDCOLORKEY *pDdCKey);
|
---|
132 | void VBoxDispVHWAFromDDBLTFX(VBOXVHWA_BLTFX RT_UNTRUSTED_VOLATILE_HOST *pVHWABlt, DDBLTFX *pDdBlt);
|
---|
133 | void VBoxDispVHWAFromRECTL(VBOXVHWA_RECTL *pDst, RECTL const *pSrc);
|
---|
134 | void VBoxDispVHWAFromRECTL(VBOXVHWA_RECTL RT_UNTRUSTED_VOLATILE_HOST *pDst, RECTL const *pSrc);
|
---|
135 |
|
---|
136 | uint32_t VBoxDispVHWAUnsupportedDDCAPS(uint32_t caps);
|
---|
137 | uint32_t VBoxDispVHWAUnsupportedDDSCAPS(uint32_t caps);
|
---|
138 | uint32_t VBoxDispVHWAUnsupportedDDPFS(uint32_t caps);
|
---|
139 | uint32_t VBoxDispVHWAUnsupportedDDCEYCAPS(uint32_t caps);
|
---|
140 | uint32_t VBoxDispVHWASupportedDDCAPS(uint32_t caps);
|
---|
141 | uint32_t VBoxDispVHWASupportedDDSCAPS(uint32_t caps);
|
---|
142 | uint32_t VBoxDispVHWASupportedDDPFS(uint32_t caps);
|
---|
143 | uint32_t VBoxDispVHWASupportedDDCEYCAPS(uint32_t caps);
|
---|
144 |
|
---|
145 | #endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_xpdm_VBoxDispVHWA_h */
|
---|
146 |
|
---|