VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/xpdm/VBoxDisp.h@ 43467

Last change on this file since 43467 was 43467, checked in by vboxsync, 12 years ago

BUGZ:6084 Fixed typo.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.8 KB
Line 
1/* $Id: VBoxDisp.h 43467 2012-09-28 14:53:20Z vboxsync $ */
2
3/** @file
4 * VBox XPDM Display 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 VBOXDISP_H
20#define VBOXDISP_H
21
22#include "VBoxDispInternal.h"
23#include "VBoxDispVrdpBmp.h"
24
25/* VirtualBox display driver version, could be seen in Control Panel */
26#define VBOXDISPDRIVERVERSION 0x01UL
27
28#if (VBOXDISPDRIVERVERSION & (~0xFFUL))
29#error VBOXDISPDRIVERVERSION can't be more than 0xFF
30#endif
31
32#define VBOXDISP_DEVICE_NAME L"VBoxDisp"
33
34/* Current mode info */
35typedef struct _VBOXDISPCURRENTMODE
36{
37 ULONG ulIndex; /* miniport's video mode index */
38 ULONG ulWidth, ulHeight; /* visible screen width and height */
39 ULONG ulBitsPerPel; /* number of bits per pel */
40 LONG lScanlineStride; /* distance between scanlines */
41 FLONG flMaskR, flMaskG, flMaskB; /* RGB mask */
42 ULONG ulPaletteShift; /* number of bits we have to shift 888 palette to match device palette */
43} VBOXDISPCURRENTMODE, *PVBOXDISPCURRENTMODE;
44
45/* Pointer related info */
46typedef struct _VBOXDISPPOINTERINFO
47{
48 VIDEO_POINTER_CAPABILITIES caps; /* Pointer capabilities */
49 PVIDEO_POINTER_ATTRIBUTES pAttrs; /* Preallocated buffer to pass pointer shape to miniport driver */
50 DWORD cbAttrs; /* Size of pAttrs buffer */
51 POINTL orgHotSpot; /* Hot spot origin */
52} VBOXDISPPOINTERINFO, *PVBOXDISPPOINTERINFO;
53
54/* Surface info */
55typedef struct _VBOXDISPSURF
56{
57 HBITMAP hBitmap; /* GDI's handle to framebuffer bitmap */
58 SURFOBJ* psoBitmap; /* lock pointer to framebuffer bitmap */
59 HSURF hSurface; /* GDI's handle to framebuffer device-managed surface */
60 ULONG ulFormat; /* Bitmap format, one of BMF_XXBPP */
61} VBOXDISPSURF, *PVBOXDISPSURF;
62
63/* VRAM Layout */
64typedef struct _VBOXDISPVRAMLAYOUT
65{
66 ULONG cbVRAM;
67
68 ULONG offFramebuffer, cbFramebuffer;
69 ULONG offDDrawHeap, cbDDrawHeap;
70 ULONG offVBVABuffer, cbVBVABuffer;
71 ULONG offDisplayInfo, cbDisplayInfo;
72} VBOXDISPVRAMLAYOUT;
73
74/* HGSMI info */
75typedef struct _VBOXDISPHGSMIINFO
76{
77 BOOL bSupported; /* HGSMI is supported and enabled */
78
79 HGSMIQUERYCALLBACKS mp; /* HGSMI miniport's callbacks and context */
80 HGSMIGUESTCOMMANDCONTEXT ctx; /* HGSMI guest context */
81} VBOXDISPHGSMIINFO;
82
83/* Saved screen bits information. */
84typedef struct _SSB
85{
86 ULONG ident; /* 1 based index in the stack = the handle returned by VBoxDispDrvSaveScreenBits (SS_SAVE) */
87 BYTE *pBuffer; /* Buffer where screen bits are saved. */
88} SSB;
89
90#ifdef VBOX_WITH_DDRAW
91/* DirectDraw surface lock information */
92typedef struct _VBOXDDLOCKINFO
93{
94 BOOL bLocked;
95 RECTL rect;
96} VBOXDDLOCKINFO;
97#endif
98
99/* Structure holding driver private device info. */
100typedef struct _VBOXDISPDEV
101{
102 HANDLE hDriver; /* Display device handle which was passed to VBoxDispDrvEnablePDEV */
103 HDEV hDevGDI; /* GDI's handle for PDEV created in VBoxDispDrvEnablePDEV */
104
105 VBOXDISPCURRENTMODE mode; /* Current device mode */
106 ULONG iDevice; /* Miniport's device index */
107 POINTL orgDev; /* Device origin for DualView (0,0 is primary) */
108 POINTL orgDisp; /* Display origin in virtual desktop, NT4 only */
109
110 VBOXDISPPOINTERINFO pointer; /* Pointer info */
111
112 HPALETTE hDefaultPalette; /* Default palette handle */
113 PALETTEENTRY *pPalette; /* Palette entries for device managed palette */
114
115 VBOXDISPSURF surface; /* Device surface */
116 FLONG flDrawingHooks; /* Enabled drawing hooks */
117
118 VIDEO_MEMORY_INFORMATION memInfo; /* Mapped Framebuffer/vram info */
119 VBOXDISPVRAMLAYOUT layout; /* VRAM layout information */
120
121 VBOXDISPHGSMIINFO hgsmi; /* HGSMI Info */
122 HGSMIQUERYCPORTPROCS vpAPI; /* Video Port API callbacks and miniport's context */
123
124 VBVABUFFERCONTEXT vbvaCtx; /* VBVA context */
125 VRDPBC vrdpCache; /* VRDP bitmap cache */
126
127 ULONG cSSB; /* Number of active saved screen bits records in the following array. */
128 SSB aSSB[4]; /* LIFO type stack for saved screen areas. */
129
130#ifdef VBOX_WITH_DDRAW
131 VBOXDDLOCKINFO ddpsLock; /* Primary surface DirectDraw lock information */
132#endif
133
134#ifdef VBOX_WITH_VIDEOHWACCEL
135 VBOXDISPVHWAINFO vhwa; /* VHWA Info */
136#endif
137} VBOXDISPDEV, *PVBOXDISPDEV;
138
139/* -------------------- Driver callbacks -------------------- */
140RT_C_DECLS_BEGIN
141ULONG APIENTRY DriverEntry(IN PVOID Context1, IN PVOID Context2);
142RT_C_DECLS_END
143
144DHPDEV APIENTRY VBoxDispDrvEnablePDEV(DEVMODEW *pdm, LPWSTR pwszLogAddress,
145 ULONG cPat, HSURF *phsurfPatterns,
146 ULONG cjCaps, ULONG *pdevcaps,
147 ULONG cjDevInfo, DEVINFO *pdi,
148 HDEV hdev, PWSTR pwszDeviceName, HANDLE hDriver);
149VOID APIENTRY VBoxDispDrvCompletePDEV(DHPDEV dhpdev, HDEV hdev);
150VOID APIENTRY VBoxDispDrvDisablePDEV(DHPDEV dhpdev);
151HSURF APIENTRY VBoxDispDrvEnableSurface(DHPDEV dhpdev);
152VOID APIENTRY VBoxDispDrvDisableSurface(DHPDEV dhpdev);
153
154BOOL APIENTRY VBoxDispDrvLineTo(SURFOBJ *pso, CLIPOBJ *pco, BRUSHOBJ *pbo,
155 LONG x1, LONG y1, LONG x2, LONG y2, RECTL *prclBounds, MIX mix);
156BOOL APIENTRY VBoxDispDrvStrokePath(SURFOBJ *pso, PATHOBJ *ppo, CLIPOBJ *pco, XFORMOBJ *pxo,
157 BRUSHOBJ *pbo, POINTL *pptlBrushOrg, LINEATTRS *plineattrs, MIX mix);
158
159BOOL APIENTRY VBoxDispDrvFillPath(SURFOBJ *pso, PATHOBJ *ppo, CLIPOBJ *pco, BRUSHOBJ *pbo, POINTL *pptlBrushOrg,
160 MIX mix, FLONG flOptions);
161BOOL APIENTRY VBoxDispDrvPaint(SURFOBJ *pso, CLIPOBJ *pco, BRUSHOBJ *pbo, POINTL *pptlBrushOrg, MIX mix);
162
163BOOL APIENTRY VBoxDispDrvRealizeBrush(BRUSHOBJ *pbo, SURFOBJ *psoTarget, SURFOBJ *psoPattern, SURFOBJ *psoMask,
164 XLATEOBJ *pxlo, ULONG iHatch);
165ULONG APIENTRY VBoxDispDrvDitherColor(DHPDEV dhpdev, ULONG iMode, ULONG rgb, ULONG *pul);
166
167BOOL APIENTRY VBoxDispDrvBitBlt(SURFOBJ *psoTrg, SURFOBJ *psoSrc, SURFOBJ *psoMask, CLIPOBJ *pco, XLATEOBJ *pxlo,
168 RECTL *prclTrg, POINTL *pptlSrc, POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *pptlBrush,
169 ROP4 rop4);
170BOOL APIENTRY VBoxDispDrvStretchBlt(SURFOBJ *psoDest, SURFOBJ *psoSrc, SURFOBJ *psoMask, CLIPOBJ *pco, XLATEOBJ *pxlo,
171 COLORADJUSTMENT *pca, POINTL *pptlHTOrg, RECTL *prclDest, RECTL *prclSrc,
172 POINTL *pptlMask, ULONG iMode);
173BOOL APIENTRY VBoxDispDrvCopyBits(SURFOBJ *psoDest, SURFOBJ *psoSrc, CLIPOBJ *pco, XLATEOBJ *pxlo,
174 RECTL *prclDest, POINTL *pptlSrc);
175
176ULONG APIENTRY VBoxDispDrvSetPointerShape(SURFOBJ *pso, SURFOBJ *psoMask, SURFOBJ *psoColor, XLATEOBJ *pxlo,
177 LONG xHot, LONG yHot, LONG x, LONG y, RECTL *prcl, FLONG fl);
178VOID APIENTRY VBoxDispDrvMovePointer(SURFOBJ *pso, LONG x, LONG y, RECTL *prcl);
179
180BOOL APIENTRY VBoxDispDrvAssertMode(DHPDEV dhpdev, BOOL bEnable);
181VOID APIENTRY VBoxDispDrvDisableDriver();
182BOOL APIENTRY VBoxDispDrvTextOut(SURFOBJ *pso, STROBJ *pstro, FONTOBJ *pfo, CLIPOBJ *pco,
183 RECTL *prclExtra, RECTL *prclOpaque, BRUSHOBJ *pboFore,
184 BRUSHOBJ *pboOpaque, POINTL *pptlOrg, MIX mix);
185BOOL APIENTRY VBoxDispDrvSetPalette(DHPDEV dhpdev, PALOBJ *ppalo, FLONG fl, ULONG iStart, ULONG cColors);
186ULONG APIENTRY VBoxDispDrvEscape(SURFOBJ *pso, ULONG iEsc, ULONG cjIn, PVOID pvIn, ULONG cjOut, PVOID pvOut);
187ULONG_PTR APIENTRY VBoxDispDrvSaveScreenBits(SURFOBJ *pso, ULONG iMode, ULONG_PTR ident, RECTL *prcl);
188ULONG APIENTRY VBoxDispDrvGetModes(HANDLE hDriver, ULONG cjSize, DEVMODEW *pdm);
189BOOL APIENTRY VBoxDispDrvOffset(SURFOBJ* pso, LONG x, LONG y, FLONG flReserved);
190
191VOID APIENTRY VBoxDispDrvNotify(SURFOBJ *pso, ULONG iType, PVOID pvData);
192
193#ifdef VBOX_WITH_DDRAW
194BOOL APIENTRY VBoxDispDrvGetDirectDrawInfo(DHPDEV dhpdev, DD_HALINFO *pHalInfo, DWORD *pdwNumHeaps,
195 VIDEOMEMORY *pvmList, DWORD *pdwNumFourCCCodes, DWORD *pdwFourCC);
196BOOL APIENTRY VBoxDispDrvEnableDirectDraw(DHPDEV dhpdev, DD_CALLBACKS *pCallBacks,
197 DD_SURFACECALLBACKS *pSurfaceCallBacks,
198 DD_PALETTECALLBACKS *pPaletteCallBacks);
199VOID APIENTRY VBoxDispDrvDisableDirectDraw(DHPDEV dhpdev);
200HBITMAP APIENTRY VBoxDispDrvDeriveSurface(DD_DIRECTDRAW_GLOBAL *pDirectDraw, DD_SURFACE_LOCAL *pSurface);
201#endif /*#ifdef VBOX_WITH_DDRAW*/
202
203/* -------------------- Internal helpers -------------------- */
204DECLINLINE(SURFOBJ) *getSurfObj(SURFOBJ *pso)
205{
206 if (pso)
207 {
208 PVBOXDISPDEV pDev = (PVBOXDISPDEV)pso->dhpdev;
209
210 if (pDev && pDev->surface.psoBitmap && pso->hsurf == pDev->surface.hSurface)
211 {
212 /* Convert the device PSO to the bitmap PSO which can be passed to Eng*. */
213 pso = pDev->surface.psoBitmap;
214 }
215 }
216
217 return pso;
218}
219
220#endif /*VBOXDISP_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