(file) Return to xf86str.h CVS log (file) (dir) Up to [XFree86 CVS] / xc / programs / Xserver / hw / xfree86 / common

  1 dawes 1.40 /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.39 1999/06/12 17:30:18 dawes Exp $ */
  2 dawes 1.2  
  3            /*
  4             * Copyright (c) 1997 by The XFree86 Project, Inc.
  5             */
  6            
  7            /*
  8             * This file contains definitions of the public XFree86 data structures/types.
  9             * Any data structures that video drivers need to access should go here.
 10             */
 11            
 12            #ifndef _XF86STR_H
 13            #define _XF86STR_H
 14            
 15            #include "misc.h"
 16            #include "input.h"
 17            #include "scrnintstr.h"
 18            #include "xf86Module.h"
 19            
 20            /* Video mode flags */
 21            
 22            typedef enum {
 23 dawes 1.2      V_PHSYNC	= 0x0001,
 24                V_NHSYNC	= 0x0002,
 25                V_PVSYNC	= 0x0004,
 26                V_NVSYNC	= 0x0008,
 27                V_INTERLACE	= 0x0010,
 28                V_DBLSCAN	= 0x0020,
 29                V_CSYNC	= 0x0040,
 30                V_PCSYNC	= 0x0080,
 31                V_NCSYNC	= 0x0100,
 32                V_HSKEW	= 0x0200,	/* hskew provided */
 33                V_PIXMUX	= 0x1000,
 34                V_DBLCLK	= 0x2000,
 35                V_CLKDIV2	= 0x4000
 36            } ModeFlags;
 37            
 38            typedef enum {
 39                INTERLACE_HALVE_V	= 0x0001	/* Halve V values for interlacing */
 40            } CrtcAdjustFlags;
 41            
 42            
 43            /* These are possible return values for xf86CheckMode() and ValidMode() */
 44 dawes 1.2  typedef enum {
 45                MODE_OK	= 0,	/* Mode OK */
 46                MODE_HSYNC,		/* hsync out of range */
 47                MODE_VSYNC,		/* vsync out of range */
 48                MODE_H_ILLEGAL,	/* mode has illegal horizontal timings */
 49                MODE_V_ILLEGAL,	/* mode has illegal horizontal timings */
 50                MODE_BAD_WIDTH,	/* requires an unsupported linepitch */
 51                MODE_NOMODE,	/* no mode with a maching name */
 52                MODE_NO_INTERLACE,	/* interlaced mode not supported */
 53                MODE_NO_DBLESCAN,	/* doublescan mode not supported */
 54 dawes 1.35     MODE_NO_VSCAN,	/* multiscan mode not supported */
 55 dawes 1.2      MODE_MEM,		/* insufficient video memory */
 56                MODE_VIRTUAL_X,	/* mode width too large for specified virtual size */
 57                MODE_VIRTUAL_Y,	/* mode height too large for specified virtual size */
 58                MODE_MEM_VIRT,	/* insufficient video memory given virtual size */
 59                MODE_NOCLOCK,	/* no fixed clock available */
 60                MODE_CLOCK_HIGH,	/* clock required is too high */
 61                MODE_CLOCK_LOW,	/* clock required is too low */
 62                MODE_CLOCK_RANGE,	/* clock/mode isn't in a ClockRange */
 63                MODE_BAD_HVALUE,	/* horizontal timing was out of range */
 64                MODE_BAD_VVALUE,	/* vertical timing was out of range */
 65 dawes 1.35     MODE_BAD_VSCAN,	/* VScan value out of range */
 66                MODE_HSYNC_NARROW,	/* horizontal sync too narrow */
 67                MODE_HSYNC_WIDE,	/* horizontal sync too wide */
 68                MODE_HBLANK_NARROW,	/* horizontal blanking too narrow */
 69                MODE_HBLANK_WIDE,	/* horizontal blanking too wide */
 70                MODE_VSYNC_NARROW,	/* vertical sync too narrow */
 71                MODE_VSYNC_WIDE,	/* vertical sync too wide */
 72                MODE_VBLANK_NARROW,	/* vertical blanking too narrow */
 73                MODE_VBLANK_WIDE,	/* vertical blanking too wide */
 74                MODE_BAD = -2,	/* unspecified reason */
 75 dawes 1.2      MODE_ERROR	= -1	/* error condition */
 76            } ModeStatus;
 77            
 78 dawes 1.8  # define M_T_BUILTIN 0x01        /* built-in mode */
 79            # define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */
 80            # define M_T_CRTC_C  (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC  */
 81            # define M_T_CLOCK_CRTC_C  (M_T_CLOCK_C | M_T_CRTC_C)
 82                                           /* built-in mode - configure CRTC and clock */
 83 hohndel 1.23 # define M_T_DEFAULT 0x10	/* (VESA) default modes */
 84 dawes   1.2  /* Video mode */
 85              
 86              typedef struct _DisplayModeRec {
 87                  struct _DisplayModeRec *	prev;
 88                  struct _DisplayModeRec *	next;
 89                  char *			name;		/* identifier for the mode */
 90                  ModeStatus			status;
 91 dawes   1.37     int				type;
 92 dawes   1.8      
 93 dawes   1.2      /* These are the values that the user sees/provides */
 94                  int				Clock;		/* pixel clock freq */
 95                  int				HDisplay;	/* horizontal timing */
 96                  int				HSyncStart;
 97                  int				HSyncEnd;
 98                  int				HTotal;
 99                  int				HSkew;
100                  int				VDisplay;	/* vertical timing */
101                  int				VSyncStart;
102                  int				VSyncEnd;
103                  int				VTotal;
104                  int				VScan;
105                  int				Flags;
106              
107                /* These are the values the hardware uses */
108                  int				ClockIndex;
109                  int				SynthClock;	/* Actual clock freq to
110              					  	 * be programmed */
111                  int				CrtcHDisplay;
112                  int				CrtcHBlankStart;
113                  int				CrtcHSyncStart;
114 dawes   1.2      int				CrtcHSyncEnd;
115                  int				CrtcHBlankEnd;
116                  int				CrtcHTotal;
117                  int				CrtcHSkew;
118                  int				CrtcVDisplay;
119                  int				CrtcVBlankStart;
120                  int				CrtcVSyncStart;
121                  int				CrtcVSyncEnd;
122                  int				CrtcVBlankEnd;
123                  int				CrtcVTotal;
124                  Bool			CrtcHAdjusted;
125                  Bool			CrtcVAdjusted;
126                  int				PrivSize;
127                  INT32 *			Private;
128 dawes   1.4      int				PrivFlags;
129 dawes   1.2  } DisplayModeRec, *DisplayModePtr;
130              
131              /* The monitor description */
132              
133              #define MAX_HSYNC 8
134              #define MAX_VREFRESH 8
135              
136              typedef struct { float hi, lo; } range;
137              
138              typedef struct { CARD32 red, green, blue; } rgb;
139              
140              typedef struct { float red, green, blue; } Gamma;
141              
142 dawes   1.10 /* The permitted gamma range is 1 / GAMMA_MAX <= g <= GAMMA_MAX */
143              #define GAMMA_MAX	10.0
144              #define GAMMA_MIN	(1.0 / GAMMA_MAX)
145              #define GAMMA_ZERO	(GAMMA_MIN / 100.0)
146              
147 dawes   1.2  typedef struct {
148                  char *		id;
149                  char *		vendor;
150                  char *		model;
151                  int			nHsync;
152 dawes   1.37     range		hsync[MAX_HSYNC];
153                  int			nVrefresh;
154 dawes   1.2      range		vrefresh[MAX_VREFRESH];
155                  DisplayModePtr	Modes;		/* Start of the monitor's mode list */
156                  DisplayModePtr	Last;		/* End of the monitor's mode list */
157 dawes   1.10     Gamma		gamma;		/* Gamma of the monitor */
158 dawes   1.2      int			widthmm;
159                  int			heightmm;
160                  pointer		options;
161 dawes   1.30     pointer		DDC;
162 dawes   1.2  } MonRec, *MonPtr;
163              
164              /* the list of clock ranges */
165              typedef struct x_ClockRange {
166                  struct x_ClockRange *next;
167                  int			minClock;
168                  int			maxClock;
169                  int			clockIndex;	/* -1 for programmable clocks */
170                  Bool		interlaceAllowed;
171                  Bool		doubleScanAllowed;
172 dawes   1.4      int			ClockMulFactor;
173                  int			ClockDivFactor;
174                  int			PrivFlags;
175 dawes   1.2  } ClockRange, *ClockRangePtr;
176              
177 dawes   1.37 /*
178               * The driver list struct.  This contains the information required for each
179               * driver before a ScrnInfoRec has been allocated.
180               */
181              typedef struct _DriverRec {
182                  int			driverVersion;
183                  char *		driverName;
184                  void		(*Identify)(int flags);
185                  Bool		(*Probe)(struct _DriverRec *drv, int flags);
186                  pointer		module;
187                  int			refCount;
188              } DriverRec, *DriverPtr;
189              
190              /*
191               * These are the private bus types.  New types can be added here.  Types
192               * required for the public interface should be added to xf86str.h, with
193               * function prototypes added to xf86.h.
194               */
195 dawes   1.2  
196              typedef enum {
197 dawes   1.37     BUS_NONE,
198                  BUS_ISA,
199                  BUS_PCI
200              } BusType;
201 dawes   1.2  
202 dawes   1.6  typedef struct {
203 dawes   1.37     int		bus;
204                  int		device;
205                  int		func;
206              } PciBusId;
207                  
208              typedef struct {
209                  unsigned int dummy;
210              } IsaBusId;
211 dawes   1.8  
212 dawes   1.37 typedef struct _bus {
213                  BusType type;
214                  union {
215              	IsaBusId isa;
216              	PciBusId pci;
217                  } id;
218              } BusRec, *BusPtr;
219 dawes   1.2  
220              #define MAXCLOCKS   128
221              typedef enum {
222                  DAC_BPP8 = 0,
223                  DAC_BPP16,
224                  DAC_BPP24,
225                  DAC_BPP32,
226                  MAXDACSPEEDS
227              } DacSpeedIndex;
228               
229              typedef struct {
230                 char *			identifier;
231                 char *			vendor;
232                 char *			board;
233                 char *			chipset;
234                 char *			ramdac;
235                 char *			driver;
236                 struct _confscreenrec *	myScreenSection;
237                 Bool				claimed;
238                 int				dacSpeeds[MAXDACSPEEDS];
239                 int				numclocks;
240 dawes   1.2     int				clock[MAXCLOCKS];
241                 char *			clockchip;
242                 char *			busID;
243 dawes   1.37    Bool				active;
244                 Bool				inUse;
245 dawes   1.2     int				videoRam;
246                 int				textClockFreq;
247 hohndel 1.19    unsigned long		BiosBase;	/* Base address of video BIOS */
248 dawes   1.2     unsigned long		MemBase;	/* Frame buffer base address */
249                 unsigned long		IOBase;
250                 int				chipID;
251                 int				chipRev;
252                 pointer			options;
253              } GDevRec, *GDevPtr;
254              
255 dawes   1.37 typedef int (*FindIsaDevProc)(GDevPtr dev);
256              
257 dawes   1.2  typedef struct {
258 dawes   1.27    char *			identifier;
259                 char *			driver;
260                 pointer		 	commonOptions;
261                 pointer			extraOptions;
262              } IDevRec, *IDevPtr;
263              
264              typedef struct {
265 dawes   1.2      int			vendor;
266                  int			chipType;
267                  int			chipRev;
268 dawes   1.16     int			subsysVendor;
269                  int			subsysCard;
270 dawes   1.2      int			bus;
271                  int			device;
272                  int			func;
273                  int			class;
274                  int			subclass;
275                  int			interface;
276                  unsigned long	memBase[6];
277                  unsigned long	ioBase[6];
278 dawes   1.16     int			size[6];
279                  unsigned char	type[6];
280 dawes   1.2      unsigned long	biosBase;
281 dawes   1.16     int			biosSize;
282 dawes   1.2      pointer		thisCard;
283              } pciVideoRec, *pciVideoPtr;
284              
285              typedef struct {
286                  int			frameX0;
287                  int			frameY0;
288                  int			virtualX;
289                  int			virtualY;
290                  int			depth;
291 dawes   1.14     int			fbbpp;
292 dawes   1.2      rgb			weight;
293 dawes   1.30     rgb			blackColour;
294                  rgb			whiteColour;
295 dawes   1.2      int			defaultVisual;
296                  char **		modes;
297                  pointer		options;
298              } DispRec, *DispPtr;
299              
300 dawes   1.24 typedef struct _confxvportrec {
301                  char *		identifier;
302                  pointer		options;
303              } confXvPortRec, *confXvPortPtr;
304              
305              typedef struct _confxvadaptrec {
306                  char *		identifier;
307                  int			numports;
308                  confXvPortPtr	ports;
309                  pointer		options;
310              } confXvAdaptorRec, *confXvAdaptorPtr;
311              
312 dawes   1.2  typedef struct _confscreenrec {
313                  char *		id;
314 dawes   1.25     int			screennum;
315 dawes   1.2      int			defaultdepth;
316                  int			defaultbpp;
317                  int			defaultfbbpp;
318                  MonPtr		monitor;
319                  GDevPtr		device;
320                  int			numdisplays;
321                  DispPtr		displays;
322 dawes   1.24     int			numxvadaptors;
323                  confXvAdaptorPtr	xvadaptors;
324 dawes   1.2      pointer		options;
325              } confScreenRec, *confScreenPtr;
326              
327              typedef struct _screenlayoutrec {
328                  confScreenPtr	screen;
329                  confScreenPtr	top;
330                  confScreenPtr	bottom;
331                  confScreenPtr	left;
332                  confScreenPtr	right;
333              } screenLayoutRec, *screenLayoutPtr;
334              
335 dawes   1.13 typedef struct _serverlayoutrec {
336                  char *		id;
337                  screenLayoutPtr	screens;
338                  GDevPtr		inactives;
339 dawes   1.27     IDevPtr		inputs;
340 dawes   1.13     pointer		options;
341              } serverLayoutRec, *serverLayoutPtr;
342                  
343 dawes   1.2  /* These values should be adjusted when new fields are added to ScrnInfoRec */
344              #define NUM_RESERVED_INTS		16
345              #define NUM_RESERVED_POINTERS		16
346              #define NUM_RESERVED_FUNCS		16
347              
348              typedef pointer (*funcPointer)(void);
349              
350              /* Flags for driver messages */
351              typedef enum {
352                  X_PROBED,			/* Value was probed */
353                  X_CONFIG,			/* Value was given in the config file */
354                  X_DEFAULT,			/* Value is a default */
355                  X_CMDLINE,			/* Value was given on the command line */
356                  X_NOTICE,			/* Notice */
357                  X_ERROR,			/* Error message */
358                  X_WARNING,			/* Warning message */
359                  X_INFO,			/* Informational message */
360                  X_NONE			/* No prefix */
361              } MessageType;
362              
363 dawes   1.14 /* flags for depth 24 pixmap options */
364              typedef enum {
365                  Pix24DontCare = 0,
366                  Pix24Use24,
367                  Pix24Use32
368              } Pix24Flags;
369              
370 dawes   1.17 /* flags for SaveRestoreImage */
371              typedef enum {
372                  SaveImage,
373                  RestoreImage,
374                  FreeImage
375              } SaveRestoreFlags;
376              
377 dawes   1.2  /*
378 dawes   1.6   * The IO access enabler struct. This contains the address for 
379               * the IOEnable/IODisable funcs for their specific bus along
380               * with a pointer to data needed by them
381               */
382              typedef struct _AccessRec {
383                  void (*AccessDisable)(void *arg);
384                  void (*AccessEnable)(void *arg);
385                  void *arg;
386              } xf86AccessRec, *xf86AccessPtr;
387              
388 dawes   1.37 /*  bus-access-related types */
389              typedef enum {
390                  NONE,
391                  IO,
392                  MEM_IO,
393                  MEM
394              } resType;
395 dawes   1.6  
396 dawes   1.37 typedef struct _EntityAccessRec {
397                  xf86AccessPtr fallback;
398 dawes   1.6      xf86AccessPtr pAccess;
399                  resType rt;
400 dawes   1.37     pointer  busAcc;
401                  struct _EntityAccessRec *next;
402              } EntityAccessRec, *EntityAccessPtr;
403              
404              typedef struct _CurrAccRec {
405                  EntityAccessPtr pMemAccess;
406                  EntityAccessPtr pIoAccess;
407              } xf86CurrentAccessRec, *xf86CurrentAccessPtr;
408 dawes   1.26 
409              /* new RAC */
410              
411              /* Resource Type values */
412              #define ResNone		-1
413              
414 dawes   1.37 #define ResMem		0x0001
415              #define ResIo		0x0002
416 dawes   1.26 #define ResPhysMask	0x000F
417              
418 dawes   1.37 #define ResExclusive	0x0010
419              #define ResShared	0x0020
420              #define ResAny		0x0040
421              #define ResAccMask	0x0070
422              #define ResUnused	0x0080
423              
424              #define ResUnusedOpr	0x0100
425              #define ResDisableOpr	0x0200
426              #define ResOprMask	0x0300
427              
428              #define ResBlock	0x0400
429              #define ResSparse	0x0800
430              #define ResExtMask	0x0C00
431 dawes   1.26 
432              #define ResMinimised	0x1000
433 dawes   1.37 #define ResInit 	0x2000
434              #define ResBios		0x4000
435 dawes   1.26 #define ResMiscMask	0xF000
436              
437 dawes   1.37 #define ResEnd		ResNone
438              
439              #define ResExcMemBlock		(ResMem | ResExclusive | ResBlock)
440              #define ResExcIoBlock		(ResIo | ResExclusive | ResBlock)
441              #define ResShrMemBlock		(ResMem | ResShared | ResBlock)
442              #define ResShrIoBlock		(ResIo | ResShared | ResBlock)
443              #define ResExcUusdMemBlock	(ResMem | ResExclusive | ResUnused | ResBlock)
444              #define ResExcUusdIoBlock	(ResIo | ResExclusive | ResUnused | ResBlock)
445              #define ResShrUusdMemBlock	(ResMem | ResShared | ResUnused | ResBlock)
446              #define ResShrUusdIoBlock	(ResIo | ResShared | ResUnused | ResBlock)
447              
448              #define ResExcMemSparse		(ResMem | ResExclusive | ResSparse)
449              #define ResExcIoSparse		(ResIo | ResExclusive | ResSparse)
450              #define ResShrMemSparse		(ResMem | ResShared | ResSparse)
451              #define ResShrIoSparse		(ResIo | ResShared | ResSparse)
452              #define ResUusdMemSparse	(ResMem | ResUnused | ResSparse)
453              #define ResUusdIoSparse		(ResIo | ResUnused | ResSparse)
454 dawes   1.26 
455              #define ResIsMem(r)		(((r)->type & ResPhysMask) == ResMem)
456              #define ResIsIo(r)		(((r)->type & ResPhysMask) == ResIo)
457              #define ResIsExclusive(r)	(((r)->type & ResAccMask) == ResExclusive)
458              #define ResIsShared(r)		(((r)->type & ResAccMask) == ResShared)
459 dawes   1.37 #define ResIsUnused(r)		(((r)->type & ResAccMask) == ResUnused)
460 dawes   1.26 #define ResIsBlock(r)		(((r)->type & ResExtMask) == ResBlock)
461              #define ResIsSparse(r)		(((r)->type & ResExtMask) == ResSparse)
462              #define ResIsMinimised(r)	(((r)->type & ResMiscMask) == ResMinimised)
463              
464 dawes   1.37 typedef struct {
465                  long type;     /* shared, exclusive, unused etc. */
466                  unsigned long a;
467                  unsigned long b;
468              } resRange, *resList;
469              
470              #define RANGE(r,u,v,t) (r).a = (u);\
471                                     (r).b = (v);\
472                                     (r).type = t;
473              
474              #define __base a
475              #define __mask b
476              #define __begin a
477              #define __end b
478              
479              /* resource record */
480 dawes   1.26 typedef struct _resRec *resPtr;
481              typedef struct _resRec {
482 dawes   1.37     resRange    val;
483                  int		entityIndex;	/* who owns the resource */
484 dawes   1.26     resPtr	next;
485              } resRec;
486              
487 dawes   1.38 #define sparse_base	val.__base
488              #define sparse_mask	val.__mask
489              #define block_begin	val.__begin
490              #define block_end	val.__end
491              #define r_type		val.type
492 dawes   1.37 
493              typedef struct {
494                  int numChipset;
495                  resRange *resList;
496              } IsaChipsets;
497              
498              typedef struct { 
499                  int numChipset;
500                  int PCIid;
501                  resRange *resList;
502              } PciChipsets;
503              
504              #define pciPhysMask 0xF0
505              #define pciMem      0x10
506              #define pciIo       0x20
507              #define pciBios     0x30
508              #define pciRegMask  0x0F
509              
510              /* Entity properties */
511              typedef void (*EntityProc)(int entityIndex,pointer private);
512              
513 dawes   1.37 typedef struct _entityInfo {
514                  int index;
515                  BusRec location;
516                  int chipset;
517                  Bool active;
518                  resPtr resources;
519                  GDevPtr device;
520              } EntityInfoRec, *EntityInfoPtr;
521 dawes   1.39 
522              /* server states */
523              
524              typedef enum {
525                  SETUP,
526                  OPERATING
527              } xf86State;
528              
529 dawes   1.6  
530 dawes   1.20 /* DGA */
531              
532              typedef struct {
533                 int num;		/* A unique identifier for the mode (num > 0) */
534                 DisplayModePtr mode;
535                 int flags;		/* DGA_CONCURRENT_ACCESS, etc... */
536                 int imageWidth;	/* linear accessible portion (pixels) */
537                 int imageHeight;
538                 int pixmapWidth;	/* Xlib accessible portion (pixels) */
539                 int pixmapHeight;	/* both fields ignored if no concurrent access */
540                 int bytesPerScanline; 
541                 int byteOrder;	/* MSBFirst, LSBFirst */
542                 int depth;		
543                 int bitsPerPixel;
544                 unsigned long red_mask;
545                 unsigned long green_mask;
546                 unsigned long blue_mask;
547                 int viewportWidth;
548                 int viewportHeight;
549                 int xViewportStep;	/* viewport position granularity */
550                 int yViewportStep;
551 dawes   1.20    int maxViewportX;	/* max viewport origin */
552                 int maxViewportY;
553                 int viewportFlags;	/* types of page flipping possible */
554 dawes   1.28    int offset;		/* offset into physical memory */
555                 unsigned char *address;	/* server's mapped framebuffer */
556 dawes   1.20    int reserved1;
557                 int reserved2;
558              } DGAModeRec, *DGAModePtr;
559              
560              typedef struct {
561                 DGAModePtr mode;
562                 PixmapPtr pPix;
563              } DGADeviceRec, *DGADevicePtr;
564              
565 dawes   1.6  /*
566 dawes   1.2   * ScrnInfoRec
567               *
568               * There is one of these for each screen, and it holds all the screen-specific
569               * information.
570               *
571               * Note: the size and layout must be kept the same across versions.  New
572               * fields are to be added in place of the "reserved*" fields.  No fields
573               * are to be dependent on compile-time defines.
574               */
575              
576 dawes   1.20 
577 dawes   1.2  typedef struct _ScrnInfoRec {
578                  int			driverVersion;
579 dawes   1.37     char *		driverName;		/* canonical name used in */
580              						/* the config file */   
581 dawes   1.2      ScreenPtr		pScreen;		/* Pointer to the ScreenRec */
582                  int			scrnIndex;		/* Number of this screen */
583                  Bool		configured;		/* Is this screen valid */ 
584                  int			origIndex;		/* initial number assigned to
585              						 * this screen before
586              						 * finalising the number of
587              						 * available screens */
588              
589                  /* Display-wide screenInfo values needed by this screen */
590                  int			imageByteOrder;
591                  int			bitmapScanlineUnit;
592                  int			bitmapScanlinePad;
593                  int			bitmapBitOrder;
594                  int			numFormats;
595                  PixmapFormatRec	formats[MAXFORMATS];
596                  PixmapFormatRec	fbFormat;
597              
598                  int			bitsPerPixel;		/* fb bpp */
599 dawes   1.14     Pix24Flags		pixmap24;		/* pixmap pref for depth 24 */
600 dawes   1.2      int			depth;			/* depth of default visual */
601                  MessageType		depthFrom;		/* set from config? */
602                  MessageType		bitsPerPixelFrom;	/* set from config? */
603                  rgb			weight;			/* r/g/b weights */
604                  rgb			mask;			/* rgb masks */
605                  rgb			offset;			/* rgb offsets */
606                  int			rgbBits;		/* Number of bits in r/g/b */
607 dawes   1.10     Gamma		gamma;			/* Gamma of the monitor */
608 dawes   1.2      int			defaultVisual;		/* default visual class */
609                  int			maxHValue;		/* max horizontal timing */
610 dawes   1.36     int			maxVValue;		/* max vertical timing value */
611 dawes   1.2      int			virtualX;		/* Virtual width */
612                  int			virtualY; 		/* Virtual height */
613 dawes   1.36     int			xInc;			/* Horizontal timing increment */
614 dawes   1.2      MessageType		virtualFrom;		/* set from config? */
615                  int			displayWidth;		/* memory pitch */
616                  int			frameX0;		/* viewport position */
617                  int			frameY0;
618                  int			frameX1;
619                  int			frameY1;
620                  int			zoomLocked;		/* Disallow mode changes */
621                  DisplayModePtr	modePool;		/* list of compatible modes */
622                  DisplayModePtr	modes;			/* list of actual modes */
623                  DisplayModePtr	currentMode;		/* current mode
624              						 * This was previously
625              						 * overloaded with the modes
626              						 * field, which is a pointer
627              						 * into a circular list */
628                  confScreenPtr	confScreen;		/* Screen config info */
629                  MonPtr		monitor;		/* Monitor information */
630                  DispPtr		display;		/* Display information */
631 dawes   1.37     int *		entityList;		/* List of device entities */
632                  int			numEntities;
633 dawes   1.2      int			widthmm;		/* physical display dimensions
634              						 * in mm */
635                  int			heightmm;
636                  int			xDpi;			/* width DPI */
637                  int			yDpi;			/* height DPI */
638                  char *		name;			/* Name to prefix messages */
639                  pointer		driverPrivate;		/* Driver private area */
640                  DevUnion *		privates;		/* Other privates can hook in
641              						 * here */
642                  DriverPtr		drv;			/* xf86DriverList[] entry */
643                  pointer		module;			/* Pointer to module head */
644 dawes   1.22     int			colorKey;
645                  int			overlayFlags;
646 dawes   1.2  
647                  /* Some of these may be moved out of here into the driver private area */
648              
649                  char *		chipset;		/* chipset name */
650                  char *		ramdac;			/* ramdac name */
651                  char *		clockchip;		/* clock name */
652                  Bool		progClock;		/* clock is programmable */
653                  int			numClocks;		/* number of clocks */
654                  int			clock[MAXCLOCKS];	/* list of clock frequencies */
655                  int			videoRam;		/* amount of video ram (kb) */
656                  unsigned long	biosBase;		/* Base address of video BIOS */
657 dawes   1.24     unsigned long	memPhysBase;		/* Physical address of FB */
658                  unsigned long 	fbOffset;		/* Offset of FB in the above */
659 dawes   1.2      unsigned long	ioBase;			/* I/O or MMIO base adderss */
660                  int			memClk;			/* memory clock */
661                  int			textClockFreq;		/* clock of text mode */
662                  Bool		flipPixels;		/* swap default black/white */
663                  pointer		options;
664              
665                  int			chipID;
666                  int			chipRev;
667 dawes   1.37     int			racMemFlags;
668                  int			racIoFlags;
669                  pointer		access;
670                  xf86CurrentAccessPtr CurrentAccess;
671                  resType		resourceType;
672                  pointer		busAccess;
673 dawes   1.2      /* Allow screens to be enabled/disabled individually */
674                  Bool		vtSema;
675                  /*
676                   * These can be used when the minor ABI version is incremented.
677                   * The NUM_* parameters must be reduced appropriately to keep the
678                   * structure size and alignment unchanged.
679                   */
680                  int			reservedInt[NUM_RESERVED_INTS];
681                  pointer		reservedPtr[NUM_RESERVED_POINTERS];
682              
683                  /*
684                   * Driver entry points.
685                   *
686                   */
687              
688                  Bool		(*Probe)(DriverPtr drv, int flags);
689                  Bool		(*PreInit)(struct _ScrnInfoRec *pScrn, int flags);
690                  Bool		(*ScreenInit)(int scrnIndex, ScreenPtr pScreen,
691              				      int argc, char **argv);
692                  Bool		(*SwitchMode)(int scrnIndex, DisplayModePtr mode,
693              				      int flags);
694 dawes   1.2      void		(*AdjustFrame)(int scrnIndex, int x, int y, int flags);
695                  Bool		(*EnterVT)(int scrnIndex, int flags);
696                  void		(*LeaveVT)(int scrnIndex, int flags);
697                  void		(*FreeScreen)(int scrnIndex, int flags);
698                  int			(*ValidMode)(int scrnIndex, DisplayModePtr mode,
699              				     Bool verbose, int flags);
700 dawes   1.17     Bool		(*SaveRestoreImage)(int scrnIndex,
701              					    SaveRestoreFlags what);
702 dawes   1.20     int			(*SetDGAMode)(int scrnIndex, int num, 
703              					DGADevicePtr devRet);
704 dawes   1.2      /*
705                   * This can be used when the minor ABI version is incremented.
706                   * The NUM_* parameter must be reduced appropriately to keep the
707                   * structure size and alignment unchanged.
708                   */
709                  funcPointer		reservedFuncs[NUM_RESERVED_FUNCS];
710              
711              } ScrnInfoRec, *ScrnInfoPtr;
712              
713              
714              typedef struct {
715 dawes   1.28    Bool (*OpenFramebuffer)(
716              	ScrnInfoPtr pScrn, 
717              	char **name,
718              	unsigned char **mem, 
719              	int *size,
720              	int *offset,
721                      int *extra
722                 );
723                 void	(*CloseFramebuffer)(ScrnInfoPtr pScrn);
724                 Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode);
725                 void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags);
726 dawes   1.29    int  (*GetViewport)(ScrnInfoPtr pScrn);
727 dawes   1.20    void (*Flush)(ScrnInfoPtr);
728                 void (*FillRect)(
729              	ScrnInfoPtr pScrn, 
730              	int x, int y, int w, int h, 
731              	unsigned long color
732                 );
733                 void (*BlitRect)(
734              	ScrnInfoPtr pScrn, 
735              	int srcx, int srcy, 
736              	int w, int h, 
737              	int dstx, int dsty
738                 );
739                 void (*BlitTransRect)(
740              	ScrnInfoPtr pScrn, 
741              	int srcx, int srcy, 
742              	int w, int h, 
743              	int dstx, int dsty,
744              	unsigned long color
745                 );
746              } DGAFunctionRec, *DGAFunctionPtr;
747              
748 dawes   1.20 typedef struct {
749 dawes   1.2      int			token;		/* id of the token */
750                  const char *	name;		/* token name */
751              } SymTabRec, *SymTabPtr;
752              
753              
754              /* These are the possible flags for ValidMode */
755              typedef enum {
756                  MODE_USED,		/* this mode is really being used in the */
757              			/* modes line of the Display Subsection  */
758                  MODE_SUGGESTED,	/* this mode is included in the available*/
759              			/* modes in the Monitor Section */
760                  MODE_VID		/* this is called from the VidMode extension */
761              } ValidModeFlags;
762              
763              /* flags for xf86LookupMode */
764              typedef enum {
765                  LOOKUP_DEFAULT		= 0,	/* Use default mode lookup method */
766                  LOOKUP_BEST_REFRESH,		/* Pick modes with best refresh */
767                  LOOKUP_CLOSEST_CLOCK,		/* Pick modes with the closest clock */
768                  LOOKUP_LIST_ORDER,			/* Pick first useful mode in list */
769                  LOOKUP_CLKDIV2		= 0x0100 /* Allow half clocks */
770 dawes   1.2  } LookupModeFlags;
771              
772 dawes   1.40 #define NoDepth24Support	0x00
773              #define Support24bppFb		0x01	/* 24bpp framebuffer supported */
774              #define Support32bppFb		0x02	/* 32bpp framebuffer supported */
775              #define SupportConvert24to32	0x04	/* Can convert 24bpp pixmap to 32bpp */
776              #define SupportConvert32to24	0x08	/* Can convert 32bpp pixmap to 24bpp */
777              #define PreferConvert24to32	0x10	/* prefer 24bpp pixmap to 32bpp conv */
778              #define PreferConvert32to24	0x20	/* prefer 32bpp pixmap to 24bpp conv */
779 dawes   1.2  
780 dawes   1.34 #ifndef NEW_INPUT
781 dawes   1.2  /*
782               * mouse protocol types
783               */
784              typedef enum {
785 dawes   1.3      PROT_OSMOUSE = -1,
786 dawes   1.2      PROT_MS			= 0,	/* Microsoft */
787                  PROT_MSC,				/* Mouse Systems Corp */
788                  PROT_MM,				/* MMseries */
789                  PROT_LOGI,				/* Logitech */
790                  PROT_BM,				/* BusMouse ??? */
791                  PROT_LOGIMAN,			/* MouseMan / TrackMan */
792                  PROT_PS2,				/* PS/2 mouse */
793                  PROT_MMHIT,				/* MM_HitTab */
794                  PROT_GLIDEPOINT,			/* ALPS serial GlidePoint */
795                  PROT_IMSERIAL,			/* Microsoft serial IntelliMouse */
796                  PROT_THINKING,			/* Kensington serial ThinkingMouse */
797                  PROT_IMPS2,				/* Microsoft PS/2 IntelliMouse */
798                  PROT_THINKINGPS2,			/* Kensington PS/2 ThinkingMouse */
799                  PROT_MMANPLUSPS2,			/* Logitech PS/2 MouseMan+ */
800                  PROT_GLIDEPOINTPS2,			/* ALPS PS/2 GlidePoint */
801                  PROT_NETPS2,			/* Genius PS/2 NetMouse */
802                  PROT_NETSCROLLPS2,			/* Genius PS/2 NetScroll */
803                  PROT_SYSMOUSE,			/* SysMouse */
804 dawes   1.12     PROT_WSMOUSE,			/* wsmouse (NetBSD) */
805 dawes   1.24     PROT_SUN,				/* Sun Microsystems */
806 dawes   1.2      PROT_AUTO,				/* automatic */
807 dawes   1.21     PROT_ACECAD,			/* Acecad tablets */
808 dawes   1.2      NUM_PROTOCOLS			/* MUST BE LAST */
809              } MouseProtocol;
810 dawes   1.34 #endif
811 dawes   1.2  
812              
813              /* For DPMS */
814              typedef void (*DPMSSetProcPtr)(ScrnInfoPtr, int, int);
815 dawes   1.40 
816              /* Input handler proc */
817              typedef void (*InputHandlerProc)(int fd, pointer data);
818 dawes   1.2  
819              /* These are used by xf86GetClocks */
820              #define CLK_REG_SAVE		-1
821              #define CLK_REG_RESTORE		-2
822              
823              /*
824               * misc constants
825               */
826              #define INTERLACE_REFRESH_WEIGHT	1.5
827              #define SYNC_TOLERANCE		0.01	/* 1 percent */
828              #define CLOCK_TOLERANCE		2000	/* Clock matching tolerance (2MHz) */
829 dawes   1.22 
830              
831              #define OVERLAY_8_32_DUALFB	0x00000001
832              #define OVERLAY_8_24_DUALFB	0x00000002
833              #define OVERLAY_8_16_DUALFB	0x00000004
834              #define OVERLAY_8_32_PLANAR	0x00000008
835 dawes   1.2  
836              #if 0
837              #define LD_RESOLV_IFDONE		0	/* only check if no more 
838              						   delays pending */
839              #define LD_RESOLV_NOW			1	/* finish one delay step */
840              #define LD_RESOLV_FORCE			2	/* force checking... */
841              #endif
842              
843              #endif /* _XF86STR_H */

Powered by
ViewCVS 0.9.2