~gma500/+junk/emgd152-natty

« back to all changes in this revision

Viewing changes to emgd-dkms-1.5.15.3082/emgd/include/edid.h

  • Committer: Luca Forina
  • Date: 2011-02-06 15:11:54 UTC
  • Revision ID: luca.forina@gmail.com-20110206151154-9dzn5ugxjub9qenb
Upload Emgd 1.5.2 for Natty (override Maverick)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- pse-c -*-
 
2
 *-----------------------------------------------------------------------------
 
3
 * Filename: edid.h
 
4
 * $Revision: 1.3 $
 
5
 *-----------------------------------------------------------------------------
 
6
 * Copyright © 2002-2010, Intel Corporation.
 
7
 *
 
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.
 
11
 *
 
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
 
15
 * more details.
 
16
 *
 
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.
 
20
 *
 
21
 *-----------------------------------------------------------------------------
 
22
 * Description:
 
23
 *  Header file for EDID.
 
24
 *  Supported EDID versions:
 
25
 *  EDID 1.3 (backward compatible with 1.1, 1.2)
 
26
 *-----------------------------------------------------------------------------
 
27
 */
 
28
 
 
29
/*
 
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.
 
36
 *
 
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
 
45
 *  "Detailed" timings.
 
46
 *
 
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.
 
52
 *
 
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).
 
56
 *
 
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
 
61
 *  the provided range.
 
62
 *
 
63
 */
 
64
 
 
65
#ifndef _EDID_H
 
66
#define _EDID_H
 
67
 
 
68
#include <displayid.h>
 
69
#include <pd.h>
 
70
 
 
71
/* This structure holds all of the parsed EDID information.*/
 
72
#define NUM_TIMINGS 12
 
73
 
 
74
/* EDID return values */
 
75
#define EDID_ERROR_PARSE  1
 
76
#define EDID_READ_AGAIN   2
 
77
 
 
78
typedef struct _established_timing {
 
79
        unsigned long width;
 
80
        unsigned long height;
 
81
        unsigned long refresh;
 
82
} established_timing_t;
 
83
 
 
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 */
 
94
        unsigned char     dpms;
 
95
        unsigned char     display_type;
 
96
        unsigned char     gtf;
 
97
        unsigned char     range_set;          /* EDID Contains Valid Range Data */
 
98
        timing_range_t    range;
 
99
        unsigned char     num_timings;
 
100
        pd_timing_t       timings[NUM_TIMINGS];
 
101
        char              name[14];
 
102
        cea_extension_t   *cea;                           /* CEA extension based on 861-B */
 
103
} edid_t;
 
104
 
 
105
/* Functions */
 
106
int edid_parse(
 
107
                unsigned char *buffer,
 
108
                edid_t        *edid,
 
109
                pd_timing_t   *timings,
 
110
                int           count,
 
111
                unsigned char upscale);
 
112
 
 
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);
 
118
 
 
119
int edid_ext_parse(
 
120
                unsigned char *buffer,
 
121
                edid_t        *edid,
 
122
                pd_timing_t   *timings,
 
123
                int           count,
 
124
                unsigned char upscale);
 
125
#endif
 
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
 *----------------------------------------------------------------------------
 
131
 */