cea78e147e244f9d0efea99cdd68ca898716977b
[profile/ivi/intel-emgd-kmod.git] / emgd / drm / user_config.c
1 /*
2  *-----------------------------------------------------------------------------
3  * Filename: user_config.c
4  * $Revision: 1.24 $
5  *-----------------------------------------------------------------------------
6  * Copyright (c) 2002-2010, Intel Corporation.
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a copy
9  * of this software and associated documentation files (the "Software"), to deal
10  * in the Software without restriction, including without limitation the rights
11  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12  * copies of the Software, and to permit persons to whom the Software is
13  * furnished to do so, subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be included in
16  * all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24  * THE SOFTWARE.
25  *
26  *-----------------------------------------------------------------------------
27  * Description:
28  *  A file that contains the initial display configuration information of the
29  *  EMGD kernel module.  A user can edit this file in order to affect the way
30  *  that the kernel initially configures the displays.  This file is compiled
31  *  into the EMGD kernel module.
32  *-----------------------------------------------------------------------------
33  */
34 #include "user_config.h"
35
36 #warning ****
37 #warning **** This driver has NOT been configured for your system.  You are
38 #warning **** building with a sample user_config.c configuration that may or
39 #warning **** may not meet your needs.  It is recommended that you run CED to
40 #warning **** generate an appropriate configuration or see the User Guide
41 #warning **** for more information about driver configuration.
42 #warning ****
43
44
45 /*
46  * One array of igd_display_info_t structures should exist for each port that
47  * needs to provide a DTD list.  Each igd_display_info_t contains the DTD
48  * information for a given resolution/refresh-rate.  This is especially needed
49  * for analog/VGA ports.
50  */
51
52 #define TUNNELCREEK 1
53 #define POULSBO 0
54
55 #if TUNNELCREEK
56 static igd_display_info_t dtd_config1_port4_dtdlist[] = {
57         {
58                 1366,   /* Width */
59                 768,    /* Height */
60                 60,     /* Refresh Rate */
61                 72300,  /* Dot Clock */
62                 1525,   /* Horizontal Total (horizontal synch end) */
63                 1365,   /* Horizontal Blank Start (h_active-1) */
64                 1525,   /* Horizontal Blank End (start + h_blank) */
65                 1413,   /* Horizontal Sync Start (h_active+h_synch-1) */
66                 1445,   /* Horizontal Sync End (start + h_syncp) */
67                 789,    /* Vertical Total (Vertical synch end) */
68                 767,    /* Vertical Blank Start (v_active-1) */
69                 789,    /* Vertical Blank End (start + v_blank) */
70                 770,    /* Vertical Sync Start (v_active+v_synch-1) */
71                 775,    /* Vertical Sync End (start + v_synchp) */
72                 0,  /* Mode Number */
73                 0x20000,    /* Flags */
74                 0,  /* X Offset */
75                 0,  /* Y Offset */
76                 NULL,   /* pd extension pointer */
77                 0, 0   /* mode extension pointer */
78         },
79 };
80 #endif
81
82 #if POULSBO
83 static igd_display_info_t dtd_config1_port4_dtdlist[] = {
84         {
85                 1024,                   /* Width */
86                 768,                            /* Height */
87                 60,                             /* Refresh Rate */
88                 65000,                  /* Dot Clock (in KHz) */
89                 1343,                   /* Horizontal Total (horizontal synch end) */
90                 1023,                   /* Horizontal Blank Start (h_active-1) */
91                 1343,                   /* Horizontal Blank End (start + h_blank) */
92                 1047,                   /* Horizontal Sync Start (h_active+h_synch-1) */
93                 1183,                   /* Horizontal Sync End (start + h_syncp) */
94                 805,                            /* Vertical Total (Vertical synch end) */
95                 767,                            /* Vertical Blank Start (v_active-1) */
96                 805,                            /* Vertical Blank End (start + v_blank) */
97                 770,                            /* Vertical Sync Start (v_active+v_synch-1) */
98                 776,                            /* Vertical Sync End (start + v_synchp) */
99                 0,                              /* Mode Number */
100                 0x20000,                        /* Flags */
101                 0,                              /* X Offset */
102                 0,                              /* Y Offset */
103                 NULL,                   /* pd extension pointer */
104                 0, 0                            /* mode extension pointer */
105         },
106 };
107 #endif
108
109 static igd_param_attr_t attrs_config1_port4[] = {
110         {0x46, 100},
111 #if POULSBO
112         {0x1a, 24},
113 #endif
114 #if TUNNELCREEK
115         {0x47, 20300},
116 #endif
117 };
118
119 static emgd_drm_splash_screen_t splash_screen_data = {
120         0x000000,               /* bg_color */
121         0,                      /* x */
122         0,                      /* y */
123         0,                      /* width */
124         0,                      /* height */
125 };
126
127 static emgd_drm_splash_video_t splash_video_data = {
128         0,                      /* offset */
129         0,                      /* pixel_format */
130         0,                      /* src_width */
131         0,                      /* src_height */
132         0,                      /* src_pitch */
133         0,                      /* dst_x */
134         0,                      /* dst_y */
135         0,                      /* dst_width */
136         0,                      /* dst_height */
137 };
138
139 static igd_param_t config_params_config1 = {
140         1*256*1024,             /* Page request */
141         0,              /* Max frame buffer size */
142         1,              /* Preserve registers */
143         0x6,            /* Display flags */
144         { 4, 2, 0, 0, 0 },              /* Display port order */
145         {               /* Display Params */
146                 {               /* Port */
147                         4,              /* Display port number */
148                         0x180,          /* Parameters present */
149                         0x0,            /* EDID flag */
150                         0x5,            /* Flags when EDID is available */
151                         0x5,            /* Flags when EDID is not available */
152                         0,              /* DDC GPIO pins */
153                         0,              /* DDC speed */
154                         0,              /* DDC DAB */
155                         0,              /* I2C GPIO pins */
156                         0,              /* I2C speed */
157                         0,              /* I2C DAB */
158                         {               /* Flat Panel Info */
159                                 0,              /* Flat Panel width */
160                                 0,              /* Flat Panel height */
161                                 0,              /* Flat Panel power method */
162                                 0,              /* VDD active & DVO clock/data active */
163                                 0,              /* DVO clock/data active & backlight enable */
164                                 0,              /* backlight disable & DVO clock/data inactive */
165                                 0,              /* DVO clock/data inactive & VDD inactive */
166                                 0                       /* VDD inactive & VDD active */
167                         },
168                         {               /* DTD Info */
169                                 sizeof(dtd_config1_port4_dtdlist)/sizeof(igd_display_info_t),           /* Number of DTDs */
170                                 dtd_config1_port4_dtdlist               /* DTD name */
171                         },
172                         {               /* Attribute Info */
173                                 sizeof(attrs_config1_port4)/sizeof(igd_param_attr_t),           /* Number of attributes */
174                                 attrs_config1_port4             /* Attr name */
175                         }
176                 },
177                 {               /* Port */
178                         2,              /* Display port number */
179                         0x0,            /* Parameters present */
180                         0x0,            /* EDID flag */
181                         0x5,            /* Flags when EDID is available */
182                         0x5,            /* Flags when EDID is not available */
183                         0,              /* DDC GPIO pins */
184                         0,              /* DDC speed */
185                         0,              /* DDC DAB */
186                         0,              /* I2C GPIO pins */
187                         0,              /* I2C speed */
188                         0,              /* I2C DAB */
189                         {               /* Flat Panel Info */
190                                 0,              /* Flat Panel width */
191                                 0,              /* Flat Panel height */
192                                 0,              /* Flat Panel power method */
193                                 0,              /* VDD active & DVO clock/data active */
194                                 0,              /* DVO clock/data active & backlight enable */
195                                 0,              /* backlight disable & DVO clock/data inactive */
196                                 0,              /* DVO clock/data inactive & VDD inactive */
197                                 0                       /* VDD inactive & VDD active */
198                         },
199                         {               /* DTD Info */
200                         0, NULL
201                         },
202                         {               /* Attribute Info */
203                         0, NULL
204                         }
205                 },
206         },
207         0,                      /* 24-bit RGB color that framebuffer is cleared to */
208         1,                      /* Quickboot (1 = enabled) */
209         0,                      /* Quickboot seamless (1 = enabled) */
210         0,                      /* Quickboot video input (1 = enabled) */
211         0                       /* Polling (1 = override interrupt support and use polling) */
212 };
213
214 igd_param_t *config_params = {&config_params_config1};
215
216 /*
217  * The emgd_drm_config_t structure is the main configuration structure
218  * for the EMGD kernel module.
219  */
220 emgd_drm_config_t config_drm = {
221         0,      /* Whether to initialize the display at EMGD module startup time
222                  * (corresponds to the "init" module parameter)
223                  */
224         1,      /* The display configuration to use if initializing the display
225                  * (corresponds to the "init" module parameter), where:
226                  * - 1 = Single port/display
227                  * - 2 = Cloned port/display (e.g. LVDS + CRT with different timings)
228                  * - 4 = Twin ports/displays (e.g. LVDS + CRT with same timings)
229                  *       Note: Twin is NOT CURRENTLY SUPPORTED
230                  * - 8 = Extended displays (e.g. LVDS + CRT displaying different images)
231                  */
232         1366,/* Display width to use if initializing the display
233                  * (corresponds to the "width" module parameter)
234                  */
235         768,/* Display height to use if initializing the display
236                  * (corresponds to the "height" module parameter)
237                  */
238         60,     /* Display refresh rate to use if initializing the display
239                  * (corresponds to the "refresh" module parameter)
240                  */
241         0,  /* KMS */
242         0,      /* ovl_brightness */
243         0,      /* ovl_contrast */
244         0,      /* ovl_saturation */
245         0,      /* ovl_gamma_red */
246         0,      /* ovl_gamma_green */
247         0,      /* ovl_gamma_blue */
248         &splash_screen_data,
249         &splash_video_data,
250         &config_params  /* driver parameters from above */
251 };
252