src/video/x11/edid.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 02 Mar 2013 20:44:16 -0800
changeset 6950 1ddb72193079
parent 6796 424a12862805
child 6967 adc80d085ddf
permissions -rw-r--r--
Added a mouse ID to the mouse events, which set to the special value SDL_TOUCH_MOUSEID for mouse events simulated by touch input.
slouken@6796
     1
typedef unsigned char uchar;
slouken@6796
     2
typedef struct MonitorInfo MonitorInfo;
slouken@6796
     3
typedef struct Timing Timing;
slouken@6796
     4
typedef struct DetailedTiming DetailedTiming;
slouken@6796
     5
slouken@6796
     6
typedef enum
slouken@6796
     7
{
slouken@6796
     8
    UNDEFINED,
slouken@6796
     9
    DVI,
slouken@6796
    10
    HDMI_A,
slouken@6796
    11
    HDMI_B,
slouken@6796
    12
    MDDI,
slouken@6796
    13
    DISPLAY_PORT
slouken@6796
    14
} Interface;
slouken@6796
    15
slouken@6796
    16
typedef enum
slouken@6796
    17
{
slouken@6796
    18
    UNDEFINED_COLOR,
slouken@6796
    19
    MONOCHROME,
slouken@6796
    20
    RGB,
slouken@6796
    21
    OTHER_COLOR
slouken@6796
    22
} ColorType;
slouken@6796
    23
slouken@6796
    24
typedef enum
slouken@6796
    25
{
slouken@6796
    26
    NO_STEREO,
slouken@6796
    27
    FIELD_RIGHT,
slouken@6796
    28
    FIELD_LEFT,
slouken@6796
    29
    TWO_WAY_RIGHT_ON_EVEN,
slouken@6796
    30
    TWO_WAY_LEFT_ON_EVEN,
slouken@6796
    31
    FOUR_WAY_INTERLEAVED,
slouken@6796
    32
    SIDE_BY_SIDE
slouken@6796
    33
} StereoType;
slouken@6796
    34
slouken@6796
    35
struct Timing
slouken@6796
    36
{
slouken@6796
    37
    int width;
slouken@6796
    38
    int height;
slouken@6796
    39
    int frequency;
slouken@6796
    40
};
slouken@6796
    41
slouken@6796
    42
struct DisplayDescriptor
slouken@6796
    43
{
slouken@6796
    44
};
slouken@6796
    45
slouken@6796
    46
struct DetailedTiming
slouken@6796
    47
{
slouken@6796
    48
    int		pixel_clock;
slouken@6796
    49
    int		h_addr;
slouken@6796
    50
    int		h_blank;
slouken@6796
    51
    int		h_sync;
slouken@6796
    52
    int		h_front_porch;
slouken@6796
    53
    int		v_addr;
slouken@6796
    54
    int		v_blank;
slouken@6796
    55
    int		v_sync;
slouken@6796
    56
    int		v_front_porch;
slouken@6796
    57
    int		width_mm;
slouken@6796
    58
    int		height_mm;
slouken@6796
    59
    int		right_border;
slouken@6796
    60
    int		top_border;
slouken@6796
    61
    int		interlaced;
slouken@6796
    62
    StereoType	stereo;
slouken@6796
    63
slouken@6796
    64
    int		digital_sync;
slouken@6796
    65
    union
slouken@6796
    66
    {
slouken@6796
    67
	struct
slouken@6796
    68
	{
slouken@6796
    69
	    int bipolar;
slouken@6796
    70
	    int serrations;
slouken@6796
    71
	    int sync_on_green;
slouken@6796
    72
	} analog;
slouken@6796
    73
slouken@6796
    74
	struct
slouken@6796
    75
	{
slouken@6796
    76
	    int composite;
slouken@6796
    77
	    int serrations;
slouken@6796
    78
	    int negative_vsync;
slouken@6796
    79
	    int negative_hsync;
slouken@6796
    80
	} digital;
slouken@6796
    81
    };
slouken@6796
    82
};
slouken@6796
    83
slouken@6796
    84
