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