2
*-----------------------------------------------------------------------------
5
*-----------------------------------------------------------------------------
6
* Copyright © 2002-2010, Intel Corporation.
8
* This program is free software; you can redistribute it and/or modify it
9
* under the terms and conditions of the GNU General Public License,
10
* version 2, as published by the Free Software Foundation.
12
* This program is distributed in the hope it will be useful, but WITHOUT
13
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17
* You should have received a copy of the GNU General Public License along with
18
* this program; if not, write to the Free Software Foundation, Inc.,
19
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21
*-----------------------------------------------------------------------------
23
* Header file for EDID.
24
* Supported EDID versions:
25
* EDID 1.3 (backward compatible with 1.1, 1.2)
26
*-----------------------------------------------------------------------------
30
* This is a basic EDID parser. It only parses the parts of the EDID that
31
* are useful for developing timings and identifying the monitor. Items
32
* like monitor serial numbers, chromaticity settings etc. are not useful
33
* in the display drivers. There should be a simple interface to provide
34
* the complete unparsed EDID to IAL, so that such information can be
35
* used by a IAL driver if need be.
37
* timings_t: This is a structure that contains one set of display timings.
38
* It is complete in that it contains all 12 timings fields instead of
39
* the popular 8. Some of the "Established" EDID timings require all 12
40
* fields. It also allows for both established flags and driver specific
41
* flags to make it flexible enough to work for most drivers. The
42
* EDID parser will mark the flags with FB_TIMINGS_PREFERRED if they are
43
* found to be listed in the EDID. This does not include modes within
44
* the the sync ranges (if provided), only "Established" "Standard" and
47
* edid_t: This structure will be populated by the EDID parser. There
48
* are three important areas of information that impact display timings.
49
* The h_max,h_min,v_max,v_min represent the range of timings that the
50
* display is capable of accepting. No timings outside this range should
51
* be used by the driver if a range is provided.
53
* Any "Detailed" timings will be fully parsed and returned in
54
* the timings array (only the first 12 are parsed, it is very unlikely
55
* that any EDID exist that contain this many).
57
* Suggested driver behavior when setting display timings would be to
58
* first attempt to use "Detailed" timings provided by the monitor. Then
59
* attempt to use the "Standard" timings that were marked as PREFERRED,
60
* then as a last alternative, use a nonstandard set of timings within
68
#include <displayid.h>
71
/* This structure holds all of the parsed EDID information.*/
72
#define NUM_TIMINGS 12
74
/* EDID return values */
75
#define EDID_ERROR_PARSE 1
76
#define EDID_READ_AGAIN 2
78
typedef struct _established_timing {
81
unsigned long refresh;
82
} established_timing_t;
84
typedef struct _edid {
85
unsigned char version; /* Edid Version */
86
unsigned char revision; /* Edid Revision */
87
char vendor[4]; /* Vendor Name code */
88
unsigned long product_code; /* Vendor assigned code */
89
unsigned long serial_number; /* 32-bit serial number */
90
unsigned char manf_week; /* Manufactored week number */
91
unsigned long manf_year; /* Manufactored year */
92
unsigned char standard_color;
93
unsigned char preferred_timing; /* Use first timing Provided */
95
unsigned char display_type;
97
unsigned char range_set; /* EDID Contains Valid Range Data */
99
unsigned char num_timings;
100
pd_timing_t timings[NUM_TIMINGS];
102
cea_extension_t *cea; /* CEA extension based on 861-B */
107
unsigned char *buffer,
109
pd_timing_t *timings,
111
unsigned char upscale);
113
void enable_disable_timings(pd_timing_t *timing, unsigned char enable);
114
void enable_scaled_timings(pd_timing_t *timing, pd_timing_t *dtd,
115
unsigned char upscale);
116
void firmware_dump(unsigned char *buffer, unsigned short size);
117
void edid_print(edid_t *edid);
120
unsigned char *buffer,
122
pd_timing_t *timings,
124
unsigned char upscale);
126
/*----------------------------------------------------------------------------
127
* File Revision History
128
* $Id: edid.h,v 1.3 2010/07/23 16:54:50 bpaauwe Exp $
129
* $Source: /nfs/fm/proj/eia/cvsroot/koheo/linux/egd_drm/emgd/include/edid.h,v $
130
*----------------------------------------------------------------------------