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