summaryrefslogtreecommitdiff
path: root/hw/xfree86/vbe/vbe.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/vbe/vbe.h')
-rw-r--r--hw/xfree86/vbe/vbe.h208
1 files changed, 112 insertions, 96 deletions
diff --git a/hw/xfree86/vbe/vbe.h b/hw/xfree86/vbe/vbe.h
index 072621fa6..81be0ff40 100644
--- a/hw/xfree86/vbe/vbe.h
+++ b/hw/xfree86/vbe/vbe.h
@@ -20,8 +20,7 @@ typedef enum {
DDC_1,
DDC_2,
DDC_1_2
-}
-ddc_lvl;
+} ddc_lvl;
typedef struct {
xf86Int10InfoPtr pInt10;
@@ -38,7 +37,8 @@ typedef struct {
#define VBE_VERSION_MINOR(x) (CARD8)(x)
extern _X_EXPORT vbeInfoPtr VBEInit(xf86Int10InfoPtr pInt, int entityIndex);
-extern _X_EXPORT vbeInfoPtr VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags);
+extern _X_EXPORT vbeInfoPtr VBEExtendedInit(xf86Int10InfoPtr pInt,
+ int entityIndex, int Flags);
extern _X_EXPORT void vbeFree(vbeInfoPtr pVbe);
extern _X_EXPORT xf86MonPtr vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule);
@@ -55,12 +55,12 @@ typedef struct vbeControllerInfoBlock {
CARD32 OemVendorNamePtr;
CARD32 OemProductNamePtr;
CARD32 OemProductRevPtr;
- CARD8 Scratch[222];
- CARD8 OemData[256];
+ CARD8 Scratch[222];
+ CARD8 OemData[256];
} vbeControllerInfoRec, *vbeControllerInfoPtr;
#if defined(__GNUC__) || defined(__USLC__) || defined(__SUNPRO_C)
-#pragma pack() /* All GCC versions recognise this syntax */
+#pragma pack() /* All GCC versions recognise this syntax */
#else
#pragma pack(0)
#endif
@@ -79,92 +79,97 @@ typedef struct _VbeCRTCInfoBlock VbeCRTCInfoBlock;
struct _VbeInfoBlock {
/* VESA 1.2 fields */
- CARD8 VESASignature[4]; /* VESA */
- CARD16 VESAVersion; /* Higher byte major, lower byte minor */
- /*CARD32*/char *OEMStringPtr; /* Pointer to OEM string */
- CARD8 Capabilities[4]; /* Capabilities of the video environment */
+ CARD8 VESASignature[4]; /* VESA */
+ CARD16 VESAVersion; /* Higher byte major, lower byte minor */
+ /*CARD32 */ char *OEMStringPtr;
+ /* Pointer to OEM string */
+ CARD8 Capabilities[4]; /* Capabilities of the video environment */
- /*CARD32*/CARD16 *VideoModePtr; /* pointer to supported Super VGA modes */
+ /*CARD32 */ CARD16 *VideoModePtr;
+ /* pointer to supported Super VGA modes */
- CARD16 TotalMemory; /* Number of 64kb memory blocks on board */
+ CARD16 TotalMemory; /* Number of 64kb memory blocks on board */
/* if not VESA 2, 236 scratch bytes follow (256 bytes total size) */
/* VESA 2 fields */
- CARD16 OemSoftwareRev; /* VBE implementation Software revision */
- /*CARD32*/char *OemVendorNamePtr; /* Pointer to Vendor Name String */
- /*CARD32*/char *OemProductNamePtr; /* Pointer to Product Name String */
- /*CARD32*/char *OemProductRevPtr; /* Pointer to Product Revision String */
- CARD8 Reserved[222]; /* Reserved for VBE implementation */
- CARD8 OemData[256]; /* Data Area for OEM Strings */
-} __attribute__((packed));
+ CARD16 OemSoftwareRev; /* VBE implementation Software revision */
+ /*CARD32 */ char *OemVendorNamePtr;
+ /* Pointer to Vendor Name String */
+ /*CARD32 */ char *OemProductNamePtr;
+ /* Pointer to Product Name String */
+ /*CARD32 */ char *OemProductRevPtr;
+ /* Pointer to Product Revision String */
+ CARD8 Reserved[222]; /* Reserved for VBE implementation */
+ CARD8 OemData[256]; /* Data Area for OEM Strings */
+} __attribute__ ((packed));
/* Return Super VGA Information */
extern _X_EXPORT VbeInfoBlock *VBEGetVBEInfo(vbeInfoPtr pVbe);
-extern _X_EXPORT void VBEFreeVBEInfo(VbeInfoBlock *block);
+extern _X_EXPORT void VBEFreeVBEInfo(VbeInfoBlock * block);
/*
* INT 1
*/
struct _VbeModeInfoBlock {
- CARD16 ModeAttributes; /* mode attributes */
- CARD8 WinAAttributes; /* window A attributes */
- CARD8 WinBAttributes; /* window B attributes */
- CARD16 WinGranularity; /* window granularity */
- CARD16 WinSize; /* window size */
- CARD16 WinASegment; /* window A start segment */
- CARD16 WinBSegment; /* window B start segment */
- CARD32 WinFuncPtr; /* real mode pointer to window function */
- CARD16 BytesPerScanline; /* bytes per scanline */
+ CARD16 ModeAttributes; /* mode attributes */
+ CARD8 WinAAttributes; /* window A attributes */
+ CARD8 WinBAttributes; /* window B attributes */
+ CARD16 WinGranularity; /* window granularity */
+ CARD16 WinSize; /* window size */
+ CARD16 WinASegment; /* window A start segment */
+ CARD16 WinBSegment; /* window B start segment */
+ CARD32 WinFuncPtr; /* real mode pointer to window function */
+ CARD16 BytesPerScanline; /* bytes per scanline */
/* Mandatory information for VBE 1.2 and above */
- CARD16 XResolution; /* horizontal resolution in pixels or characters */
- CARD16 YResolution; /* vertical resolution in pixels or characters */
- CARD8 XCharSize; /* character cell width in pixels */
- CARD8 YCharSize; /* character cell height in pixels */
- CARD8 NumberOfPlanes; /* number of memory planes */
- CARD8 BitsPerPixel; /* bits per pixel */
- CARD8 NumberOfBanks; /* number of banks */
- CARD8 MemoryModel; /* memory model type */
- CARD8 BankSize; /* bank size in KB */
- CARD8 NumberOfImages; /* number of images */
- CARD8 Reserved; /* 1 */ /* reserved for page function */
+ CARD16 XResolution; /* horizontal resolution in pixels or characters */
+ CARD16 YResolution; /* vertical resolution in pixels or characters */
+ CARD8 XCharSize; /* character cell width in pixels */
+ CARD8 YCharSize; /* character cell height in pixels */
+ CARD8 NumberOfPlanes; /* number of memory planes */
+ CARD8 BitsPerPixel; /* bits per pixel */
+ CARD8 NumberOfBanks; /* number of banks */
+ CARD8 MemoryModel; /* memory model type */
+ CARD8 BankSize; /* bank size in KB */
+ CARD8 NumberOfImages; /* number of images */
+ CARD8 Reserved; /* 1 *//* reserved for page function */
/* Direct color fields (required for direct/6 and YUV/7 memory models) */
- CARD8 RedMaskSize; /* size of direct color red mask in bits */
- CARD8 RedFieldPosition; /* bit position of lsb of red mask */
- CARD8 GreenMaskSize; /* size of direct color green mask in bits */
- CARD8 GreenFieldPosition; /* bit position of lsb of green mask */
- CARD8 BlueMaskSize; /* size of direct color blue mask in bits */
- CARD8 BlueFieldPosition; /* bit position of lsb of blue mask */
- CARD8 RsvdMaskSize; /* size of direct color reserved mask in bits */
- CARD8 RsvdFieldPosition; /* bit position of lsb of reserved mask */
- CARD8 DirectColorModeInfo; /* direct color mode attributes */
+ CARD8 RedMaskSize; /* size of direct color red mask in bits */
+ CARD8 RedFieldPosition; /* bit position of lsb of red mask */
+ CARD8 GreenMaskSize; /* size of direct color green mask in bits */
+ CARD8 GreenFieldPosition; /* bit position of lsb of green mask */
+ CARD8 BlueMaskSize; /* size of direct color blue mask in bits */
+ CARD8 BlueFieldPosition; /* bit position of lsb of blue mask */
+ CARD8 RsvdMaskSize; /* size of direct color reserved mask in bits */
+ CARD8 RsvdFieldPosition; /* bit position of lsb of reserved mask */
+ CARD8 DirectColorModeInfo; /* direct color mode attributes */
/* Mandatory information for VBE 2.0 and above */
- CARD32 PhysBasePtr; /* physical address for flat memory frame buffer */
- CARD32 Reserved32; /* 0 */ /* Reserved - always set to 0 */
- CARD16 Reserved16; /* 0 */ /* Reserved - always set to 0 */
+ CARD32 PhysBasePtr; /* physical address for flat memory frame buffer */
+ CARD32 Reserved32; /* 0 *//* Reserved - always set to 0 */
+ CARD16 Reserved16; /* 0 *//* Reserved - always set to 0 */
/* Mandatory information for VBE 3.0 and above */
- CARD16 LinBytesPerScanLine; /* bytes per scan line for linear modes */
- CARD8 BnkNumberOfImagePages; /* number of images for banked modes */
- CARD8 LinNumberOfImagePages; /* number of images for linear modes */
- CARD8 LinRedMaskSize; /* size of direct color red mask (linear modes) */
- CARD8 LinRedFieldPosition; /* bit position of lsb of red mask (linear modes) */
- CARD8 LinGreenMaskSize; /* size of direct color green mask (linear modes) */
- CARD8 LinGreenFieldPosition; /* bit position of lsb of green mask (linear modes) */
- CARD8 LinBlueMaskSize; /* size of direct color blue mask (linear modes) */
- CARD8 LinBlueFieldPosition; /* bit position of lsb of blue mask (linear modes) */
- CARD8 LinRsvdMaskSize; /* size of direct color reserved mask (linear modes) */
- CARD8 LinRsvdFieldPosition; /* bit position of lsb of reserved mask (linear modes) */
- CARD32 MaxPixelClock; /* maximum pixel clock (in Hz) for graphics mode */
- CARD8 Reserved2[189]; /* remainder of VbeModeInfoBlock */
-} __attribute__((packed));
+ CARD16 LinBytesPerScanLine; /* bytes per scan line for linear modes */
+ CARD8 BnkNumberOfImagePages; /* number of images for banked modes */
+ CARD8 LinNumberOfImagePages; /* number of images for linear modes */
+ CARD8 LinRedMaskSize; /* size of direct color red mask (linear modes) */
+ CARD8 LinRedFieldPosition; /* bit position of lsb of red mask (linear modes) */
+ CARD8 LinGreenMaskSize; /* size of direct color green mask (linear modes) */
+ CARD8 LinGreenFieldPosition; /* bit position of lsb of green mask (linear modes) */
+ CARD8 LinBlueMaskSize; /* size of direct color blue mask (linear modes) */
+ CARD8 LinBlueFieldPosition; /* bit position of lsb of blue mask (linear modes) */
+ CARD8 LinRsvdMaskSize; /* size of direct color reserved mask (linear modes) */
+ CARD8 LinRsvdFieldPosition; /* bit position of lsb of reserved mask (linear modes) */
+ CARD32 MaxPixelClock; /* maximum pixel clock (in Hz) for graphics mode */
+ CARD8 Reserved2[189]; /* remainder of VbeModeInfoBlock */
+} __attribute__ ((packed));
/* Return VBE Mode Information */
extern _X_EXPORT VbeModeInfoBlock *VBEGetModeInfo(vbeInfoPtr pVbe, int mode);
-extern _X_EXPORT void VBEFreeModeInfo(VbeModeInfoBlock *block);
+extern _X_EXPORT void VBEFreeModeInfo(VbeModeInfoBlock * block);
/*
* INT2
@@ -176,20 +181,22 @@ extern _X_EXPORT void VBEFreeModeInfo(VbeModeInfoBlock *block);
#define CRTC_NVSYNC (1<<3)
struct _VbeCRTCInfoBlock {
- CARD16 HorizontalTotal; /* Horizontal total in pixels */
- CARD16 HorizontalSyncStart; /* Horizontal sync start in pixels */
- CARD16 HorizontalSyncEnd; /* Horizontal sync end in pixels */
- CARD16 VerticalTotal; /* Vertical total in lines */
- CARD16 VerticalSyncStart; /* Vertical sync start in lines */
- CARD16 VerticalSyncEnd; /* Vertical sync end in lines */
- CARD8 Flags; /* Flags (Interlaced, Double Scan etc) */
- CARD32 PixelClock; /* Pixel clock in units of Hz */
- CARD16 RefreshRate; /* Refresh rate in units of 0.01 Hz */
- CARD8 Reserved[40]; /* remainder of ModeInfoBlock */
-} __attribute__((packed));
+ CARD16 HorizontalTotal; /* Horizontal total in pixels */
+ CARD16 HorizontalSyncStart; /* Horizontal sync start in pixels */
+ CARD16 HorizontalSyncEnd; /* Horizontal sync end in pixels */
+ CARD16 VerticalTotal; /* Vertical total in lines */
+ CARD16 VerticalSyncStart; /* Vertical sync start in lines */
+ CARD16 VerticalSyncEnd; /* Vertical sync end in lines */
+ CARD8 Flags; /* Flags (Interlaced, Double Scan etc) */
+ CARD32 PixelClock; /* Pixel clock in units of Hz */
+ CARD16 RefreshRate; /* Refresh rate in units of 0.01 Hz */
+ CARD8 Reserved[40]; /* remainder of ModeInfoBlock */
+} __attribute__ ((packed));
+
/* VbeCRTCInfoBlock is in the VESA 3.0 specs */
-extern _X_EXPORT Bool VBESetVBEMode(vbeInfoPtr pVbe, int mode, VbeCRTCInfoBlock *crtc);
+extern _X_EXPORT Bool VBESetVBEMode(vbeInfoPtr pVbe, int mode,
+ VbeCRTCInfoBlock * crtc);
/*
* INT 3
@@ -212,31 +219,32 @@ extern _X_EXPORT Bool VBEGetVBEMode(vbeInfoPtr pVbe, int *mode);
*/
typedef enum {
- MODE_QUERY,
- MODE_SAVE,
- MODE_RESTORE
+ MODE_QUERY,
+ MODE_SAVE,
+ MODE_RESTORE
} vbeSaveRestoreFunction;
extern _X_EXPORT Bool
-VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction fuction,
- pointer *memory, int *size, int *real_mode_pages);
+
+VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction fuction,
+ pointer *memory, int *size, int *real_mode_pages);
/*
* INT 5
*/
extern _X_EXPORT Bool
-VBEBankSwitch(vbeInfoPtr pVbe, unsigned int iBank, int window);
+ VBEBankSwitch(vbeInfoPtr pVbe, unsigned int iBank, int window);
/*
* INT 6
*/
typedef enum {
- SCANWID_SET,
- SCANWID_GET,
- SCANWID_SET_BYTES,
- SCANWID_GET_MAX
+ SCANWID_SET,
+ SCANWID_GET,
+ SCANWID_SET_BYTES,
+ SCANWID_GET_MAX
} vbeScanwidthCommand;
#define VBESetLogicalScanline(pVbe, width) \
@@ -252,15 +260,18 @@ typedef enum {
VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET_MAX, 0, \
pixels, bytes, max)
extern _X_EXPORT Bool VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe,
- vbeScanwidthCommand command, int width,
- int *pixels, int *bytes, int *max);
+ vbeScanwidthCommand
+ command, int width,
+ int *pixels, int *bytes,
+ int *max);
/*
* INT 7
*/
/* 16 bit code */
-extern _X_EXPORT Bool VBESetDisplayStart(vbeInfoPtr pVbe, int x, int y, Bool wait_retrace);
+extern _X_EXPORT Bool VBESetDisplayStart(vbeInfoPtr pVbe, int x, int y,
+ Bool wait_retrace);
extern _X_EXPORT Bool VBEGetDisplayStart(vbeInfoPtr pVbe, int *x, int *y);
/*
@@ -280,8 +291,10 @@ extern _X_EXPORT int VBESetGetDACPaletteFormat(vbeInfoPtr pVbe, int bits);
* If setting a palette, it will return the pointer received on success,
* NULL on failure.
*/
-extern _X_EXPORT CARD32 *VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num,
- CARD32 *data, Bool secondary, Bool wait_retrace);
+extern _X_EXPORT CARD32 *VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set,
+ int first, int num, CARD32 *data,
+ Bool secondary,
+ Bool wait_retrace);
#define VBEFreePaletteData(data) free(data)
/*
@@ -295,6 +308,7 @@ typedef struct _VBEpmi {
} VBEpmi;
extern _X_EXPORT VBEpmi *VBEGetVBEpmi(vbeInfoPtr pVbe);
+
#define VESAFreeVBEpmi(pmi) free(pmi)
/* high level helper functions */
@@ -316,8 +330,9 @@ typedef struct {
} vbeSaveRestoreRec, *vbeSaveRestorePtr;
extern _X_EXPORT void
+
VBEVesaSaveRestore(vbeInfoPtr pVbe, vbeSaveRestorePtr vbe_sr,
- vbeSaveRestoreFunction function);
+ vbeSaveRestoreFunction function);
extern _X_EXPORT int VBEGetPixelClock(vbeInfoPtr pVbe, int mode, int Clock);
extern _X_EXPORT Bool VBEDPMSSet(vbeInfoPtr pVbe, int mode);
@@ -335,7 +350,8 @@ struct vbePanelID {
char reserved[14];
};
-extern _X_EXPORT void VBEInterpretPanelID(int scrnIndex, struct vbePanelID *data);
+extern _X_EXPORT void VBEInterpretPanelID(int scrnIndex,
+ struct vbePanelID *data);
extern _X_EXPORT struct vbePanelID *VBEReadPanelID(vbeInfoPtr pVbe);
#endif