ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

driver.h
Go to the documentation of this file.
00001 /*
00002  * PROJECT:         ReactOS Framebuffer Display Driver
00003  * LICENSE:         Microsoft NT4 DDK Sample Code License
00004  * FILE:            boot/drivers/video/displays/framebuf/driver.h
00005  * PURPOSE:         Main Driver Header File
00006  * PROGRAMMERS:     Copyright (c) 1992-1995 Microsoft Corporation
00007  *                  ReactOS Portable Systems Group
00008  */
00009  
00010 //#define DBG 1
00011 #include "stddef.h"
00012 #include <stdarg.h>
00013 #include "windef.h"
00014 #include "wingdi.h"
00015 #include "winddi.h"
00016 #include "devioctl.h"
00017 #include "ntddvdeo.h"
00018 #include "debug.h"
00019 
00020 typedef struct  _PDEV
00021 {
00022     HANDLE  hDriver;                    // Handle to \Device\Screen
00023     HDEV    hdevEng;                    // Engine's handle to PDEV
00024     HSURF   hsurfEng;                   // Engine's handle to surface
00025     HPALETTE hpalDefault;               // Handle to the default palette for device.
00026     PBYTE   pjScreen;                   // This is pointer to base screen address
00027     ULONG   cxScreen;                   // Visible screen width
00028     ULONG   cyScreen;                   // Visible screen height
00029     ULONG   ulMode;                     // Mode the mini-port driver is in.
00030     LONG    lDeltaScreen;               // Distance from one scan to the next.
00031     ULONG   cScreenSize;                // size of video memory, including
00032                                         // offscreen memory.
00033     PVOID   pOffscreenList;             // linked list of DCI offscreen surfaces.
00034     FLONG   flRed;                      // For bitfields device, Red Mask
00035     FLONG   flGreen;                    // For bitfields device, Green Mask
00036     FLONG   flBlue;                     // For bitfields device, Blue Mask
00037     ULONG   cPaletteShift;              // number of bits the 8-8-8 palette must
00038                                         // be shifted by to fit in the hardware
00039                                         // palette.
00040     ULONG   ulBitCount;                 // # of bits per pel 8,16,24,32 are only supported.
00041     POINTL  ptlHotSpot;                 // adjustment for pointer hot spot
00042     VIDEO_POINTER_CAPABILITIES PointerCapabilities; // HW pointer abilities
00043     PVIDEO_POINTER_ATTRIBUTES pPointerAttributes; // hardware pointer attributes
00044     DWORD   cjPointerAttributes;        // Size of buffer allocated
00045     BOOL    fHwCursorActive;            // Are we currently using the hw cursor
00046     PALETTEENTRY *pPal;                 // If this is pal managed, this is the pal
00047     BOOL    bSupportDCI;                // Does the miniport support DCI?
00048 // eVb: 3.1 [DDK Change] - Support new VGA Miniport behavior w.r.t updated framebuffer remapping
00049     LONG flHooks;
00050 // eVb: 3.1 [END]
00051 // eVb: 3.1 [VGARISC Change] - Add new fields for VGA support
00052     SURFOBJ* pso;
00053     UCHAR* pjBase;
00054 // eVb: 3.1 [END]
00055 } PDEV, *PPDEV;
00056 
00057 DWORD getAvailableModes(HANDLE, PVIDEO_MODE_INFORMATION *, DWORD *);
00058 BOOL bInitPDEV(PPDEV, PDEVMODEW, GDIINFO *, DEVINFO *);
00059 BOOL bInitSURF(PPDEV, BOOL);
00060 BOOL bInitPaletteInfo(PPDEV, DEVINFO *);
00061 BOOL bInitPointer(PPDEV, DEVINFO *);
00062 BOOL bInit256ColorPalette(PPDEV);
00063 VOID vDisablePalette(PPDEV);
00064 VOID vDisableSURF(PPDEV);
00065 
00066 #define MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256))
00067 
00068 //
00069 // Determines the size of the DriverExtra information in the DEVMODE
00070 // structure passed to and from the display driver.
00071 //
00072 
00073 #define DRIVER_EXTRA_SIZE 0
00074 
00075 // eVb: 3.2 [VGARISC Change] - Transform into VGA driver
00076 #define DLL_NAME                L"vga"   // Name of the DLL in UNICODE
00077 #define STANDARD_DEBUG_PREFIX   "Vga risc: "  // All debug output is prefixed
00078 #define ALLOC_TAG               'rgvD'        // Four byte tag (characters in
00079                                               // reverse order) used for memory
00080                                               // allocations
00081 // eVb: 3.2 [END]
00082 
00083 // eVb: 3.3 [VGARISC Change] - Add new macros for VGA usage
00084 //
00085 // Each pixel in 4BPP being a nibble, the color data for that pixel is thus
00086 // located at the xth bit within the nibble, where x is the plane number [0-3].
00087 // Each nibble being 4 bytes, the color data is thus at the (nibble * 4 + x).
00088 // That color data is then taken from its linear position and shifted to the
00089 // correct position within the 16-bit planar buffer word.
00090 //
00091 #define VAL(data, px, pl, pos)   ((data) >> (((px) * 4) + (pl)) & 1) << (pos)
00092 
00093 //
00094 // This figures out which pixel in the planar word data corresponds to which pixel
00095 // in the 4BPP linear data.
00096 //
00097 #define SET_PLANE_DATA(x, y, a, b)  \
00098     (x) |= VAL(y, (((-1 + ((((b) % 8) % 2) << 1) - (((b) % 8) + 1) + 8))), a, b)
00099 
00100 /* Alignment Macros */
00101 #define ALIGN_DOWN_BY(size, align) \
00102     ((ULONG_PTR)(size) & ~((ULONG_PTR)(align) - 1))
00103 
00104 #define ALIGN_UP_BY(size, align) \
00105     (ALIGN_DOWN_BY(((ULONG_PTR)(size) + align - 1), align))
00106 // eVb: 3.3 [END]

Generated on Sun May 27 2012 04:38:08 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.