|
version 1.1, 1997/07/15 06:57:55
|
version 1.1.2.20, 1997/07/22 14:55:43
|
|
|
|
| |
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.1.2.19 1997/07/22 13:50:52 dawes Exp $ */ |
| |
|
| |
/* |
| |
* Copyright (c) 1997 by The XFree86 Project, Inc. |
| |
*/ |
| |
|
| |
/* |
| |
* This file contains definitions of the public XFree86 data structures/types. |
| |
* Any data structures that video drivers need to access should go here. |
| |
*/ |
| |
|
| |
#ifndef _XF86STR_H |
| |
#define _XF86STR_H |
| |
|
| |
#include "misc.h" |
| |
#include "input.h" |
| |
#include "scrnintstr.h" |
| |
#include "xf86Option.h" |
| |
#include "xf86Module.h" |
| |
|
| |
|
| |
/* Video mode flags */ |
| |
|
| |
typedef enum { |
| |
V_PHSYNC = 0x0001, |
| |
V_NHSYNC = 0x0002, |
| |
V_PVSYNC = 0x0004, |
| |
V_NVSYNC = 0x0008, |
| |
V_INTERLACE = 0x0010, |
| |
V_DBLSCAN = 0x0020, |
| |
V_CSYNC = 0x0040, |
| |
V_PCSYNC = 0x0080, |
| |
V_NCSYNC = 0x0100, |
| |
V_HSKEW = 0x0200, /* hskew provided */ |
| |
V_PIXMUX = 0x1000, |
| |
V_DBLCLK = 0x2000, |
| |
V_CLKDIV2 = 0x4000 |
| |
} ModeFlags; |
| |
|
| |
/* These are possible return values for xf86CheckMode() and ValidMode() */ |
| |
typedef enum { |
| |
MODE_OK = 0, /* Mode OK */ |
| |
MODE_HSYNC, /* hsync out of range */ |
| |
MODE_VSYNC, /* vsync out of range */ |
| |
MODE_H_ILLEGAL, /* mode has illegal horizontal timings */ |
| |
MODE_V_ILLEGAL, /* mode has illegal horizontal timings */ |
| |
MODE_BAD_WIDTH, /* requires an unsupported linepitch */ |
| |
MODE_NOMODE, /* no mode with a maching name */ |
| |
MODE_NO_INTERLACE, /* interlaced mode not supported */ |
| |
MODE_NO_DBLESCAN, /* doublescan mode not supported */ |
| |
MODE_MEM, /* insufficient video memory */ |
| |
MODE_VIRTUAL_X, /* mode width too large for specified virtual size */ |
| |
MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */ |
| |
MODE_MEM_VIRT, /* insufficient video memory given virtual size */ |
| |
MODE_NOCLOCK, /* no fixed clock available */ |
| |
MODE_CLOCK_HIGH, /* clock required is too high */ |
| |
MODE_CLOCK_LOW, /* clock required is too low */ |
| |
MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */ |
| |
MODE_BAD_HVALUE, /* horizontal timing was out of range */ |
| |
MODE_BAD_VVALUE, /* vertical timing was out of range */ |
| |
MODE_BAD, /* unspecified reason */ |
| |
MODE_ERROR = -1 /* error condition */ |
| |
} ModeStatus; |
| |
|
| |
/* Video mode */ |
| |
|
| |
typedef struct _DisplayModeRec { |
| |
struct _DisplayModeRec * prev; |
| |
struct _DisplayModeRec * next; |
| |
char * name; /* identifier for the mode */ |
| |
ModeStatus status; |
| |
|
| |
/* These are the values that the user sees/provides */ |
| |
int Clock; /* pixel clock freq */ |
| |
int HDisplay; /* horizontal timing */ |
| |
int HSyncStart; |
| |
int HSyncEnd; |
| |
int HTotal; |
| |
int HSkew; |
| |
int VDisplay; /* vertical timing */ |
| |
int VSyncStart; |
| |
int VSyncEnd; |
| |
int VTotal; |
| |
int Flags; |
| |
|
| |
/* These are the values the hardware uses */ |
| |
int ClockIndex; |
| |
int SynthClock; /* Actual clock freq to |
| |
* be programmed */ |
| |
int CrtcHDisplay; |
| |
int CrtcHSyncStart; |
| |
int CrtcHSyncEnd; |
| |
int CrtcHTotal; |
| |
int CrtcHSkew; |
| |
int CrtcVDisplay; |
| |
int CrtcVSyncStart; |
| |
int CrtcVSyncEnd; |
| |
int CrtcVTotal; |
| |
Bool CrtcHAdjusted; |
| |
Bool CrtcVAdjusted; |
| |
int PrivSize; |
| |
INT32 * Private; |
| |
} DisplayModeRec, *DisplayModePtr; |
| |
|
| |
/* The monitor description */ |
| |
|
| |
#define MAX_HSYNC 8 |
| |
#define MAX_VREFRESH 8 |
| |
|
| |
typedef struct { float hi, lo; } range; |
| |
|
| |
typedef struct { int red, green, blue; } rgb; |
| |
|
| |
typedef struct { |
| |
char * id; |
| |
char * vendor; |
| |
char * model; |
| |
float EMPTY; |
| |
int nHsync; |
| |
range hsync[MAX_HSYNC]; |
| |
int nVrefresh; |
| |
range vrefresh[MAX_VREFRESH]; |
| |
DisplayModePtr Modes; /* Start of the monitor's mode list */ |
| |
DisplayModePtr Last; /* End of the monitor's mode list */ |
| |
} MonRec, *MonPtr; |
| |
|
| |
/* the list of clock ranges */ |
| |
typedef struct x_ClockRange { |
| |
struct x_ClockRange *next; |
| |
int minClock; |
| |
int maxClock; |
| |
int clockIndex; /* -1 for programmable clocks */ |
| |
Bool interlaceAllowed; |
| |
Bool doubleScanAllowed; |
| |
} ClockRange, *ClockRangePtr; |
| |
|
| |
/* Public bus-related types */ |
| |
|
| |
/* A crude attempt to characterise ISA/VLB types */ |
| |
typedef enum { |
| |
ISA_COLOR, |
| |
ISA_MONO, |
| |
ISA_OTHER |
| |
} IsaBusType; |
| |
|
| |
/* Differnet PCI video cards */ |
| |
typedef enum { |
| |
PCI_ONLY, |
| |
PCI_VGA, |
| |
PCI_SHARED_VGA |
| |
} PciBusType; |
| |
|
| |
|
| |
#define MAXCLOCKS 128 |
| |
#define MAXDACSPEEDS 4 /* for <= 8, 16, 24, 32bpp */ |
| |
|
| |
typedef struct { |
| |
char *identifier; |
| |
char *vendor; |
| |
char *board; |
| |
char *chipset; |
| |
char *ramdac; |
| |
int dacSpeeds[MAXDACSPEEDS]; |
| |
int clocks; |
| |
int clock[MAXCLOCKS]; |
| |
char *clockchip; |
| |
OFlagSet options; |
| |
OFlagSet clockOptions; |
| |
OFlagSet xconfigFlag; |
| |
int videoRam; |
| |
unsigned long speedup; |
| |
char *clockprog; |
| |
int textClockValue; |
| |
int BIOSbase; /* Base address of video BIOS */ |
| |
unsigned long MemBase; /* Frame buffer base address */ |
| |
unsigned int IObase; |
| |
unsigned int DACbase; |
| |
unsigned long COPbase; |
| |
unsigned int POSbase; |
| |
int instance; |
| |
int s3Madjust; |
| |
int s3Nadjust; |
| |
int s3MClk; |
| |
int chipID; |
| |
int chipRev; |
| |
unsigned long VGAbase; /* VGA ot XGA 64K aperature base address */ |
| |
int s3RefClk; |
| |
int s3BlankDelay; |
| |
char *DCConfig; |
| |
char *DCOptions; |
| |
int MemClk; /* General flag used for memory clocking */ |
| |
} GDevRec, *GDevPtr; |
| |
|
| |
typedef struct { |
| |
int vendor; |
| |
int chipType; |
| |
int chipRev; |
| |
int bus; |
| |
int device; |
| |
int func; |
| |
unsigned long memBase[6]; |
| |
unsigned long ioBase[6]; |
| |
unsigned long biosBase; |
| |
pointer thisCard; |
| |
} pciVideoRec, *pciVideoPtr; |
| |
|
| |
typedef struct { |
| |
int frameX0; |
| |
int frameY0; |
| |
int virtualX; |
| |
int virtualY; |
| |
int depth; |
| |
char ** modes; |
| |
} DispRec, *DispPtr; |
| |
|
| |
typedef struct { |
| |
int colordepth; |
| |
MonPtr monitor; |
| |
GDevPtr device; |
| |
DispPtr displays; |
| |
} confScreenRec, *confScreenPtr; |
| |
|
| |
typedef struct { |
| |
confScreenPtr screen; |
| |
confScreenPtr top; |
| |
confScreenPtr bottom; |
| |
confScreenPtr left; |
| |
confScreenPtr right; |
| |
} screenLayoutRec, *screenLayoutPtr; |
| |
|
| |
/* These values should be adjusted when new fields are added to ScrnInfoRec */ |
| |
#define NUM_RESERVED_INTS 16 |
| |
#define NUM_RESERVED_POINTERS 16 |
| |
#define NUM_RESERVED_FUNCS 16 |
| |
|
| |
typedef pointer (*funcPointer)(void); |
| |
|
| |
/* |
| |
* ScrnInfoRec |
| |
* |
| |
* There is one of these for each screen, and it holds all the screen-specific |
| |
* information. |
| |
* |
| |
* Note: the size and layout must be kept the same across versions. New |
| |
* fields are to be added in place of the "reserved*" fields. No fields |
| |
* are to be dependent on complie-time defines. |
| |
*/ |
| |
|
| |
typedef struct _ScrnInfoRec { |
| |
int driverVersion; |
| |
ScreenPtr pScreen; /* Pointer to the ScreenRec */ |
| |
int scrnIndex; /* Number of this screen */ |
| |
Bool configured; /* Is this screen valid */ |
| |
int tmpIndex; /* initial number assigned to |
| |
* this screen before |
| |
* finalising the number of |
| |
* available screens */ |
| |
int bitsPerPixel; /* bpp for default visual */ |
| |
int depth; /* depth of default visual */ |
| |
rgb weight; /* r/g/b weights */ |
| |
rgb mask; /* rgb masks */ |
| |
int rgbBits; /* Number of bits in r/g/b */ |
| |
float redGamma; /* Gamma values */ |
| |
float blueGamma; /* Gamma values */ |
| |
float greenGamma; /* Gamma values */ |
| |
int defaultVisual; /* default visual class */ |
| |
int maxHValue; /* max horizontal timing */ |
| |
int maxVValue; /* max vertical timing value */ |
| |
int virtualX; /* Virtual width */ |
| |
int virtualY; /* Virtual height */ |
| |
int displayWidth; /* memory pitch */ |
| |
int frameX0; /* viewport position */ |
| |
int frameY0; |
| |
int frameX1; |
| |
int frameY1; |
| |
int zoomLocked; /* Disallow mode changes */ |
| |
DisplayModePtr modePool; /* list of compatible modes */ |
| |
DisplayModePtr modes; /* list of actual modes */ |
| |
DisplayModePtr currentMode; /* current mode |
| |
* This was previously |
| |
* overloaded with the modes |
| |
* field, which is a pointer |
| |
* into a circular list */ |
| |
MonPtr monitor; /* Monitor information */ |
| |
GDevPtr device; /* device information */ |
| |
int width; /* physical display dimensions |
| |
* in mm */ |
| |
int height; |
| |
char * name; /* Name to prefix messages */ |
| |
pointer driverPrivate; /* Driver private area */ |
| |
int numPrivates; /* Number of privates */ |
| |
DevUnion * privates; /* Other privates can hook in |
| |
* here */ |
| |
|
| |
char ** requiredModules; /* List of modules needed */ |
| |
int numRequiredModules; |
| |
|
| |
/* Some of these may be moved out of here into the driver private area */ |
| |
|
| |
OFlagSet options; /* Option flags */ |
| |
char * chipset; /* chipset name */ |
| |
char * ramdac; /* ramdac name */ |
| |
char * clockchip; /* clock name */ |
| |
Bool progClock; /* clock is programmable */ |
| |
int dacSpeeds[MAXDACSPEEDS];/* list of clock limits */ |
| |
int numClocks; /* number of clocks */ |
| |
int clock[MAXCLOCKS]; /* list of clock frequencies */ |
| |
int minClock; /* min clock frequency */ |
| |
int maxClock; /* max clock frequency */ |
| |
ClockRangePtr clockRanges; /* clock ranges */ |
| |
int videoRam; /* amount of video ram (kb) */ |
| |
unsigned long biosBase; /* Base address of video BIOS */ |
| |
unsigned long memBase; /* Frame buffer base address */ |
| |
#if 0 /* This should go */ |
| |
unsigned long speedup; /* Use SpeedUp code */ |
| |
#endif |
| |
int memClk; /* memory clock */ |
| |
int textClockFreq; /* clock of text mode */ |
| |
|
| |
Bool bankedMono; |
| |
rgb blackColour; |
| |
rgb whiteColour; |
| |
|
| |
#if 0 /* Out of date (obsoleted with the new parser code) */ |
| |
int * validTokens; |
| |
#endif |
| |
|
| |
int chipID; |
| |
int chipRev; |
| |
|
| |
/* This is here to allow for DGA to be enabled on a single screen. */ |
| |
Bool vtSema; |
| |
|
| |
/* Keep track of the DGA state */ |
| |
Bool DGAActive; |
| |
int DGAFlags; |
| |
|
| |
#if 0 |
| |
/* These definitely belong in the driver private area */ |
| |
unsigned int IObase; /* AGX - video card I/O reg base */ |
| |
unsigned int DACbase; /* AGX - dac I/O reg base */ |
| |
unsigned long COPbase; /* AGX - coprocessor memory base */ |
| |
unsigned int POSbase; /* AGX - I/O address of POS regs */ |
| |
int instance; /* AGX - XGA video card instance number */ |
| |
unsigned long VGAbase; /* AGX - 64K aperture memory address */ |
| |
int s3Madjust; |
| |
int s3Nadjust; |
| |
int s3MClk; |
| |
int s3RefClk; |
| |
int s3BlankDelay; |
| |
#endif |
| |
|
| |
int reservedInt[NUM_RESERVED_INTS]; |
| |
pointer reservedPtr[NUM_RESERVED_POINTERS]; |
| |
|
| |
/* |
| |
* Driver entry points. |
| |
* |
| |
* All of the mandatory entry points are here, even though some don't |
| |
* need to be accessed through this structure (for example if they |
| |
* are registered directly through pScreen). |
| |
* |
| |
* The mandatory ones are: Probe, PreInit, ScreenInit, EnterVT, |
| |
* LeaveVT, CloseScreen, SaveScreen. |
| |
*/ |
| |
|
| |
Bool (*ParseConfig)(/* undecided */); |
| |
Bool (*Probe)(int flags); |
| |
Bool (*PreInit)(struct _ScrnInfoRec *pScrn, int flags); |
| |
Bool (*ScreenInit)(int scrnIndex, ScreenPtr pScreen, |
| |
int argc, char **argv); |
| |
Bool (*SwitchMode)(int scrnIndex, DisplayModePtr mode, |
| |
int flags); |
| |
void (*AdjustFrame)(int scrnIndex, int x, int y, int flags); |
| |
void (*EnterVT)(int scrnIndex, int flags); |
| |
void (*LeaveVT)(int scrnIndex, int flags); |
| |
void (*CloseScreen)(int scrnIndex, ScreenPtr pScreen); |
| |
void (*FreeScreen)(int scrnIndex, int flags); |
| |
int (*ValidMode)(int scrnIndex, DisplayModePtr mode, |
| |
Bool verbose, int flags); |
| |
Bool (*SaveScreen)(ScreenPtr pScreen, Bool unblank); |
| |
|
| |
/* For DPMS */ |
| |
void (*DPMSSet)(int scrnIndex, int level, int flags); |
| |
|
| |
/* For DGA */ |
| |
Bool (*GetDGAParameters)(int scrnIndex, |
| |
unsigned long *physBase, |
| |
int *physSize, int *memSize); |
| |
Bool (*DGASetDirectMode)(int scrnIndex, Bool on); |
| |
void (*DGASetBank)(int scrnIndex, int bank, int flags); |
| |
|
| |
funcPointer reservedFuncs[NUM_RESERVED_FUNCS]; |
| |
|
| |
} ScrnInfoRec, *ScrnInfoPtr; |
| |
|
| |
/* |
| |
* The driver list struct. This contains the information required for each |
| |
* driver before a ScrnInfoRec has been allocated. |
| |
*/ |
| |
typedef struct { |
| |
int driverVersion; |
| |
char * driverName; |
| |
void (*Register)(int flags); |
| |
Bool (*ParseConfig)(/*ParseInfoPtr raw*/); |
| |
Bool (*Probe)(int flags); |
| |
pointer parseInfo; /* Driver-specific parsed info */ |
| |
} DriverRec, *DriverPtr; |
| |
|
| |
|
| |
typedef struct { |
| |
int token; /* id of the token */ |
| |
const char * name; /* pointer to the LOWERCASED name */ |
| |
} SymTabRec, *SymTabPtr; |
| |
|
| |
/* These are the possible flags for ValidMode */ |
| |
typedef enum { |
| |
MODE_USED, /* this mode is really being used in the */ |
| |
/* modes line of the Display Subsection */ |
| |
MODE_SUGGESTED, /* this mode is included in the available*/ |
| |
/* modes in the Monitor Section */ |
| |
MODE_VID /* this is called from the VidMode extension */ |
| |
} ValidModeFlags; |
| |
|
| |
/* flags for xf86SaveRestoreImage */ |
| |
typedef enum { |
| |
SaveImage, |
| |
RestoreImage, |
| |
FreeImage |
| |
} SaveRestoreFlags; |
| |
|
| |
/* flags for xf86LookupMode */ |
| |
typedef enum { |
| |
LOOKUP_DEFAULT = 0, /* Use default mode lookup method */ |
| |
LOOKUP_BEST_REFRESH, /* Pick modes with best refresh */ |
| |
LOOKUP_CLOSEST_CLOCK, /* Pick modes with the closest clock */ |
| |
LOOKUP_LIST_ORDER /* Pick first useful mode in list */ |
| |
} LookupModeFlags; |
| |
|
| |
/* Flags for driver messages */ |
| |
typedef enum { |
| |
X_PROBED, /* Value was probed */ |
| |
X_CONFIG, /* Value was given in the config file */ |
| |
X_DEFAULT, /* Value is a default */ |
| |
X_CMDLINE /* Value was given on the command line */ |
| |
} MessageType; |
| |
|
| |
/* |
| |
* mouse protocol types |
| |
*/ |
| |
typedef enum { |
| |
PROT_MS = 0, /* Microsoft */ |
| |
PROT_MSC, /* Mouse Systems Corp */ |
| |
PROT_MM, /* MMseries */ |
| |
PROT_LOGI, /* Logitech */ |
| |
PROT_BM, /* BusMouse ??? */ |
| |
PROT_LOGIMAN, /* MouseMan / TrackMan */ |
| |
PROT_PS2, /* PS/2 mouse */ |
| |
PROT_MMHIT, /* MM_HitTab */ |
| |
PROT_GLIDEPOINT, /* ALPS GlidePoint */ |
| |
PROT_MSINTELLIMOUSE, /* Microsoft IntelliMouse */ |
| |
NUM_PROTOCOLS /* MUST BE LAST */ |
| |
} MouseProtocol; |
| |
|
| |
/* |
| |
* keyboard specialKeyMap paramters |
| |
*/ |
| |
typedef enum { |
| |
K_INDEX_LEFTALT = 0, |
| |
K_INDEX_RIGHTALT, |
| |
K_INDEX_SCROLLLOCK, |
| |
K_INDEX_RIGHTCTL, |
| |
NUM_KEYMAP_TYPES |
| |
} KeymapIndex; |
| |
|
| |
typedef enum { |
| |
KM_META = 0, |
| |
KM_COMPOSE, |
| |
KM_MODESHIFT, |
| |
KM_MODELOCK, |
| |
KM_SCROLLLOCK, |
| |
KM_CONTROL |
| |
} KeymapKey; |
| |
|
| |
/* |
| |
* misc constants |
| |
*/ |
| |
#define INTERLACE_REFRESH_WEIGHT 1.5 |
| |
#define SYNC_TOLERANCE 0.01 /* 1 percent */ |
| |
#define CLOCK_TOLERANCE 2000 /* Clock matching tolerance (2MHz) */ |
| |
|
| |
#define LD_RESOLV_IFDONE 0 /* only check if no more |
| |
delays pending */ |
| |
#define LD_RESOLV_NOW 1 /* finish one delay step */ |
| |
#define LD_RESOLV_FORCE 2 /* force checking... */ |
| |
|
| |
#endif /* _XF86STR_H */ |