displaymode.h revision 9207c819
1#ifdef HAVE_DIX_CONFIG_H
2#include <dix-config.h>
3#endif
4
5#ifndef _DISMODEPROC_H_
6#define _DISMODEPROC_H_
7
8#include "scrnintstr.h"
9
10#define MAXCLOCKS   128
11
12/* These are possible return values for xf86CheckMode() and ValidMode() */
13typedef enum {
14    MODE_OK = 0,                /* Mode OK */
15    MODE_HSYNC,                 /* hsync out of range */
16    MODE_VSYNC,                 /* vsync out of range */
17    MODE_H_ILLEGAL,             /* mode has illegal horizontal timings */
18    MODE_V_ILLEGAL,             /* mode has illegal horizontal timings */
19    MODE_BAD_WIDTH,             /* requires an unsupported linepitch */
20    MODE_NOMODE,                /* no mode with a matching name */
21    MODE_NO_INTERLACE,          /* interlaced mode not supported */
22    MODE_NO_DBLESCAN,           /* doublescan mode not supported */
23    MODE_NO_VSCAN,              /* multiscan mode not supported */
24    MODE_MEM,                   /* insufficient video memory */
25    MODE_VIRTUAL_X,             /* mode width too large for specified virtual size */
26    MODE_VIRTUAL_Y,             /* mode height too large for specified virtual size */
27    MODE_MEM_VIRT,              /* insufficient video memory given virtual size */
28    MODE_NOCLOCK,               /* no fixed clock available */
29    MODE_CLOCK_HIGH,            /* clock required is too high */
30    MODE_CLOCK_LOW,             /* clock required is too low */
31    MODE_CLOCK_RANGE,           /* clock/mode isn't in a ClockRange */
32    MODE_BAD_HVALUE,            /* horizontal timing was out of range */
33    MODE_BAD_VVALUE,            /* vertical timing was out of range */
34    MODE_BAD_VSCAN,             /* VScan value out of range */
35    MODE_HSYNC_NARROW,          /* horizontal sync too narrow */
36    MODE_HSYNC_WIDE,            /* horizontal sync too wide */
37    MODE_HBLANK_NARROW,         /* horizontal blanking too narrow */
38    MODE_HBLANK_WIDE,           /* horizontal blanking too wide */
39    MODE_VSYNC_NARROW,          /* vertical sync too narrow */
40    MODE_VSYNC_WIDE,            /* vertical sync too wide */
41    MODE_VBLANK_NARROW,         /* vertical blanking too narrow */
42    MODE_VBLANK_WIDE,           /* vertical blanking too wide */
43    MODE_PANEL,                 /* exceeds panel dimensions */
44    MODE_INTERLACE_WIDTH,       /* width too large for interlaced mode */
45    MODE_ONE_WIDTH,             /* only one width is supported */
46    MODE_ONE_HEIGHT,            /* only one height is supported */
47    MODE_ONE_SIZE,              /* only one resolution is supported */
48    MODE_NO_REDUCED,            /* monitor doesn't accept reduced blanking */
49    MODE_BANDWIDTH,             /* mode requires too much memory bandwidth */
50    MODE_BAD = -2,              /* unspecified reason */
51    MODE_ERROR = -1             /* error condition */
52} ModeStatus;
53
54/* Video mode */
55typedef struct _DisplayModeRec {
56    struct _DisplayModeRec *prev;
57    struct _DisplayModeRec *next;
58    /* dozens of drivers write to this value */
59    /*const*/ char *name;           /* identifier for the mode */
60    ModeStatus status;
61    int type;
62
63    /* These are the values that the user sees/provides */
64    int Clock;                  /* pixel clock freq (kHz) */
65    int HDisplay;               /* horizontal timing */
66    int HSyncStart;
67    int HSyncEnd;
68    int HTotal;
69    int HSkew;
70    int VDisplay;               /* vertical timing */
71    int VSyncStart;
72    int VSyncEnd;
73    int VTotal;
74    int VScan;
75    int Flags;
76
77    /* These are the values the hardware uses */
78    int ClockIndex;
79    int SynthClock;             /* Actual clock freq to
80                                 * be programmed  (kHz) */
81    int CrtcHDisplay;
82    int CrtcHBlankStart;
83    int CrtcHSyncStart;
84    int CrtcHSyncEnd;
85    int CrtcHBlankEnd;
86    int CrtcHTotal;
87    int CrtcHSkew;
88    int CrtcVDisplay;
89    int CrtcVBlankStart;
90    int CrtcVSyncStart;
91    int CrtcVSyncEnd;
92    int CrtcVBlankEnd;
93    int CrtcVTotal;
94    Bool CrtcHAdjusted;
95    Bool CrtcVAdjusted;
96    int PrivSize;
97    INT32 *Private;
98    int PrivFlags;
99
100    float HSync, VRefresh;
101} DisplayModeRec, *DisplayModePtr;
102
103#endif
104