ReactOS  0.4.15-dev-3294-ge98684e
driver.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Framebuffer Display Driver
3  * LICENSE: Microsoft NT4 DDK Sample Code License
4  * FILE: win32ss/drivers/displays/vga_new/driver.h
5  * PURPOSE: Main Driver Header File
6  * PROGRAMMERS: Copyright (c) 1992-1995 Microsoft Corporation
7  * ReactOS Portable Systems Group
8  */
9 
10 //#define DBG 1
11 #include "stddef.h"
12 #include <stdarg.h>
13 #include "windef.h"
14 #include "wingdi.h"
15 #include "winddi.h"
16 #include "devioctl.h"
17 #include "ntddvdeo.h"
18 #include "debug.h"
19 
20 typedef struct _PDEV
21 {
22  HANDLE hDriver; // Handle to \Device\Screen
23  HDEV hdevEng; // Engine's handle to PDEV
24  HSURF hsurfEng; // Engine's handle to surface
25  HPALETTE hpalDefault; // Handle to the default palette for device.
26  PBYTE pjScreen; // This is pointer to base screen address
27  ULONG cxScreen; // Visible screen width
28  ULONG cyScreen; // Visible screen height
29  ULONG ulMode; // Mode the mini-port driver is in.
30  LONG lDeltaScreen; // Distance from one scan to the next.
31  ULONG cScreenSize; // size of video memory, including
32  // offscreen memory.
33  PVOID pOffscreenList; // linked list of DCI offscreen surfaces.
34  FLONG flRed; // For bitfields device, Red Mask
35  FLONG flGreen; // For bitfields device, Green Mask
36  FLONG flBlue; // For bitfields device, Blue Mask
37  ULONG cPaletteShift; // number of bits the 8-8-8 palette must
38  // be shifted by to fit in the hardware
39  // palette.
40  ULONG ulBitCount; // # of bits per pel 8,16,24,32 are only supported.
41  POINTL ptlHotSpot; // adjustment for pointer hot spot
42  VIDEO_POINTER_CAPABILITIES PointerCapabilities; // HW pointer abilities
43  PVIDEO_POINTER_ATTRIBUTES pPointerAttributes; // hardware pointer attributes
44  DWORD cjPointerAttributes; // Size of buffer allocated
45  BOOL fHwCursorActive; // Are we currently using the hw cursor
46  PALETTEENTRY *pPal; // If this is pal managed, this is the pal
47  BOOL bSupportDCI; // Does the miniport support DCI?
48 // eVb: 3.1 [DDK Change] - Support new VGA Miniport behavior w.r.t updated framebuffer remapping
49  LONG flHooks;
50 // eVb: 3.1 [END]
51 // eVb: 3.1 [VGARISC Change] - Add new fields for VGA support
54 // eVb: 3.1 [END]
55 } PDEV, *PPDEV;
56 
65 
66 #define MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256))
67 
68 //
69 // Determines the size of the DriverExtra information in the DEVMODE
70 // structure passed to and from the display driver.
71 //
72 
73 #define DRIVER_EXTRA_SIZE 0
74 
75 // eVb: 3.2 [VGARISC Change] - Transform into VGA driver
76 #define DLL_NAME L"vga" // Name of the DLL in UNICODE
77 #define STANDARD_DEBUG_PREFIX "Vga risc: " // All debug output is prefixed
78 #define ALLOC_TAG 'rgvD' // Four byte tag (characters in
79  // reverse order) used for memory
80  // allocations
81 // eVb: 3.2 [END]
82 
83 // eVb: 3.3 [VGARISC Change] - Add new macros for VGA usage
84 //
85 // Each pixel in 4BPP being a nibble, the color data for that pixel is thus
86 // located at the xth bit within the nibble, where x is the plane number [0-3].
87 // Each nibble being 4 bytes, the color data is thus at the (nibble * 4 + x).
88 // That color data is then taken from its linear position and shifted to the
89 // correct position within the 16-bit planar buffer word.
90 //
91 #define VAL(data, px, pl, pos) ((data) >> (((px) * 4) + (pl)) & 1) << (pos)
92 
93 //
94 // This figures out which pixel in the planar word data corresponds to which pixel
95 // in the 4BPP linear data.
96 //
97 #define SET_PLANE_DATA(x, y, a, b) \
98  (x) |= VAL(y, (((-1 + ((((b) % 8) % 2) << 1) - (((b) % 8) + 1) + 8))), a, b)
99 
100 /* Alignment Macros */
101 #define ALIGN_DOWN_BY(size, align) \
102  ((ULONG_PTR)(size) & ~((ULONG_PTR)(align) - 1))
103 
104 #define ALIGN_UP_BY(size, align) \
105  (ALIGN_DOWN_BY(((ULONG_PTR)(size) + align - 1), align))
106 // eVb: 3.3 [END]
VIDEO_POINTER_CAPABILITIES PointerCapabilities
Definition: driver.h:44
HSURF hsurfEng
Definition: driver.h:26
ULONG ulMode
Definition: driver.h:31
VOID NTAPI vDisablePalette(PPDEV)
Definition: palette.c:65
HPALETTE hpalDefault
Definition: driver.h:27
struct _PDEV * PPDEV
PALETTEENTRY * pPal
Definition: driver.h:48
FLONG flGreen
Definition: driver.h:37
ULONG cyScreen
Definition: driver.h:30
POINTL ptlHotSpot
Definition: driver.h:43
struct _PDEV PDEV
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
HANDLE hDriver
Definition: framebuf.h:35
DWORD cjPointerAttributes
Definition: driver.h:46
BOOL NTAPI bInitPaletteInfo(PPDEV, DEVINFO *)
Definition: palette.c:50
unsigned long FLONG
Definition: ntbasedef.h:366
ULONG cScreenSize
Definition: driver.h:33
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
SURFOBJ * pso
Definition: driver.h:52
FLONG flRed
Definition: driver.h:36
HDEV hdevEng
Definition: driver.h:25
ULONG ulBitCount
Definition: driver.h:42
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG flHooks
Definition: driver.h:51
VOID NTAPI vDisableSURF(PPDEV)
Definition: screen.c:172
Definition: framebuf.h:33
unsigned char UCHAR
Definition: xmlstorage.h:181
DWORD NTAPI getAvailableModes(HANDLE, PVIDEO_MODE_INFORMATION *, DWORD *)
Definition: screen.c:507
ULONG cPaletteShift
Definition: driver.h:39
PVIDEO_POINTER_ATTRIBUTES pPointerAttributes
Definition: driver.h:45
PBYTE pjScreen
Definition: driver.h:28
BOOL NTAPI bInit256ColorPalette(PPDEV)
Definition: palette.c:193
UCHAR * pjBase
Definition: driver.h:53
unsigned int ULONG
Definition: retypes.h:1
BOOL NTAPI bInitPointer(PPDEV, DEVINFO *)
Definition: pointer.c:400
BOOL NTAPI bInitSURF(PPDEV, BOOL)
Definition: screen.c:43
BOOL NTAPI bInitPDEV(PPDEV, PDEVMODEW, GDIINFO *, DEVINFO *)
BOOL bSupportDCI
Definition: driver.h:49
BOOL fHwCursorActive
Definition: driver.h:47
LONG lDeltaScreen
Definition: driver.h:32
FLONG flBlue
Definition: driver.h:38
BYTE * PBYTE
Definition: pedump.c:66
ULONG cxScreen
Definition: driver.h:29
PVOID pOffscreenList
Definition: driver.h:35