diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2016-02-04 16:23:51 +0100 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2016-02-17 11:21:47 +0100 |
commit | 0bab9d6e81db2d64dcb1606ffea082a2b7152c6d (patch) | |
tree | d3c3623cac7f980ed0f62f2be53b4597f46e5602 | |
parent | 238af3eb1fbbc5a4bf0f7c64896a54b98a7bac45 (diff) |
vidmode: move display mode definitions
To be able to reuse the VidMode extension in a non-hardware server, the
display mode definitions need to be accessible from DIX.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
-rw-r--r-- | hw/xfree86/common/xf86str.h | 92 | ||||
-rw-r--r-- | include/Makefile.am | 1 | ||||
-rw-r--r-- | include/displaymode.h | 102 |
3 files changed, 104 insertions, 91 deletions
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index a58fafebd..5e6e97778 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -41,6 +41,7 @@ #include "colormapst.h" #include "xf86Module.h" #include "xf86Opt.h" +#include "displaymode.h" /** * Integer type that is of the size of the addressable memory (machine size). @@ -84,48 +85,6 @@ typedef enum { MODECHECK_FINAL = 1 } ModeCheckFlags; -/* 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_NO_VSCAN, /* multiscan 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_VSCAN, /* VScan value out of range */ - MODE_HSYNC_NARROW, /* horizontal sync too narrow */ - MODE_HSYNC_WIDE, /* horizontal sync too wide */ - MODE_HBLANK_NARROW, /* horizontal blanking too narrow */ - MODE_HBLANK_WIDE, /* horizontal blanking too wide */ - MODE_VSYNC_NARROW, /* vertical sync too narrow */ - MODE_VSYNC_WIDE, /* vertical sync too wide */ - MODE_VBLANK_NARROW, /* vertical blanking too narrow */ - MODE_VBLANK_WIDE, /* vertical blanking too wide */ - MODE_PANEL, /* exceeds panel dimensions */ - MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */ - MODE_ONE_WIDTH, /* only one width is supported */ - MODE_ONE_HEIGHT, /* only one height is supported */ - MODE_ONE_SIZE, /* only one resolution is supported */ - MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */ - MODE_BANDWIDTH, /* mode requires too much memory bandwidth */ - MODE_BAD = -2, /* unspecified reason */ - MODE_ERROR = -1 /* error condition */ -} ModeStatus; - /* * The mode sets are, from best to worst: USERDEF, DRIVER, and DEFAULT/BUILTIN. * Preferred will bubble a mode to the top within a set. @@ -141,54 +100,6 @@ typedef enum { #define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */ #define M_T_USERPREF 0x80 /* mode preferred by the user config */ -/* Video mode */ -typedef struct _DisplayModeRec { - struct _DisplayModeRec *prev; - struct _DisplayModeRec *next; - const char *name; /* identifier for the mode */ - ModeStatus status; - int type; - - /* These are the values that the user sees/provides */ - int Clock; /* pixel clock freq (kHz) */ - int HDisplay; /* horizontal timing */ - int HSyncStart; - int HSyncEnd; - int HTotal; - int HSkew; - int VDisplay; /* vertical timing */ - int VSyncStart; - int VSyncEnd; - int VTotal; - int VScan; - int Flags; - - /* These are the values the hardware uses */ - int ClockIndex; - int SynthClock; /* Actual clock freq to - * be programmed (kHz) */ - int CrtcHDisplay; - int CrtcHBlankStart; - int CrtcHSyncStart; - int CrtcHSyncEnd; - int CrtcHBlankEnd; - int CrtcHTotal; - int CrtcHSkew; - int CrtcVDisplay; - int CrtcVBlankStart; - int CrtcVSyncStart; - int CrtcVSyncEnd; - int CrtcVBlankEnd; - int CrtcVTotal; - Bool CrtcHAdjusted; - Bool CrtcVAdjusted; - int PrivSize; - INT32 *Private; - int PrivFlags; - - float HSync, VRefresh; -} DisplayModeRec, *DisplayModePtr; - /* The monitor description */ #define MAX_HSYNC 8 @@ -377,7 +288,6 @@ typedef struct _bus { } id; } BusRec, *BusPtr; -#define MAXCLOCKS 128 typedef enum { DAC_BPP8 = 0, DAC_BPP16, diff --git a/include/Makefile.am b/include/Makefile.am index 70b83ffec..4c8ea6a2a 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -53,6 +53,7 @@ sdk_HEADERS = \ servermd.h \ site.h \ validate.h \ + displaymode.h \ window.h \ windowstr.h \ xkbfile.h \ diff --git a/include/displaymode.h b/include/displaymode.h new file mode 100644 index 000000000..ad01b87ec --- /dev/null +++ b/include/displaymode.h @@ -0,0 +1,102 @@ +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#ifndef _DISMODEPROC_H_ +#define _DISMODEPROC_H_ + +#include "scrnintstr.h" + +#define MAXCLOCKS 128 + +/* 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 matching name */ + MODE_NO_INTERLACE, /* interlaced mode not supported */ + MODE_NO_DBLESCAN, /* doublescan mode not supported */ + MODE_NO_VSCAN, /* multiscan 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_VSCAN, /* VScan value out of range */ + MODE_HSYNC_NARROW, /* horizontal sync too narrow */ + MODE_HSYNC_WIDE, /* horizontal sync too wide */ + MODE_HBLANK_NARROW, /* horizontal blanking too narrow */ + MODE_HBLANK_WIDE, /* horizontal blanking too wide */ + MODE_VSYNC_NARROW, /* vertical sync too narrow */ + MODE_VSYNC_WIDE, /* vertical sync too wide */ + MODE_VBLANK_NARROW, /* vertical blanking too narrow */ + MODE_VBLANK_WIDE, /* vertical blanking too wide */ + MODE_PANEL, /* exceeds panel dimensions */ + MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */ + MODE_ONE_WIDTH, /* only one width is supported */ + MODE_ONE_HEIGHT, /* only one height is supported */ + MODE_ONE_SIZE, /* only one resolution is supported */ + MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */ + MODE_BANDWIDTH, /* mode requires too much memory bandwidth */ + MODE_BAD = -2, /* unspecified reason */ + MODE_ERROR = -1 /* error condition */ +} ModeStatus; + +/* Video mode */ +typedef struct _DisplayModeRec { + struct _DisplayModeRec *prev; + struct _DisplayModeRec *next; + const char *name; /* identifier for the mode */ + ModeStatus status; + int type; + + /* These are the values that the user sees/provides */ + int Clock; /* pixel clock freq (kHz) */ + int HDisplay; /* horizontal timing */ + int HSyncStart; + int HSyncEnd; + int HTotal; + int HSkew; + int VDisplay; /* vertical timing */ + int VSyncStart; + int VSyncEnd; + int VTotal; + int VScan; + int Flags; + + /* These are the values the hardware uses */ + int ClockIndex; + int SynthClock; /* Actual clock freq to + * be programmed (kHz) */ + int CrtcHDisplay; + int CrtcHBlankStart; + int CrtcHSyncStart; + int CrtcHSyncEnd; + int CrtcHBlankEnd; + int CrtcHTotal; + int CrtcHSkew; + int CrtcVDisplay; + int CrtcVBlankStart; + int CrtcVSyncStart; + int CrtcVSyncEnd; + int CrtcVBlankEnd; + int CrtcVTotal; + Bool CrtcHAdjusted; + Bool CrtcVAdjusted; + int PrivSize; + INT32 *Private; + int PrivFlags; + + float HSync, VRefresh; +} DisplayModeRec, *DisplayModePtr; + +#endif |