1*4882a593Smuzhiyun 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * Copyright (c) 1997-2003 by The XFree86 Project, Inc. 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * Permission is hereby granted, free of charge, to any person obtaining a 6*4882a593Smuzhiyun * copy of this software and associated documentation files (the "Software"), 7*4882a593Smuzhiyun * to deal in the Software without restriction, including without limitation 8*4882a593Smuzhiyun * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9*4882a593Smuzhiyun * and/or sell copies of the Software, and to permit persons to whom the 10*4882a593Smuzhiyun * Software is furnished to do so, subject to the following conditions: 11*4882a593Smuzhiyun * 12*4882a593Smuzhiyun * The above copyright notice and this permission notice shall be included in 13*4882a593Smuzhiyun * all copies or substantial portions of the Software. 14*4882a593Smuzhiyun * 15*4882a593Smuzhiyun * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16*4882a593Smuzhiyun * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17*4882a593Smuzhiyun * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18*4882a593Smuzhiyun * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 19*4882a593Smuzhiyun * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20*4882a593Smuzhiyun * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 21*4882a593Smuzhiyun * OTHER DEALINGS IN THE SOFTWARE. 22*4882a593Smuzhiyun * 23*4882a593Smuzhiyun * Except as contained in this notice, the name of the copyright holder(s) 24*4882a593Smuzhiyun * and author(s) shall not be used in advertising or otherwise to promote 25*4882a593Smuzhiyun * the sale, use or other dealings in this Software without prior written 26*4882a593Smuzhiyun * authorization from the copyright holder(s) and author(s). 27*4882a593Smuzhiyun */ 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun /* 30*4882a593Smuzhiyun * This file contains definitions of the public XFree86 data structures/types. 31*4882a593Smuzhiyun * Any data structures that video drivers need to access should go here. 32*4882a593Smuzhiyun */ 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun #ifndef _XF86STR_H 35*4882a593Smuzhiyun #define _XF86STR_H 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun #include "misc.h" 38*4882a593Smuzhiyun #include "input.h" 39*4882a593Smuzhiyun #include "scrnintstr.h" 40*4882a593Smuzhiyun #include "pixmapstr.h" 41*4882a593Smuzhiyun #include "colormapst.h" 42*4882a593Smuzhiyun #include "xf86Module.h" 43*4882a593Smuzhiyun #include "xf86Opt.h" 44*4882a593Smuzhiyun #include "displaymode.h" 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun /** 47*4882a593Smuzhiyun * Integer type that is of the size of the addressable memory (machine size). 48*4882a593Smuzhiyun * On most platforms \c uintptr_t will suffice. However, on some mixed 49*4882a593Smuzhiyun * 32-bit / 64-bit platforms, such as 32-bit binaries on 64-bit PowerPC, this 50*4882a593Smuzhiyun * must be 64-bits. 51*4882a593Smuzhiyun */ 52*4882a593Smuzhiyun #include <inttypes.h> 53*4882a593Smuzhiyun #if defined(__powerpc__) 54*4882a593Smuzhiyun typedef uint64_t memType; 55*4882a593Smuzhiyun #else 56*4882a593Smuzhiyun typedef uintptr_t memType; 57*4882a593Smuzhiyun #endif 58*4882a593Smuzhiyun 59*4882a593Smuzhiyun /* Video mode flags */ 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun typedef enum { 62*4882a593Smuzhiyun V_PHSYNC = 0x0001, 63*4882a593Smuzhiyun V_NHSYNC = 0x0002, 64*4882a593Smuzhiyun V_PVSYNC = 0x0004, 65*4882a593Smuzhiyun V_NVSYNC = 0x0008, 66*4882a593Smuzhiyun V_INTERLACE = 0x0010, 67*4882a593Smuzhiyun V_DBLSCAN = 0x0020, 68*4882a593Smuzhiyun V_CSYNC = 0x0040, 69*4882a593Smuzhiyun V_PCSYNC = 0x0080, 70*4882a593Smuzhiyun V_NCSYNC = 0x0100, 71*4882a593Smuzhiyun V_HSKEW = 0x0200, /* hskew provided */ 72*4882a593Smuzhiyun V_BCAST = 0x0400, 73*4882a593Smuzhiyun V_PIXMUX = 0x1000, 74*4882a593Smuzhiyun V_DBLCLK = 0x2000, 75*4882a593Smuzhiyun V_CLKDIV2 = 0x4000 76*4882a593Smuzhiyun } ModeFlags; 77*4882a593Smuzhiyun 78*4882a593Smuzhiyun typedef enum { 79*4882a593Smuzhiyun INTERLACE_HALVE_V = 0x0001 /* Halve V values for interlacing */ 80*4882a593Smuzhiyun } CrtcAdjustFlags; 81*4882a593Smuzhiyun 82*4882a593Smuzhiyun /* Flags passed to ChipValidMode() */ 83*4882a593Smuzhiyun typedef enum { 84*4882a593Smuzhiyun MODECHECK_INITIAL = 0, 85*4882a593Smuzhiyun MODECHECK_FINAL = 1 86*4882a593Smuzhiyun } ModeCheckFlags; 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun /* 89*4882a593Smuzhiyun * The mode sets are, from best to worst: USERDEF, DRIVER, and DEFAULT/BUILTIN. 90*4882a593Smuzhiyun * Preferred will bubble a mode to the top within a set. 91*4882a593Smuzhiyun */ 92*4882a593Smuzhiyun #define M_T_BUILTIN 0x01 /* built-in mode */ 93*4882a593Smuzhiyun #define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */ 94*4882a593Smuzhiyun #define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */ 95*4882a593Smuzhiyun #define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C) 96*4882a593Smuzhiyun /* built-in mode - configure CRTC and clock */ 97*4882a593Smuzhiyun #define M_T_PREFERRED 0x08 /* preferred mode within a set */ 98*4882a593Smuzhiyun #define M_T_DEFAULT 0x10 /* (VESA) default modes */ 99*4882a593Smuzhiyun #define M_T_USERDEF 0x20 /* One of the modes from the config file */ 100*4882a593Smuzhiyun #define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */ 101*4882a593Smuzhiyun #define M_T_USERPREF 0x80 /* mode preferred by the user config */ 102*4882a593Smuzhiyun 103*4882a593Smuzhiyun /* The monitor description */ 104*4882a593Smuzhiyun 105*4882a593Smuzhiyun #define MAX_HSYNC 8 106*4882a593Smuzhiyun #define MAX_VREFRESH 8 107*4882a593Smuzhiyun 108*4882a593Smuzhiyun typedef struct { 109*4882a593Smuzhiyun float hi, lo; 110*4882a593Smuzhiyun } range; 111*4882a593Smuzhiyun 112*4882a593Smuzhiyun typedef struct { 113*4882a593Smuzhiyun CARD32 red, green, blue; 114*4882a593Smuzhiyun } rgb; 115*4882a593Smuzhiyun 116*4882a593Smuzhiyun typedef struct { 117*4882a593Smuzhiyun float red, green, blue; 118*4882a593Smuzhiyun } Gamma; 119*4882a593Smuzhiyun 120*4882a593Smuzhiyun /* The permitted gamma range is 1 / GAMMA_MAX <= g <= GAMMA_MAX */ 121*4882a593Smuzhiyun #define GAMMA_MAX 10.0 122*4882a593Smuzhiyun #define GAMMA_MIN (1.0 / GAMMA_MAX) 123*4882a593Smuzhiyun #define GAMMA_ZERO (GAMMA_MIN / 100.0) 124*4882a593Smuzhiyun 125*4882a593Smuzhiyun typedef struct { 126*4882a593Smuzhiyun const char *id; 127*4882a593Smuzhiyun const char *vendor; 128*4882a593Smuzhiyun const char *model; 129*4882a593Smuzhiyun int nHsync; 130*4882a593Smuzhiyun range hsync[MAX_HSYNC]; 131*4882a593Smuzhiyun int nVrefresh; 132*4882a593Smuzhiyun range vrefresh[MAX_VREFRESH]; 133*4882a593Smuzhiyun DisplayModePtr Modes; /* Start of the monitor's mode list */ 134*4882a593Smuzhiyun DisplayModePtr Last; /* End of the monitor's mode list */ 135*4882a593Smuzhiyun Gamma gamma; /* Gamma of the monitor */ 136*4882a593Smuzhiyun int widthmm; 137*4882a593Smuzhiyun int heightmm; 138*4882a593Smuzhiyun void *options; 139*4882a593Smuzhiyun void *DDC; 140*4882a593Smuzhiyun Bool reducedblanking; /* Allow CVT reduced blanking modes? */ 141*4882a593Smuzhiyun int maxPixClock; /* in kHz, like mode->Clock */ 142*4882a593Smuzhiyun } MonRec, *MonPtr; 143*4882a593Smuzhiyun 144*4882a593Smuzhiyun /* the list of clock ranges */ 145*4882a593Smuzhiyun typedef struct x_ClockRange { 146*4882a593Smuzhiyun struct x_ClockRange *next; 147*4882a593Smuzhiyun int minClock; /* (kHz) */ 148*4882a593Smuzhiyun int maxClock; /* (kHz) */ 149*4882a593Smuzhiyun int clockIndex; /* -1 for programmable clocks */ 150*4882a593Smuzhiyun Bool interlaceAllowed; 151*4882a593Smuzhiyun Bool doubleScanAllowed; 152*4882a593Smuzhiyun int ClockMulFactor; 153*4882a593Smuzhiyun int ClockDivFactor; 154*4882a593Smuzhiyun int PrivFlags; 155*4882a593Smuzhiyun } ClockRange, *ClockRangePtr; 156*4882a593Smuzhiyun 157*4882a593Smuzhiyun /* 158*4882a593Smuzhiyun * The driverFunc. xorgDriverFuncOp specifies the action driver should 159*4882a593Smuzhiyun * perform. If requested option is not supported function should return 160*4882a593Smuzhiyun * FALSE. pointer can be used to pass arguments to the function or 161*4882a593Smuzhiyun * to return data to the caller. 162*4882a593Smuzhiyun */ 163*4882a593Smuzhiyun typedef struct _ScrnInfoRec *ScrnInfoPtr; 164*4882a593Smuzhiyun 165*4882a593Smuzhiyun /* do not change order */ 166*4882a593Smuzhiyun typedef enum { 167*4882a593Smuzhiyun RR_GET_INFO, 168*4882a593Smuzhiyun RR_SET_CONFIG, 169*4882a593Smuzhiyun RR_GET_MODE_MM, 170*4882a593Smuzhiyun GET_REQUIRED_HW_INTERFACES = 10, 171*4882a593Smuzhiyun SUPPORTS_SERVER_FDS = 11, 172*4882a593Smuzhiyun } xorgDriverFuncOp; 173*4882a593Smuzhiyun 174*4882a593Smuzhiyun typedef Bool xorgDriverFuncProc(ScrnInfoPtr, xorgDriverFuncOp, void *); 175*4882a593Smuzhiyun 176*4882a593Smuzhiyun /* RR_GET_INFO, RR_SET_CONFIG */ 177*4882a593Smuzhiyun typedef struct { 178*4882a593Smuzhiyun int rotation; 179*4882a593Smuzhiyun int rate; 180*4882a593Smuzhiyun int width; 181*4882a593Smuzhiyun int height; 182*4882a593Smuzhiyun } xorgRRConfig; 183*4882a593Smuzhiyun 184*4882a593Smuzhiyun typedef union { 185*4882a593Smuzhiyun short RRRotations; 186*4882a593Smuzhiyun xorgRRConfig RRConfig; 187*4882a593Smuzhiyun } xorgRRRotation, *xorgRRRotationPtr; 188*4882a593Smuzhiyun 189*4882a593Smuzhiyun /* RR_GET_MODE_MM */ 190*4882a593Smuzhiyun typedef struct { 191*4882a593Smuzhiyun DisplayModePtr mode; 192*4882a593Smuzhiyun int virtX; 193*4882a593Smuzhiyun int virtY; 194*4882a593Smuzhiyun int mmWidth; 195*4882a593Smuzhiyun int mmHeight; 196*4882a593Smuzhiyun } xorgRRModeMM, *xorgRRModeMMPtr; 197*4882a593Smuzhiyun 198*4882a593Smuzhiyun /* GET_REQUIRED_HW_INTERFACES */ 199*4882a593Smuzhiyun #define HW_IO 1 200*4882a593Smuzhiyun #define HW_MMIO 2 201*4882a593Smuzhiyun #define HW_SKIP_CONSOLE 4 202*4882a593Smuzhiyun #define NEED_IO_ENABLED(x) (x & HW_IO) 203*4882a593Smuzhiyun 204*4882a593Smuzhiyun typedef CARD32 xorgHWFlags; 205*4882a593Smuzhiyun 206*4882a593Smuzhiyun /* 207*4882a593Smuzhiyun * The driver list struct. This contains the information required for each 208*4882a593Smuzhiyun * driver before a ScrnInfoRec has been allocated. 209*4882a593Smuzhiyun */ 210*4882a593Smuzhiyun struct _DriverRec; 211*4882a593Smuzhiyun 212*4882a593Smuzhiyun struct _SymTabRec; 213*4882a593Smuzhiyun struct _PciChipsets; 214*4882a593Smuzhiyun 215*4882a593Smuzhiyun struct pci_device; 216*4882a593Smuzhiyun struct xf86_platform_device; 217*4882a593Smuzhiyun 218*4882a593Smuzhiyun typedef struct _DriverRec { 219*4882a593Smuzhiyun int driverVersion; 220*4882a593Smuzhiyun const char *driverName; 221*4882a593Smuzhiyun void (*Identify) (int flags); 222*4882a593Smuzhiyun Bool (*Probe) (struct _DriverRec * drv, int flags); 223*4882a593Smuzhiyun const OptionInfoRec *(*AvailableOptions) (int chipid, int bustype); 224*4882a593Smuzhiyun void *module; 225*4882a593Smuzhiyun int refCount; 226*4882a593Smuzhiyun xorgDriverFuncProc *driverFunc; 227*4882a593Smuzhiyun 228*4882a593Smuzhiyun const struct pci_id_match *supported_devices; 229*4882a593Smuzhiyun Bool (*PciProbe) (struct _DriverRec * drv, int entity_num, 230*4882a593Smuzhiyun struct pci_device * dev, intptr_t match_data); 231*4882a593Smuzhiyun Bool (*platformProbe) (struct _DriverRec * drv, int entity_num, int flags, 232*4882a593Smuzhiyun struct xf86_platform_device * dev, intptr_t match_data); 233*4882a593Smuzhiyun } DriverRec, *DriverPtr; 234*4882a593Smuzhiyun 235*4882a593Smuzhiyun /* 236*4882a593Smuzhiyun * platform probe flags 237*4882a593Smuzhiyun */ 238*4882a593Smuzhiyun #define PLATFORM_PROBE_GPU_SCREEN 1 239*4882a593Smuzhiyun 240*4882a593Smuzhiyun /* 241*4882a593Smuzhiyun * AddDriver flags 242*4882a593Smuzhiyun */ 243*4882a593Smuzhiyun #define HaveDriverFuncs 1 244*4882a593Smuzhiyun 245*4882a593Smuzhiyun /* 246*4882a593Smuzhiyun * These are the private bus types. New types can be added here. Types 247*4882a593Smuzhiyun * required for the public interface should be added to xf86str.h, with 248*4882a593Smuzhiyun * function prototypes added to xf86.h. 249*4882a593Smuzhiyun */ 250*4882a593Smuzhiyun 251*4882a593Smuzhiyun /* Tolerate prior #include <linux/input.h> */ 252*4882a593Smuzhiyun #if defined(__linux__) 253*4882a593Smuzhiyun #undef BUS_NONE 254*4882a593Smuzhiyun #undef BUS_PCI 255*4882a593Smuzhiyun #undef BUS_SBUS 256*4882a593Smuzhiyun #undef BUS_PLATFORM 257*4882a593Smuzhiyun #undef BUS_last 258*4882a593Smuzhiyun #endif 259*4882a593Smuzhiyun 260*4882a593Smuzhiyun typedef enum { 261*4882a593Smuzhiyun BUS_NONE, 262*4882a593Smuzhiyun BUS_PCI, 263*4882a593Smuzhiyun BUS_SBUS, 264*4882a593Smuzhiyun BUS_PLATFORM, 265*4882a593Smuzhiyun BUS_last /* Keep last */ 266*4882a593Smuzhiyun } BusType; 267*4882a593Smuzhiyun 268*4882a593Smuzhiyun typedef struct { 269*4882a593Smuzhiyun int fbNum; 270*4882a593Smuzhiyun } SbusBusId; 271*4882a593Smuzhiyun 272*4882a593Smuzhiyun typedef struct _bus { 273*4882a593Smuzhiyun BusType type; 274*4882a593Smuzhiyun union { 275*4882a593Smuzhiyun struct pci_device *pci; 276*4882a593Smuzhiyun SbusBusId sbus; 277*4882a593Smuzhiyun struct xf86_platform_device *plat; 278*4882a593Smuzhiyun } id; 279*4882a593Smuzhiyun } BusRec, *BusPtr; 280*4882a593Smuzhiyun 281*4882a593Smuzhiyun typedef enum { 282*4882a593Smuzhiyun DAC_BPP8 = 0, 283*4882a593Smuzhiyun DAC_BPP16, 284*4882a593Smuzhiyun DAC_BPP24, 285*4882a593Smuzhiyun DAC_BPP32, 286*4882a593Smuzhiyun MAXDACSPEEDS 287*4882a593Smuzhiyun } DacSpeedIndex; 288*4882a593Smuzhiyun 289*4882a593Smuzhiyun typedef struct { 290*4882a593Smuzhiyun const char *identifier; 291*4882a593Smuzhiyun const char *vendor; 292*4882a593Smuzhiyun const char *board; 293*4882a593Smuzhiyun const char *chipset; 294*4882a593Smuzhiyun const char *ramdac; 295*4882a593Smuzhiyun const char *driver; 296*4882a593Smuzhiyun struct _confscreenrec *myScreenSection; 297*4882a593Smuzhiyun Bool claimed; 298*4882a593Smuzhiyun int dacSpeeds[MAXDACSPEEDS]; 299*4882a593Smuzhiyun int numclocks; 300*4882a593Smuzhiyun int clock[MAXCLOCKS]; 301*4882a593Smuzhiyun const char *clockchip; 302*4882a593Smuzhiyun const char *busID; 303*4882a593Smuzhiyun Bool active; 304*4882a593Smuzhiyun Bool inUse; 305*4882a593Smuzhiyun int videoRam; 306*4882a593Smuzhiyun unsigned long MemBase; /* Frame buffer base address */ 307*4882a593Smuzhiyun unsigned long IOBase; 308*4882a593Smuzhiyun int chipID; 309*4882a593Smuzhiyun int chipRev; 310*4882a593Smuzhiyun void *options; 311*4882a593Smuzhiyun int irq; 312*4882a593Smuzhiyun int screen; /* For multi-CRTC cards */ 313*4882a593Smuzhiyun } GDevRec, *GDevPtr; 314*4882a593Smuzhiyun 315*4882a593Smuzhiyun typedef struct { 316*4882a593Smuzhiyun int frameX0; 317*4882a593Smuzhiyun int frameY0; 318*4882a593Smuzhiyun int virtualX; 319*4882a593Smuzhiyun int virtualY; 320*4882a593Smuzhiyun int depth; 321*4882a593Smuzhiyun int fbbpp; 322*4882a593Smuzhiyun rgb weight; 323*4882a593Smuzhiyun rgb blackColour; 324*4882a593Smuzhiyun rgb whiteColour; 325*4882a593Smuzhiyun int defaultVisual; 326*4882a593Smuzhiyun const char **modes; 327*4882a593Smuzhiyun void *options; 328*4882a593Smuzhiyun } DispRec, *DispPtr; 329*4882a593Smuzhiyun 330*4882a593Smuzhiyun typedef struct _confxvportrec { 331*4882a593Smuzhiyun const char *identifier; 332*4882a593Smuzhiyun void *options; 333*4882a593Smuzhiyun } confXvPortRec, *confXvPortPtr; 334*4882a593Smuzhiyun 335*4882a593Smuzhiyun typedef struct _confxvadaptrec { 336*4882a593Smuzhiyun const char *identifier; 337*4882a593Smuzhiyun int numports; 338*4882a593Smuzhiyun confXvPortPtr ports; 339*4882a593Smuzhiyun void *options; 340*4882a593Smuzhiyun } confXvAdaptorRec, *confXvAdaptorPtr; 341*4882a593Smuzhiyun 342*4882a593Smuzhiyun #define MAX_GPUDEVICES 4 343*4882a593Smuzhiyun typedef struct _confscreenrec { 344*4882a593Smuzhiyun const char *id; 345*4882a593Smuzhiyun int screennum; 346*4882a593Smuzhiyun int defaultdepth; 347*4882a593Smuzhiyun int defaultbpp; 348*4882a593Smuzhiyun int defaultfbbpp; 349*4882a593Smuzhiyun MonPtr monitor; 350*4882a593Smuzhiyun GDevPtr device; 351*4882a593Smuzhiyun int numdisplays; 352*4882a593Smuzhiyun DispPtr displays; 353*4882a593Smuzhiyun int numxvadaptors; 354*4882a593Smuzhiyun confXvAdaptorPtr xvadaptors; 355*4882a593Smuzhiyun void *options; 356*4882a593Smuzhiyun 357*4882a593Smuzhiyun int num_gpu_devices; 358*4882a593Smuzhiyun GDevPtr gpu_devices[MAX_GPUDEVICES]; 359*4882a593Smuzhiyun } confScreenRec, *confScreenPtr; 360*4882a593Smuzhiyun 361*4882a593Smuzhiyun typedef enum { 362*4882a593Smuzhiyun PosObsolete = -1, 363*4882a593Smuzhiyun PosAbsolute = 0, 364*4882a593Smuzhiyun PosRightOf, 365*4882a593Smuzhiyun PosLeftOf, 366*4882a593Smuzhiyun PosAbove, 367*4882a593Smuzhiyun PosBelow, 368*4882a593Smuzhiyun PosRelative 369*4882a593Smuzhiyun } PositionType; 370*4882a593Smuzhiyun 371*4882a593Smuzhiyun typedef struct _screenlayoutrec { 372*4882a593Smuzhiyun confScreenPtr screen; 373*4882a593Smuzhiyun const char *topname; 374*4882a593Smuzhiyun confScreenPtr top; 375*4882a593Smuzhiyun const char *bottomname; 376*4882a593Smuzhiyun confScreenPtr bottom; 377*4882a593Smuzhiyun const char *leftname; 378*4882a593Smuzhiyun confScreenPtr left; 379*4882a593Smuzhiyun const char *rightname; 380*4882a593Smuzhiyun confScreenPtr right; 381*4882a593Smuzhiyun PositionType where; 382*4882a593Smuzhiyun int x; 383*4882a593Smuzhiyun int y; 384*4882a593Smuzhiyun const char *refname; 385*4882a593Smuzhiyun confScreenPtr refscreen; 386*4882a593Smuzhiyun } screenLayoutRec, *screenLayoutPtr; 387*4882a593Smuzhiyun 388*4882a593Smuzhiyun typedef struct _InputInfoRec InputInfoRec; 389*4882a593Smuzhiyun 390*4882a593Smuzhiyun typedef struct _serverlayoutrec { 391*4882a593Smuzhiyun const char *id; 392*4882a593Smuzhiyun screenLayoutPtr screens; 393*4882a593Smuzhiyun GDevPtr inactives; 394*4882a593Smuzhiyun InputInfoRec **inputs; /* NULL terminated */ 395*4882a593Smuzhiyun void *options; 396*4882a593Smuzhiyun } serverLayoutRec, *serverLayoutPtr; 397*4882a593Smuzhiyun 398*4882a593Smuzhiyun typedef struct _confdribufferrec { 399*4882a593Smuzhiyun int count; 400*4882a593Smuzhiyun int size; 401*4882a593Smuzhiyun enum { 402*4882a593Smuzhiyun XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */ 403*4882a593Smuzhiyun } flags; 404*4882a593Smuzhiyun } confDRIBufferRec, *confDRIBufferPtr; 405*4882a593Smuzhiyun 406*4882a593Smuzhiyun typedef struct _confdrirec { 407*4882a593Smuzhiyun int group; 408*4882a593Smuzhiyun int mode; 409*4882a593Smuzhiyun int bufs_count; 410*4882a593Smuzhiyun confDRIBufferRec *bufs; 411*4882a593Smuzhiyun } confDRIRec, *confDRIPtr; 412*4882a593Smuzhiyun 413*4882a593Smuzhiyun #define NUM_RESERVED_INTS 4 414*4882a593Smuzhiyun #define NUM_RESERVED_POINTERS 4 415*4882a593Smuzhiyun #define NUM_RESERVED_FUNCS 4 416*4882a593Smuzhiyun 417*4882a593Smuzhiyun /* let clients know they can use this */ 418*4882a593Smuzhiyun #define XF86_SCRN_HAS_PREFER_CLONE 1 419*4882a593Smuzhiyun 420*4882a593Smuzhiyun typedef void *(*funcPointer) (void); 421*4882a593Smuzhiyun 422*4882a593Smuzhiyun /* Power management events: so far we only support APM */ 423*4882a593Smuzhiyun 424*4882a593Smuzhiyun typedef enum { 425*4882a593Smuzhiyun XF86_APM_UNKNOWN = -1, 426*4882a593Smuzhiyun XF86_APM_SYS_STANDBY, 427*4882a593Smuzhiyun XF86_APM_SYS_SUSPEND, 428*4882a593Smuzhiyun XF86_APM_CRITICAL_SUSPEND, 429*4882a593Smuzhiyun XF86_APM_USER_STANDBY, 430*4882a593Smuzhiyun XF86_APM_USER_SUSPEND, 431*4882a593Smuzhiyun XF86_APM_STANDBY_RESUME, 432*4882a593Smuzhiyun XF86_APM_NORMAL_RESUME, 433*4882a593Smuzhiyun XF86_APM_CRITICAL_RESUME, 434*4882a593Smuzhiyun XF86_APM_LOW_BATTERY, 435*4882a593Smuzhiyun XF86_APM_POWER_STATUS_CHANGE, 436*4882a593Smuzhiyun XF86_APM_UPDATE_TIME, 437*4882a593Smuzhiyun XF86_APM_CAPABILITY_CHANGED, 438*4882a593Smuzhiyun XF86_APM_STANDBY_FAILED, 439*4882a593Smuzhiyun XF86_APM_SUSPEND_FAILED 440*4882a593Smuzhiyun } pmEvent; 441*4882a593Smuzhiyun 442*4882a593Smuzhiyun typedef enum { 443*4882a593Smuzhiyun PM_WAIT, 444*4882a593Smuzhiyun PM_CONTINUE, 445*4882a593Smuzhiyun PM_FAILED, 446*4882a593Smuzhiyun PM_NONE 447*4882a593Smuzhiyun } pmWait; 448*4882a593Smuzhiyun 449*4882a593Smuzhiyun typedef struct _PciChipsets { 450*4882a593Smuzhiyun /** 451*4882a593Smuzhiyun * Key used to match this device with its name in an array of 452*4882a593Smuzhiyun * \c SymTabRec. 453*4882a593Smuzhiyun */ 454*4882a593Smuzhiyun int numChipset; 455*4882a593Smuzhiyun 456*4882a593Smuzhiyun /** 457*4882a593Smuzhiyun * This value is quirky. Depending on the driver, it can take on one of 458*4882a593Smuzhiyun * three meanings. In drivers that have exactly one vendor ID (e.g., 459*4882a593Smuzhiyun * radeon, mga, i810) the low 16-bits are the device ID. 460*4882a593Smuzhiyun * 461*4882a593Smuzhiyun * In drivers that can have multiple vendor IDs (e.g., the glint driver 462*4882a593Smuzhiyun * can have either 3dlabs' ID or TI's ID, the i740 driver can have either 463*4882a593Smuzhiyun * Intel's ID or Real3D's ID, etc.) the low 16-bits are the device ID and 464*4882a593Smuzhiyun * the high 16-bits are the vendor ID. 465*4882a593Smuzhiyun * 466*4882a593Smuzhiyun * In drivers that don't have a specific vendor (e.g., vga) contains the 467*4882a593Smuzhiyun * device ID for either the generic VGA or generic 8514 devices. This 468*4882a593Smuzhiyun * turns out to be the same as the subclass and programming interface 469*4882a593Smuzhiyun * value (e.g., the full 24-bit class for the VGA device is 0x030000 (or 470*4882a593Smuzhiyun * 0x000101) and for 8514 is 0x030001). 471*4882a593Smuzhiyun */ 472*4882a593Smuzhiyun int PCIid; 473*4882a593Smuzhiyun 474*4882a593Smuzhiyun /* dummy place holders for drivers to build against old/new servers */ 475*4882a593Smuzhiyun #define RES_UNDEFINED NULL 476*4882a593Smuzhiyun #define RES_EXCLUSIVE_VGA NULL 477*4882a593Smuzhiyun #define RES_SHARED_VGA NULL 478*4882a593Smuzhiyun void *dummy; 479*4882a593Smuzhiyun } PciChipsets; 480*4882a593Smuzhiyun 481*4882a593Smuzhiyun /* Entity properties */ 482*4882a593Smuzhiyun typedef void (*EntityProc) (int entityIndex, void *private); 483*4882a593Smuzhiyun 484*4882a593Smuzhiyun typedef struct _entityInfo { 485*4882a593Smuzhiyun int index; 486*4882a593Smuzhiyun BusRec location; 487*4882a593Smuzhiyun int chipset; 488*4882a593Smuzhiyun Bool active; 489*4882a593Smuzhiyun GDevPtr device; 490*4882a593Smuzhiyun DriverPtr driver; 491*4882a593Smuzhiyun } EntityInfoRec, *EntityInfoPtr; 492*4882a593Smuzhiyun 493*4882a593Smuzhiyun /* DGA */ 494*4882a593Smuzhiyun 495*4882a593Smuzhiyun typedef struct { 496*4882a593Smuzhiyun int num; /* A unique identifier for the mode (num > 0) */ 497*4882a593Smuzhiyun DisplayModePtr mode; 498*4882a593Smuzhiyun int flags; /* DGA_CONCURRENT_ACCESS, etc... */ 499*4882a593Smuzhiyun int imageWidth; /* linear accessible portion (pixels) */ 500*4882a593Smuzhiyun int imageHeight; 501*4882a593Smuzhiyun int pixmapWidth; /* Xlib accessible portion (pixels) */ 502*4882a593Smuzhiyun int pixmapHeight; /* both fields ignored if no concurrent access */ 503*4882a593Smuzhiyun int bytesPerScanline; 504*4882a593Smuzhiyun int byteOrder; /* MSBFirst, LSBFirst */ 505*4882a593Smuzhiyun int depth; 506*4882a593Smuzhiyun int bitsPerPixel; 507*4882a593Smuzhiyun unsigned long red_mask; 508*4882a593Smuzhiyun unsigned long green_mask; 509*4882a593Smuzhiyun unsigned long blue_mask; 510*4882a593Smuzhiyun short visualClass; 511*4882a593Smuzhiyun int viewportWidth; 512*4882a593Smuzhiyun int viewportHeight; 513*4882a593Smuzhiyun int xViewportStep; /* viewport position granularity */ 514*4882a593Smuzhiyun int yViewportStep; 515*4882a593Smuzhiyun int maxViewportX; /* max viewport origin */ 516*4882a593Smuzhiyun int maxViewportY; 517*4882a593Smuzhiyun int viewportFlags; /* types of page flipping possible */ 518*4882a593Smuzhiyun int offset; /* offset into physical memory */ 519*4882a593Smuzhiyun unsigned char *address; /* server's mapped framebuffer */ 520*4882a593Smuzhiyun int reserved1; 521*4882a593Smuzhiyun int reserved2; 522*4882a593Smuzhiyun } DGAModeRec, *DGAModePtr; 523*4882a593Smuzhiyun 524*4882a593Smuzhiyun typedef struct { 525*4882a593Smuzhiyun DGAModePtr mode; 526*4882a593Smuzhiyun PixmapPtr pPix; 527*4882a593Smuzhiyun } DGADeviceRec, *DGADevicePtr; 528*4882a593Smuzhiyun 529*4882a593Smuzhiyun /* 530*4882a593Smuzhiyun * Flags for driver Probe() functions. 531*4882a593Smuzhiyun */ 532*4882a593Smuzhiyun #define PROBE_DEFAULT 0x00 533*4882a593Smuzhiyun #define PROBE_DETECT 0x01 534*4882a593Smuzhiyun #define PROBE_TRYHARD 0x02 535*4882a593Smuzhiyun 536*4882a593Smuzhiyun /* 537*4882a593Smuzhiyun * Driver entry point types 538*4882a593Smuzhiyun */ 539*4882a593Smuzhiyun 540*4882a593Smuzhiyun typedef Bool xf86ProbeProc(DriverPtr, int); 541*4882a593Smuzhiyun typedef Bool xf86PreInitProc(ScrnInfoPtr, int); 542*4882a593Smuzhiyun typedef Bool xf86ScreenInitProc(ScreenPtr, int, char **); 543*4882a593Smuzhiyun typedef Bool xf86SwitchModeProc(ScrnInfoPtr, DisplayModePtr); 544*4882a593Smuzhiyun typedef void xf86AdjustFrameProc(ScrnInfoPtr, int, int); 545*4882a593Smuzhiyun typedef Bool xf86EnterVTProc(ScrnInfoPtr); 546*4882a593Smuzhiyun typedef void xf86LeaveVTProc(ScrnInfoPtr); 547*4882a593Smuzhiyun typedef void xf86FreeScreenProc(ScrnInfoPtr); 548*4882a593Smuzhiyun typedef ModeStatus xf86ValidModeProc(ScrnInfoPtr, DisplayModePtr, Bool, int); 549*4882a593Smuzhiyun typedef void xf86EnableDisableFBAccessProc(ScrnInfoPtr, Bool); 550*4882a593Smuzhiyun typedef int xf86SetDGAModeProc(ScrnInfoPtr, int, DGADevicePtr); 551*4882a593Smuzhiyun typedef int xf86ChangeGammaProc(ScrnInfoPtr, Gamma); 552*4882a593Smuzhiyun typedef void xf86PointerMovedProc(ScrnInfoPtr, int, int); 553*4882a593Smuzhiyun typedef Bool xf86PMEventProc(ScrnInfoPtr, pmEvent, Bool); 554*4882a593Smuzhiyun typedef void xf86DPMSSetProc(ScrnInfoPtr, int, int); 555*4882a593Smuzhiyun typedef void xf86LoadPaletteProc(ScrnInfoPtr, int, int *, LOCO *, VisualPtr); 556*4882a593Smuzhiyun typedef void xf86SetOverscanProc(ScrnInfoPtr, int); 557*4882a593Smuzhiyun typedef void xf86ModeSetProc(ScrnInfoPtr); 558*4882a593Smuzhiyun 559*4882a593Smuzhiyun /* 560*4882a593Smuzhiyun * ScrnInfoRec 561*4882a593Smuzhiyun * 562*4882a593Smuzhiyun * There is one of these for each screen, and it holds all the screen-specific 563*4882a593Smuzhiyun * information. Note: No fields are to be dependent on compile-time defines. 564*4882a593Smuzhiyun */ 565*4882a593Smuzhiyun 566*4882a593Smuzhiyun typedef struct _ScrnInfoRec { 567*4882a593Smuzhiyun int driverVersion; 568*4882a593Smuzhiyun const char *driverName; /* canonical name used in */ 569*4882a593Smuzhiyun /* the config file */ 570*4882a593Smuzhiyun ScreenPtr pScreen; /* Pointer to the ScreenRec */ 571*4882a593Smuzhiyun int scrnIndex; /* Number of this screen */ 572*4882a593Smuzhiyun Bool configured; /* Is this screen valid */ 573*4882a593Smuzhiyun int origIndex; /* initial number assigned to 574*4882a593Smuzhiyun * this screen before 575*4882a593Smuzhiyun * finalising the number of 576*4882a593Smuzhiyun * available screens */ 577*4882a593Smuzhiyun 578*4882a593Smuzhiyun /* Display-wide screenInfo values needed by this screen */ 579*4882a593Smuzhiyun int imageByteOrder; 580*4882a593Smuzhiyun int bitmapScanlineUnit; 581*4882a593Smuzhiyun int bitmapScanlinePad; 582*4882a593Smuzhiyun int bitmapBitOrder; 583*4882a593Smuzhiyun int numFormats; 584*4882a593Smuzhiyun PixmapFormatRec formats[MAXFORMATS]; 585*4882a593Smuzhiyun PixmapFormatRec fbFormat; 586*4882a593Smuzhiyun 587*4882a593Smuzhiyun int bitsPerPixel; /* fb bpp */ 588*4882a593Smuzhiyun int depth; /* depth of default visual */ 589*4882a593Smuzhiyun MessageType depthFrom; /* set from config? */ 590*4882a593Smuzhiyun MessageType bitsPerPixelFrom; /* set from config? */ 591*4882a593Smuzhiyun rgb weight; /* r/g/b weights */ 592*4882a593Smuzhiyun rgb mask; /* rgb masks */ 593*4882a593Smuzhiyun rgb offset; /* rgb offsets */ 594*4882a593Smuzhiyun int rgbBits; /* Number of bits in r/g/b */ 595*4882a593Smuzhiyun Gamma gamma; /* Gamma of the monitor */ 596*4882a593Smuzhiyun int defaultVisual; /* default visual class */ 597*4882a593Smuzhiyun int virtualX; /* Virtual width */ 598*4882a593Smuzhiyun int virtualY; /* Virtual height */ 599*4882a593Smuzhiyun int xInc; /* Horizontal timing increment */ 600*4882a593Smuzhiyun int displayWidth; /* memory pitch */ 601*4882a593Smuzhiyun int frameX0; /* viewport position */ 602*4882a593Smuzhiyun int frameY0; 603*4882a593Smuzhiyun int frameX1; 604*4882a593Smuzhiyun int frameY1; 605*4882a593Smuzhiyun int zoomLocked; /* Disallow mode changes */ 606*4882a593Smuzhiyun DisplayModePtr modePool; /* list of compatible modes */ 607*4882a593Smuzhiyun DisplayModePtr modes; /* list of actual modes */ 608*4882a593Smuzhiyun DisplayModePtr currentMode; /* current mode 609*4882a593Smuzhiyun * This was previously 610*4882a593Smuzhiyun * overloaded with the modes 611*4882a593Smuzhiyun * field, which is a pointer 612*4882a593Smuzhiyun * into a circular list */ 613*4882a593Smuzhiyun confScreenPtr confScreen; /* Screen config info */ 614*4882a593Smuzhiyun MonPtr monitor; /* Monitor information */ 615*4882a593Smuzhiyun DispPtr display; /* Display information */ 616*4882a593Smuzhiyun int *entityList; /* List of device entities */ 617*4882a593Smuzhiyun int numEntities; 618*4882a593Smuzhiyun int widthmm; /* physical display dimensions 619*4882a593Smuzhiyun * in mm */ 620*4882a593Smuzhiyun int heightmm; 621*4882a593Smuzhiyun int xDpi; /* width DPI */ 622*4882a593Smuzhiyun int yDpi; /* height DPI */ 623*4882a593Smuzhiyun const char *name; /* Name to prefix messages */ 624*4882a593Smuzhiyun void *driverPrivate; /* Driver private area */ 625*4882a593Smuzhiyun DevUnion *privates; /* Other privates can hook in 626*4882a593Smuzhiyun * here */ 627*4882a593Smuzhiyun DriverPtr drv; /* xf86DriverList[] entry */ 628*4882a593Smuzhiyun void *module; /* Pointer to module head */ 629*4882a593Smuzhiyun int colorKey; 630*4882a593Smuzhiyun int overlayFlags; 631*4882a593Smuzhiyun 632*4882a593Smuzhiyun /* Some of these may be moved out of here into the driver private area */ 633*4882a593Smuzhiyun 634*4882a593Smuzhiyun const char *chipset; /* chipset name */ 635*4882a593Smuzhiyun const char *ramdac; /* ramdac name */ 636*4882a593Smuzhiyun const char *clockchip; /* clock name */ 637*4882a593Smuzhiyun Bool progClock; /* clock is programmable */ 638*4882a593Smuzhiyun int numClocks; /* number of clocks */ 639*4882a593Smuzhiyun int clock[MAXCLOCKS]; /* list of clock frequencies */ 640*4882a593Smuzhiyun int videoRam; /* amount of video ram (kb) */ 641*4882a593Smuzhiyun unsigned long memPhysBase; /* Physical address of FB */ 642*4882a593Smuzhiyun unsigned long fbOffset; /* Offset of FB in the above */ 643*4882a593Smuzhiyun Bool flipPixels; /* swap default black/white */ 644*4882a593Smuzhiyun void *options; 645*4882a593Smuzhiyun 646*4882a593Smuzhiyun /* Allow screens to be enabled/disabled individually */ 647*4882a593Smuzhiyun Bool vtSema; 648*4882a593Smuzhiyun 649*4882a593Smuzhiyun /* hw cursor moves from input thread */ 650*4882a593Smuzhiyun Bool silkenMouse; 651*4882a593Smuzhiyun 652*4882a593Smuzhiyun /* Storage for clockRanges and adjustFlags for use with the VidMode ext */ 653*4882a593Smuzhiyun ClockRangePtr clockRanges; 654*4882a593Smuzhiyun int adjustFlags; 655*4882a593Smuzhiyun 656*4882a593Smuzhiyun /* initial rightof support disable */ 657*4882a593Smuzhiyun int preferClone; 658*4882a593Smuzhiyun 659*4882a593Smuzhiyun Bool is_gpu; 660*4882a593Smuzhiyun uint32_t capabilities; 661*4882a593Smuzhiyun 662*4882a593Smuzhiyun int *entityInstanceList; 663*4882a593Smuzhiyun struct pci_device *vgaDev; 664*4882a593Smuzhiyun 665*4882a593Smuzhiyun /* 666*4882a593Smuzhiyun * Driver entry points. 667*4882a593Smuzhiyun * 668*4882a593Smuzhiyun */ 669*4882a593Smuzhiyun 670*4882a593Smuzhiyun xf86ProbeProc *Probe; 671*4882a593Smuzhiyun xf86PreInitProc *PreInit; 672*4882a593Smuzhiyun xf86ScreenInitProc *ScreenInit; 673*4882a593Smuzhiyun xf86SwitchModeProc *SwitchMode; 674*4882a593Smuzhiyun xf86AdjustFrameProc *AdjustFrame; 675*4882a593Smuzhiyun xf86EnterVTProc *EnterVT; 676*4882a593Smuzhiyun xf86LeaveVTProc *LeaveVT; 677*4882a593Smuzhiyun xf86FreeScreenProc *FreeScreen; 678*4882a593Smuzhiyun xf86ValidModeProc *ValidMode; 679*4882a593Smuzhiyun xf86EnableDisableFBAccessProc *EnableDisableFBAccess; 680*4882a593Smuzhiyun xf86SetDGAModeProc *SetDGAMode; 681*4882a593Smuzhiyun xf86ChangeGammaProc *ChangeGamma; 682*4882a593Smuzhiyun xf86PointerMovedProc *PointerMoved; 683*4882a593Smuzhiyun xf86PMEventProc *PMEvent; 684*4882a593Smuzhiyun xf86DPMSSetProc *DPMSSet; 685*4882a593Smuzhiyun xf86LoadPaletteProc *LoadPalette; 686*4882a593Smuzhiyun xf86SetOverscanProc *SetOverscan; 687*4882a593Smuzhiyun xorgDriverFuncProc *DriverFunc; 688*4882a593Smuzhiyun xf86ModeSetProc *ModeSet; 689*4882a593Smuzhiyun 690*4882a593Smuzhiyun int reservedInt[NUM_RESERVED_INTS]; 691*4882a593Smuzhiyun void *reservedPtr[NUM_RESERVED_POINTERS]; 692*4882a593Smuzhiyun funcPointer reservedFuncs[NUM_RESERVED_FUNCS]; 693*4882a593Smuzhiyun } ScrnInfoRec; 694*4882a593Smuzhiyun 695*4882a593Smuzhiyun typedef struct { 696*4882a593Smuzhiyun Bool (*OpenFramebuffer) (ScrnInfoPtr pScrn, 697*4882a593Smuzhiyun char **name, 698*4882a593Smuzhiyun unsigned char **mem, 699*4882a593Smuzhiyun int *size, int *offset, int *extra); 700*4882a593Smuzhiyun void (*CloseFramebuffer) (ScrnInfoPtr pScrn); 701*4882a593Smuzhiyun Bool (*SetMode) (ScrnInfoPtr pScrn, DGAModePtr pMode); 702*4882a593Smuzhiyun void (*SetViewport) (ScrnInfoPtr pScrn, int x, int y, int flags); 703*4882a593Smuzhiyun int (*GetViewport) (ScrnInfoPtr pScrn); 704*4882a593Smuzhiyun void (*Sync) (ScrnInfoPtr); 705*4882a593Smuzhiyun void (*FillRect) (ScrnInfoPtr pScrn, 706*4882a593Smuzhiyun int x, int y, int w, int h, unsigned long color); 707*4882a593Smuzhiyun void (*BlitRect) (ScrnInfoPtr pScrn, 708*4882a593Smuzhiyun int srcx, int srcy, int w, int h, int dstx, int dsty); 709*4882a593Smuzhiyun void (*BlitTransRect) (ScrnInfoPtr pScrn, 710*4882a593Smuzhiyun int srcx, int srcy, 711*4882a593Smuzhiyun int w, int h, 712*4882a593Smuzhiyun int dstx, int dsty, unsigned long color); 713*4882a593Smuzhiyun } DGAFunctionRec, *DGAFunctionPtr; 714*4882a593Smuzhiyun 715*4882a593Smuzhiyun typedef struct _SymTabRec { 716*4882a593Smuzhiyun int token; /* id of the token */ 717*4882a593Smuzhiyun const char *name; /* token name */ 718*4882a593Smuzhiyun } SymTabRec, *SymTabPtr; 719*4882a593Smuzhiyun 720*4882a593Smuzhiyun /* flags for xf86LookupMode */ 721*4882a593Smuzhiyun typedef enum { 722*4882a593Smuzhiyun LOOKUP_DEFAULT = 0, /* Use default mode lookup method */ 723*4882a593Smuzhiyun LOOKUP_BEST_REFRESH, /* Pick modes with best refresh */ 724*4882a593Smuzhiyun LOOKUP_CLOSEST_CLOCK, /* Pick modes with the closest clock */ 725*4882a593Smuzhiyun LOOKUP_LIST_ORDER, /* Pick first useful mode in list */ 726*4882a593Smuzhiyun LOOKUP_CLKDIV2 = 0x0100, /* Allow half clocks */ 727*4882a593Smuzhiyun LOOKUP_OPTIONAL_TOLERANCES = 0x0200 /* Allow missing hsync/vrefresh */ 728*4882a593Smuzhiyun } LookupModeFlags; 729*4882a593Smuzhiyun 730*4882a593Smuzhiyun #define NoDepth24Support 0x00 731*4882a593Smuzhiyun #define Support24bppFb 0x01 /* 24bpp framebuffer supported */ 732*4882a593Smuzhiyun #define Support32bppFb 0x02 /* 32bpp framebuffer supported */ 733*4882a593Smuzhiyun #define SupportConvert24to32 0x04 /* Can convert 24bpp pixmap to 32bpp */ 734*4882a593Smuzhiyun #define SupportConvert32to24 0x08 /* Can convert 32bpp pixmap to 24bpp */ 735*4882a593Smuzhiyun #define PreferConvert24to32 0x10 /* prefer 24bpp pixmap to 32bpp conv */ 736*4882a593Smuzhiyun #define PreferConvert32to24 0x20 /* prefer 32bpp pixmap to 24bpp conv */ 737*4882a593Smuzhiyun 738*4882a593Smuzhiyun /* For DPMS */ 739*4882a593Smuzhiyun typedef void (*DPMSSetProcPtr) (ScrnInfoPtr, int, int); 740*4882a593Smuzhiyun 741*4882a593Smuzhiyun /* Input handler proc */ 742*4882a593Smuzhiyun typedef void (*InputHandlerProc) (int fd, void *data); 743*4882a593Smuzhiyun 744*4882a593Smuzhiyun /* These are used by xf86GetClocks */ 745*4882a593Smuzhiyun #define CLK_REG_SAVE -1 746*4882a593Smuzhiyun #define CLK_REG_RESTORE -2 747*4882a593Smuzhiyun 748*4882a593Smuzhiyun /* 749*4882a593Smuzhiyun * misc constants 750*4882a593Smuzhiyun */ 751*4882a593Smuzhiyun #define INTERLACE_REFRESH_WEIGHT 1.5 752*4882a593Smuzhiyun #define SYNC_TOLERANCE 0.01 /* 1 percent */ 753*4882a593Smuzhiyun #define CLOCK_TOLERANCE 2000 /* Clock matching tolerance (2MHz) */ 754*4882a593Smuzhiyun 755*4882a593Smuzhiyun #define OVERLAY_8_32_DUALFB 0x00000001 756*4882a593Smuzhiyun #define OVERLAY_8_24_DUALFB 0x00000002 757*4882a593Smuzhiyun #define OVERLAY_8_16_DUALFB 0x00000004 758*4882a593Smuzhiyun #define OVERLAY_8_32_PLANAR 0x00000008 759*4882a593Smuzhiyun 760*4882a593Smuzhiyun /* Values of xf86Info.mouseFlags */ 761*4882a593Smuzhiyun #define MF_CLEAR_DTR 1 762*4882a593Smuzhiyun #define MF_CLEAR_RTS 2 763*4882a593Smuzhiyun 764*4882a593Smuzhiyun /* Action Events */ 765*4882a593Smuzhiyun typedef enum { 766*4882a593Smuzhiyun ACTION_TERMINATE = 0, /* Terminate Server */ 767*4882a593Smuzhiyun ACTION_NEXT_MODE = 10, /* Switch to next video mode */ 768*4882a593Smuzhiyun ACTION_PREV_MODE, 769*4882a593Smuzhiyun ACTION_SWITCHSCREEN = 100, /* VT switch */ 770*4882a593Smuzhiyun ACTION_SWITCHSCREEN_NEXT, 771*4882a593Smuzhiyun ACTION_SWITCHSCREEN_PREV, 772*4882a593Smuzhiyun } ActionEvent; 773*4882a593Smuzhiyun 774*4882a593Smuzhiyun #endif /* _XF86STR_H */ 775