struct MonitorInfo
slouken@6796
    85
{
slouken@6796
    86
    int			checksum;
slouken@6796
    87
    char		manufacturer_code[4];
slouken@6796
    88
    int			product_code;
slouken@6796
    89
    unsigned int	serial_number;
slouken@6796
    90
    
slouken@6796
    91
    int			production_week;	/* -1 if not specified */
slouken@6796
    92
    int			production_year;	/* -1 if not specified */
slouken@6796
    93
    int			model_year;		/* -1 if not specified */
slouken@6796
    94
slouken@6796
    95
    int			major_version;
slouken@6796
    96
    int			minor_version;
slouken@6796
    97
slouken@6796
    98
    int			is_digital;
slouken@6796
    99
    
slouken@6796
   100
    union
slouken@6796
   101
    {
slouken@6796
   102
	struct
slouken@6796
   103
	{
slouken@6796
   104
	    int		bits_per_primary;
slouken@6796
   105
	    Interface	interface;
slouken@6796
   106
	    int		rgb444;
slouken@6796
   107
	    int		ycrcb444;
slouken@6796
   108
	    int		ycrcb422;
slouken@6796
   109
	} digital;
slouken@6796
   110
slouken@6796
   111
	struct
slouken@6796
   112
	{
slouken@6796
   113
	    double	video_signal_level;
slouken@6796
   114
	    double	sync_signal_level;
slouken@6796
   115
	    double	total_signal_level;
slouken@6796
   116
slouken@6796
   117
	    int		blank_to_black;
slouken@6796
   118
slouken@6796
   119
	    int		separate_hv_sync;
slouken@6796
   120
	    int		composite_sync_on_h;
slouken@6796
   121
	    int		composite_sync_on_green;
slouken@6796
   122
	    int		serration_on_vsync;
slouken@6796
   123
	    ColorType	color_type;
slouken@6796
   124
	} analog;
slouken@6796
   125
    };
slouken@6796
   126
slouken@6796
   127
    int			width_mm;		/* -1 if not specified */
slouken@6796
   128
    int			height_mm;		/* -1 if not specified */
slouken@6796
   129
    double		aspect_ratio;		/* -1.0 if not specififed */
slouken@6796
   130
slouken@6796
   131
    double		gamma;			/* -1.0 if not specified */
slouken@6796
   132
slouken@6796
   133
    int			standby;
slouken@6796
   134
    int			suspend;
slouken@6796
   135
    int			active_off;
slouken@6796
   136
slouken@6796
   137
    int			srgb_is_standard;
slouken@6796
   138
    int			preferred_timing_includes_native;
slouken@6796
   139
    int			continuous_frequency;
slouken@6796
   140
slouken@6796
   141
    double		red_x;
slouken@6796
   142
    double		red_y;
slouken@6796
   143
    double		green_x;
slouken@6796
   144
    double		green_y;
slouken@6796
   145
    double		blue_x;
slouken@6796
   146
    double		blue_y;
slouken@6796
   147
    double		white_x;
slouken@6796
   148
    double		white_y;
slouken@6796
   149
slouken@6796
   150
    Timing		established[24];	/* Terminated by 0x0x0 */
slouken@6796
   151
    Timing		standard[8];
slouken@6796
   152
    
slouken@6796
   153
    int			n_detailed_timings;
slouken@6796
   154
    DetailedTiming	detailed_timings[4];	/* If monitor has a preferred
slouken@6796
   155
						 * mode, it is the first one
slouken@6796
   156
						 * (whether it has, is
slouken@6796
   157
						 * determined by the 
slouken@6796
   158
						 * preferred_timing_includes
slouken@6796
   159
						 * bit.
slouken@6796
   160
						 */
slouken@6796
   161
slouken@6796
   162
    /* Optional product description */
slouken@6796
   163
    char		dsc_serial_number[14];
slouken@6796
   164
    char		dsc_product_name[14];
slouken@6796
   165
    char		dsc_string[14];		/* Unspecified ASCII data */
slouken@6796
   166
};
slouken@6796
   167
slouken@6796
   168
MonitorInfo *decode_edid (const uchar *data);
slouken@6796
   169
void         dump_monitor_info (MonitorInfo *info);
slouken@6796
   170
char *       make_display_name (const char        *output_name,
slouken@6796
   171
				const MonitorInfo *info);