src/video/x11/edid.h
author Sam Lantinga
Sun, 02 Feb 2014 00:53:27 -0800
changeset 8149 681eb46b8ac4
parent 6967 adc80d085ddf
child 10701 62f7dd0acd13
permissions -rw-r--r--
Fixed bug 2374 - Update copyright for 2014...

Is it that time already??
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 DetailedTiming
slouken@6796
    43
{
slouken@6796
    44
    int		pixel_clock;
slouken@6796
    45
    int		h_addr;
slouken@6796
    46
    int		h_blank;
slouken@6796
    47
    int		h_sync;
slouken@6796
    48
    int		h_front_porch;
slouken@6796
    49
    int		v_addr;
slouken@6796
    50
    int		v_blank;
slouken@6796
    51
    int		v_sync;
slouken@6796
    52
    int		v_front_porch;
slouken@6796
    53
    int		width_mm;
slouken@6796
    54
    int		height_mm;
slouken@6796
    55
    int		right_border;
slouken@6796
    56
    int		top_border;
slouken@6796
    57
    int		interlaced;
slouken@6796
    58
    StereoType	stereo;
slouken@6796
    59
slouken@6796
    60
    int		digital_sync;
slouken@6796
    61
    union
slouken@6796
    62
    {
slouken@6796
    63
	struct
slouken@6796
    64
	{
slouken@6796
    65
	    int bipolar;
slouken@6796
    66
	    int serrations;
slouken@6796
    67
	    int sync_on_green;
slouken@6796
    68
	} analog;
slouken@6796
    69
slouken@6796
    70
	struct
slouken@6796
    71
	{
slouken@6796
    72
	    int composite;
slouken@6796
    73
	    int serrations;
slouken@6796
    74
	    int negative_vsync;
slouken@6796
    75
	    int negative_hsync;
slouken@6796
    76
	} digital;
slouken@6796
    77
    };
slouken@6796
    78
};
slouken@6796
    79
slouken@6796
    80
struct MonitorInfo
slouken@6796
    81
{
slouken@6796
    82
    int			checksum;
slouken@6796
    83
    char		manufacturer_code[4];
slouken@6796
    84
    int			product_code;
slouken@6796
    85
    unsigned int	serial_number;
slouken@6796
    86
    
slouken@6796
    87
    int			production_week;	/* -1 if not specified */
slouken@6796
    88
    int			production_year;	/* -1 if not specified */
slouken@6796
    89
    int			model_year;		/* -1 if not specified */
slouken@6796
    90
slouken@6796
    91
    int			major_version;
slouken@6796
    92
    int			minor_version;
slouken@6796
    93
slouken@6796
    94
    int			is_digital;
slouken@6796
    95
    
slouken@6796
    96
    union
slouken@6796
    97
    {
slouken@6796
    98
	struct
slouken@6796
    99
	{
slouken@6796
   100
	    int		bits_per_primary;
slouken@6796
   101
	    Interface	interface;
slouken@6796
   102
	    int		rgb444;
slouken@6796
   103
	    int		ycrcb444;
slouken@6796
   104
	    int		ycrcb422;
slouken@6796
   105
	} digital;
slouken@6796
   106
slouken@6796
   107
	struct
slouken@6796
   108
	{
slouken@6796
   109
	    double	video_signal_level;
slouken@6796
   110
	    double	sync_signal_level;
slouken@6796
   111
	    double	total_signal_level;
slouken@6796
   112
slouken@6796
   113
	    int		blank_to_black;
slouken@6796
   114
slouken@6796
   115
	    int		separate_hv_sync;
slouken@6796
   116
	    int		composite_sync_on_h;
slouken@6796
   117
	    int		composite_sync_on_green;
slouken@6796
   118
	    int		serration_on_vsync;
slouken@6796
   119
	    ColorType	color_type;
slouken@6796
   120
	} analog;
slouken@6796
   121
    };
slouken@6796
   122
slouken@6796
   123
    int			width_mm;		/* -1 if not specified */
slouken@6796
   124
    int			height_mm;		/* -1 if not specified */
slouken@6796
   125
    double		aspect_ratio;		/* -1.0 if not specififed */
slouken@6796
   126
slouken@6796
   127
    double		gamma;			/* -1.0 if not specified */
slouken@6796
   128
slouken@6796
   129
    int			standby;
slouken@6796
   130
    int			suspend;
slouken@6796
   131
    int			active_off;
slouken@6796
   132
slouken@6796
   133
    int			srgb_is_standard;
slouken@6796
   134
    int			preferred_timing_includes_native;
slouken@6796
   135
    int			continuous_frequency;
slouken@6796
   136
slouken@6796
   137
    double		red_x;
slouken@6796
   138
    double		red_y;
slouken@6796
   139
    double		green_x;
slouken@6796
   140
    double		green_y;
slouken@6796
   141
    double		blue_x;
slouken@6796
   142
    double		blue_y;
slouken@6796
   143
    double		white_x;
slouken@6796
   144
    double		white_y;
slouken@6796
   145
slouken@6796
   146
    Timing		established[24];	/* Terminated by 0x0x0 */
slouken@6796
   147
    Timing		standard[8];
slouken@6796
   148
    
slouken@6796
   149
    int			n_detailed_timings;
slouken@6796
   150
    DetailedTiming	detailed_timings[4];	/* If monitor has a preferred
slouken@6796
   151
						 * mode, it is the first one
slouken@6796
   152
						 * (whether it has, is
slouken@6796
   153
						 * determined by the 
slouken@6796
   154
						 * preferred_timing_includes
slouken@6796
   155
						 * bit.
slouken@6796
   156
						 */
slouken@6796
   157
slouken@6796
   158
    /* Optional product description */
slouken@6796
   159
    char		dsc_serial_number[14];
slouken@6796
   160
    char		dsc_product_name[14];
slouken@6796
   161
    char		dsc_string[14];		/* Unspecified ASCII data */
slouken@6796
   162
};
slouken@6796
   163
slouken@6796
   164
MonitorInfo *decode_edid (const uchar *data);
slouken@6796
   165
void         dump_monitor_info (MonitorInfo *info);
slouken@6796
   166
char *       make_display_name (const char        *output_name,
slouken@6796
   167
				const MonitorInfo *info);