ReactOS 0.4.15-dev-8222-g9164419
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
20typedef 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
50// eVb: 3.1 [END]
51// eVb: 3.1 [VGARISC Change] - Add new fields for VGA support
54// eVb: 3.1 [END]
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]
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned long FLONG
Definition: ntbasedef.h:366
BYTE * PBYTE
Definition: pedump.c:66
long LONG
Definition: pedump.c:60
Definition: framebuf.h:34
VIDEO_POINTER_CAPABILITIES PointerCapabilities
Definition: vgaddi.h:129
ULONG cPaletteShift
Definition: driver.h:37
LONG flHooks
Definition: driver.h:49
SURFOBJ * pso
Definition: driver.h:52
DWORD cjPointerAttributes
Definition: driver.h:44
HSURF hsurfEng
Definition: driver.h:24
PBYTE pjScreen
Definition: driver.h:26
FLONG flRed
Definition: driver.h:34
PVIDEO_POINTER_ATTRIBUTES pPointerAttributes
Definition: vgaddi.h:117
ULONG cScreenSize
Definition: driver.h:31
HDEV hdevEng
Definition: driver.h:23
ULONG ulBitCount
Definition: driver.h:40
FLONG flGreen
Definition: driver.h:35
BOOL fHwCursorActive
Definition: driver.h:45
PALETTEENTRY * pPal
Definition: driver.h:46
HANDLE hDriver
Definition: framebuf.h:35
UCHAR * pjBase
Definition: driver.h:53
LONG lDeltaScreen
Definition: driver.h:30
FLONG flBlue
Definition: driver.h:36
HPALETTE hpalDefault
Definition: driver.h:25
BOOL bSupportDCI
Definition: driver.h:47
POINTL ptlHotSpot
Definition: driver.h:41
PVOID pOffscreenList
Definition: driver.h:33
ULONG ulMode
Definition: driver.h:29
ULONG cyScreen
Definition: driver.h:28
ULONG cxScreen
Definition: driver.h:27
uint32_t ULONG
Definition: typedefs.h:59
struct _PDEV PDEV
BOOL bInitPointer(PPDEV, DEVINFO *)
BOOL bInitSURF(PPDEV, BOOL)
Definition: screen.c:168
BOOL bInitPDEV(PPDEV, PDEVMODEW, GDIINFO *, DEVINFO *)
VOID vDisablePalette(PPDEV)
Definition: palette.c:82
DWORD getAvailableModes(HANDLE, PVIDEO_MODE_INFORMATION *, DWORD *)
Definition: screen.c:651
struct _PDEV * PPDEV
BOOL bInitPaletteInfo(PPDEV, DEVINFO *)
Definition: palette.c:67
VOID vDisableSURF(PPDEV)
Definition: screen.c:297
BOOL bInit256ColorPalette(PPDEV)
Definition: palette.c:226
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
unsigned char UCHAR
Definition: xmlstorage.h:181