Rev 3764 | Rev 5271 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3764 | Rev 5078 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | #include |
35 | #include |
36 | #include |
36 | #include |
37 | #include |
37 | #include |
38 | #endif /* CONFIG_PPC_PMAC */ |
38 | #endif /* CONFIG_PPC_PMAC */ |
Line 39... | Line -... | ||
39 | - | ||
40 | /* from radeon_encoder.c */ |
- | |
41 | extern uint32_t |
- | |
42 | radeon_get_encoder_enum(struct drm_device *dev, uint32_t supported_device, |
- | |
43 | uint8_t dac); |
- | |
44 | extern void radeon_link_encoder_connector(struct drm_device *dev); |
- | |
45 | - | ||
46 | /* from radeon_connector.c */ |
- | |
47 | extern void |
- | |
48 | radeon_add_legacy_connector(struct drm_device *dev, |
- | |
49 | uint32_t connector_id, |
- | |
50 | uint32_t supported_device, |
- | |
51 | int connector_type, |
- | |
52 | struct radeon_i2c_bus_rec *i2c_bus, |
- | |
53 | uint16_t connector_object_id, |
- | |
54 | struct radeon_hpd *hpd); |
- | |
55 | 39 | ||
56 | /* from radeon_legacy_encoder.c */ |
40 | /* from radeon_legacy_encoder.c */ |
57 | extern void |
41 | extern void |
58 | radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum, |
42 | radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum, |
Line 145... | Line 129... | ||
145 | 129 | ||
146 | static uint16_t combios_get_table_offset(struct drm_device *dev, |
130 | static uint16_t combios_get_table_offset(struct drm_device *dev, |
147 | enum radeon_combios_table_offset table) |
131 | enum radeon_combios_table_offset table) |
148 | { |
132 | { |
149 | struct radeon_device *rdev = dev->dev_private; |
133 | struct radeon_device *rdev = dev->dev_private; |
150 | int rev; |
134 | int rev, size; |
Line 151... | Line 135... | ||
151 | uint16_t offset = 0, check_offset; |
135 | uint16_t offset = 0, check_offset; |
152 | 136 | ||
Line 153... | Line 137... | ||
153 | if (!rdev->bios) |
137 | if (!rdev->bios) |
154 | return 0; |
138 | return 0; |
155 | 139 | ||
156 | switch (table) { |
- | |
157 | /* absolute offset tables */ |
140 | switch (table) { |
158 | case COMBIOS_ASIC_INIT_1_TABLE: |
- | |
159 | check_offset = RBIOS16(rdev->bios_header_start + 0xc); |
141 | /* absolute offset tables */ |
160 | if (check_offset) |
142 | case COMBIOS_ASIC_INIT_1_TABLE: |
161 | offset = check_offset; |
- | |
162 | break; |
143 | check_offset = 0xc; |
163 | case COMBIOS_BIOS_SUPPORT_TABLE: |
- | |
164 | check_offset = RBIOS16(rdev->bios_header_start + 0x14); |
144 | break; |
165 | if (check_offset) |
145 | case COMBIOS_BIOS_SUPPORT_TABLE: |
166 | offset = check_offset; |
- | |
167 | break; |
146 | check_offset = 0x14; |
168 | case COMBIOS_DAC_PROGRAMMING_TABLE: |
- | |
169 | check_offset = RBIOS16(rdev->bios_header_start + 0x2a); |
147 | break; |
170 | if (check_offset) |
148 | case COMBIOS_DAC_PROGRAMMING_TABLE: |
171 | offset = check_offset; |
- | |
172 | break; |
149 | check_offset = 0x2a; |
173 | case COMBIOS_MAX_COLOR_DEPTH_TABLE: |
- | |
174 | check_offset = RBIOS16(rdev->bios_header_start + 0x2c); |
150 | break; |
175 | if (check_offset) |
151 | case COMBIOS_MAX_COLOR_DEPTH_TABLE: |
176 | offset = check_offset; |
- | |
177 | break; |
152 | check_offset = 0x2c; |
178 | case COMBIOS_CRTC_INFO_TABLE: |
- | |
179 | check_offset = RBIOS16(rdev->bios_header_start + 0x2e); |
153 | break; |
180 | if (check_offset) |
154 | case COMBIOS_CRTC_INFO_TABLE: |
181 | offset = check_offset; |
- | |
182 | break; |
155 | check_offset = 0x2e; |
183 | case COMBIOS_PLL_INFO_TABLE: |
- | |
184 | check_offset = RBIOS16(rdev->bios_header_start + 0x30); |
156 | break; |
185 | if (check_offset) |
157 | case COMBIOS_PLL_INFO_TABLE: |
186 | offset = check_offset; |
- | |
187 | break; |
158 | check_offset = 0x30; |
188 | case COMBIOS_TV_INFO_TABLE: |
- | |
189 | check_offset = RBIOS16(rdev->bios_header_start + 0x32); |
159 | break; |
190 | if (check_offset) |
160 | case COMBIOS_TV_INFO_TABLE: |
191 | offset = check_offset; |
- | |
192 | break; |
161 | check_offset = 0x32; |
193 | case COMBIOS_DFP_INFO_TABLE: |
- | |
194 | check_offset = RBIOS16(rdev->bios_header_start + 0x34); |
162 | break; |
195 | if (check_offset) |
163 | case COMBIOS_DFP_INFO_TABLE: |
196 | offset = check_offset; |
- | |
197 | break; |
164 | check_offset = 0x34; |
198 | case COMBIOS_HW_CONFIG_INFO_TABLE: |
- | |
199 | check_offset = RBIOS16(rdev->bios_header_start + 0x36); |
165 | break; |
200 | if (check_offset) |
166 | case COMBIOS_HW_CONFIG_INFO_TABLE: |
201 | offset = check_offset; |
- | |
202 | break; |
167 | check_offset = 0x36; |
203 | case COMBIOS_MULTIMEDIA_INFO_TABLE: |
- | |
204 | check_offset = RBIOS16(rdev->bios_header_start + 0x38); |
168 | break; |
205 | if (check_offset) |
169 | case COMBIOS_MULTIMEDIA_INFO_TABLE: |
206 | offset = check_offset; |
- | |
207 | break; |
170 | check_offset = 0x38; |
208 | case COMBIOS_TV_STD_PATCH_TABLE: |
- | |
209 | check_offset = RBIOS16(rdev->bios_header_start + 0x3e); |
171 | break; |
210 | if (check_offset) |
172 | case COMBIOS_TV_STD_PATCH_TABLE: |
211 | offset = check_offset; |
- | |
212 | break; |
173 | check_offset = 0x3e; |
213 | case COMBIOS_LCD_INFO_TABLE: |
- | |
214 | check_offset = RBIOS16(rdev->bios_header_start + 0x40); |
174 | break; |
215 | if (check_offset) |
175 | case COMBIOS_LCD_INFO_TABLE: |
216 | offset = check_offset; |
- | |
217 | break; |
176 | check_offset = 0x40; |
218 | case COMBIOS_MOBILE_INFO_TABLE: |
- | |
219 | check_offset = RBIOS16(rdev->bios_header_start + 0x42); |
177 | break; |
220 | if (check_offset) |
178 | case COMBIOS_MOBILE_INFO_TABLE: |
221 | offset = check_offset; |
- | |
222 | break; |
179 | check_offset = 0x42; |
223 | case COMBIOS_PLL_INIT_TABLE: |
- | |
224 | check_offset = RBIOS16(rdev->bios_header_start + 0x46); |
180 | break; |
225 | if (check_offset) |
181 | case COMBIOS_PLL_INIT_TABLE: |
226 | offset = check_offset; |
- | |
227 | break; |
182 | check_offset = 0x46; |
228 | case COMBIOS_MEM_CONFIG_TABLE: |
- | |
229 | check_offset = RBIOS16(rdev->bios_header_start + 0x48); |
183 | break; |
230 | if (check_offset) |
184 | case COMBIOS_MEM_CONFIG_TABLE: |
231 | offset = check_offset; |
- | |
232 | break; |
185 | check_offset = 0x48; |
233 | case COMBIOS_SAVE_MASK_TABLE: |
- | |
234 | check_offset = RBIOS16(rdev->bios_header_start + 0x4a); |
186 | break; |
235 | if (check_offset) |
187 | case COMBIOS_SAVE_MASK_TABLE: |
236 | offset = check_offset; |
- | |
237 | break; |
188 | check_offset = 0x4a; |
238 | case COMBIOS_HARDCODED_EDID_TABLE: |
- | |
239 | check_offset = RBIOS16(rdev->bios_header_start + 0x4c); |
189 | break; |
240 | if (check_offset) |
190 | case COMBIOS_HARDCODED_EDID_TABLE: |
241 | offset = check_offset; |
- | |
242 | break; |
191 | check_offset = 0x4c; |
243 | case COMBIOS_ASIC_INIT_2_TABLE: |
- | |
244 | check_offset = RBIOS16(rdev->bios_header_start + 0x4e); |
192 | break; |
245 | if (check_offset) |
193 | case COMBIOS_ASIC_INIT_2_TABLE: |
246 | offset = check_offset; |
- | |
247 | break; |
194 | check_offset = 0x4e; |
248 | case COMBIOS_CONNECTOR_INFO_TABLE: |
- | |
249 | check_offset = RBIOS16(rdev->bios_header_start + 0x50); |
195 | break; |
250 | if (check_offset) |
196 | case COMBIOS_CONNECTOR_INFO_TABLE: |
251 | offset = check_offset; |
- | |
252 | break; |
197 | check_offset = 0x50; |
253 | case COMBIOS_DYN_CLK_1_TABLE: |
- | |
254 | check_offset = RBIOS16(rdev->bios_header_start + 0x52); |
198 | break; |
255 | if (check_offset) |
199 | case COMBIOS_DYN_CLK_1_TABLE: |
256 | offset = check_offset; |
- | |
257 | break; |
200 | check_offset = 0x52; |
258 | case COMBIOS_RESERVED_MEM_TABLE: |
- | |
259 | check_offset = RBIOS16(rdev->bios_header_start + 0x54); |
201 | break; |
260 | if (check_offset) |
202 | case COMBIOS_RESERVED_MEM_TABLE: |
261 | offset = check_offset; |
- | |
262 | break; |
203 | check_offset = 0x54; |
263 | case COMBIOS_EXT_TMDS_INFO_TABLE: |
- | |
264 | check_offset = RBIOS16(rdev->bios_header_start + 0x58); |
204 | break; |
265 | if (check_offset) |
205 | case COMBIOS_EXT_TMDS_INFO_TABLE: |
266 | offset = check_offset; |
- | |
267 | break; |
206 | check_offset = 0x58; |
268 | case COMBIOS_MEM_CLK_INFO_TABLE: |
- | |
269 | check_offset = RBIOS16(rdev->bios_header_start + 0x5a); |
207 | break; |
270 | if (check_offset) |
208 | case COMBIOS_MEM_CLK_INFO_TABLE: |
271 | offset = check_offset; |
- | |
272 | break; |
209 | check_offset = 0x5a; |
273 | case COMBIOS_EXT_DAC_INFO_TABLE: |
- | |
274 | check_offset = RBIOS16(rdev->bios_header_start + 0x5c); |
210 | break; |
275 | if (check_offset) |
211 | case COMBIOS_EXT_DAC_INFO_TABLE: |
276 | offset = check_offset; |
- | |
277 | break; |
212 | check_offset = 0x5c; |
278 | case COMBIOS_MISC_INFO_TABLE: |
- | |
279 | check_offset = RBIOS16(rdev->bios_header_start + 0x5e); |
213 | break; |
280 | if (check_offset) |
214 | case COMBIOS_MISC_INFO_TABLE: |
281 | offset = check_offset; |
- | |
282 | break; |
215 | check_offset = 0x5e; |
283 | case COMBIOS_CRT_INFO_TABLE: |
- | |
284 | check_offset = RBIOS16(rdev->bios_header_start + 0x60); |
216 | break; |
285 | if (check_offset) |
217 | case COMBIOS_CRT_INFO_TABLE: |
286 | offset = check_offset; |
- | |
287 | break; |
218 | check_offset = 0x60; |
288 | case COMBIOS_INTEGRATED_SYSTEM_INFO_TABLE: |
- | |
289 | check_offset = RBIOS16(rdev->bios_header_start + 0x62); |
219 | break; |
290 | if (check_offset) |
220 | case COMBIOS_INTEGRATED_SYSTEM_INFO_TABLE: |
291 | offset = check_offset; |
- | |
292 | break; |
221 | check_offset = 0x62; |
293 | case COMBIOS_COMPONENT_VIDEO_INFO_TABLE: |
- | |
294 | check_offset = RBIOS16(rdev->bios_header_start + 0x64); |
222 | break; |
295 | if (check_offset) |
223 | case COMBIOS_COMPONENT_VIDEO_INFO_TABLE: |
296 | offset = check_offset; |
- | |
297 | break; |
224 | check_offset = 0x64; |
298 | case COMBIOS_FAN_SPEED_INFO_TABLE: |
- | |
299 | check_offset = RBIOS16(rdev->bios_header_start + 0x66); |
225 | break; |
300 | if (check_offset) |
226 | case COMBIOS_FAN_SPEED_INFO_TABLE: |
301 | offset = check_offset; |
- | |
302 | break; |
227 | check_offset = 0x66; |
303 | case COMBIOS_OVERDRIVE_INFO_TABLE: |
- | |
304 | check_offset = RBIOS16(rdev->bios_header_start + 0x68); |
228 | break; |
305 | if (check_offset) |
229 | case COMBIOS_OVERDRIVE_INFO_TABLE: |
306 | offset = check_offset; |
- | |
307 | break; |
230 | check_offset = 0x68; |
308 | case COMBIOS_OEM_INFO_TABLE: |
- | |
309 | check_offset = RBIOS16(rdev->bios_header_start + 0x6a); |
231 | break; |
310 | if (check_offset) |
232 | case COMBIOS_OEM_INFO_TABLE: |
311 | offset = check_offset; |
- | |
312 | break; |
233 | check_offset = 0x6a; |
313 | case COMBIOS_DYN_CLK_2_TABLE: |
- | |
314 | check_offset = RBIOS16(rdev->bios_header_start + 0x6c); |
234 | break; |
315 | if (check_offset) |
235 | case COMBIOS_DYN_CLK_2_TABLE: |
316 | offset = check_offset; |
- | |
317 | break; |
236 | check_offset = 0x6c; |
318 | case COMBIOS_POWER_CONNECTOR_INFO_TABLE: |
- | |
319 | check_offset = RBIOS16(rdev->bios_header_start + 0x6e); |
237 | break; |
320 | if (check_offset) |
238 | case COMBIOS_POWER_CONNECTOR_INFO_TABLE: |
321 | offset = check_offset; |
- | |
322 | break; |
239 | check_offset = 0x6e; |
323 | case COMBIOS_I2C_INFO_TABLE: |
- | |
324 | check_offset = RBIOS16(rdev->bios_header_start + 0x70); |
240 | break; |
325 | if (check_offset) |
241 | case COMBIOS_I2C_INFO_TABLE: |
326 | offset = check_offset; |
242 | check_offset = 0x70; |
327 | break; |
243 | break; |
328 | /* relative offset tables */ |
244 | /* relative offset tables */ |
Line 437... | Line 353... | ||
437 | if (check_offset) |
353 | if (check_offset) |
438 | offset = check_offset; |
354 | offset = check_offset; |
439 | } |
355 | } |
440 | break; |
356 | break; |
441 | default: |
357 | default: |
- | 358 | check_offset = 0; |
|
442 | break; |
359 | break; |
443 | } |
360 | } |
Line -... | Line 361... | ||
- | 361 | ||
444 | 362 | size = RBIOS8(rdev->bios_header_start + 0x6); |
|
- | 363 | /* check absolute offset tables */ |
|
- | 364 | if (table < COMBIOS_ASIC_INIT_3_TABLE && check_offset && check_offset < size) |
|
Line -... | Line 365... | ||
- | 365 | offset = RBIOS16(rdev->bios_header_start + check_offset); |
|
445 | return offset; |
366 | |
Line 446... | Line 367... | ||
446 | 367 | return offset; |
|
447 | } |
368 | } |
448 | 369 | ||
Line 963... | Line 884... | ||
963 | } else { |
884 | } else { |
964 | bg = RBIOS8(dac_info + 0x2) & 0xf; |
885 | bg = RBIOS8(dac_info + 0x2) & 0xf; |
965 | dac = RBIOS8(dac_info + 0x3) & 0xf; |
886 | dac = RBIOS8(dac_info + 0x3) & 0xf; |
966 | p_dac->ps2_pdac_adj = (bg << 8) | (dac); |
887 | p_dac->ps2_pdac_adj = (bg << 8) | (dac); |
967 | } |
888 | } |
968 | /* if the values are all zeros, use the table */ |
889 | /* if the values are zeros, use the table */ |
969 | if (p_dac->ps2_pdac_adj) |
890 | if ((dac == 0) || (bg == 0)) |
- | 891 | found = 0; |
|
- | 892 | else |
|
970 | found = 1; |
893 | found = 1; |
971 | } |
894 | } |
Line 972... | Line 895... | ||
972 | 895 | ||
- | 896 | /* quirks */ |
|
- | 897 | /* Radeon 7000 (RV100) */ |
|
- | 898 | if (((dev->pdev->device == 0x5159) && |
|
- | 899 | (dev->pdev->subsystem_vendor == 0x174B) && |
|
973 | /* quirks */ |
900 | (dev->pdev->subsystem_device == 0x7c28)) || |
974 | /* Radeon 9100 (R200) */ |
901 | /* Radeon 9100 (R200) */ |
975 | if ((dev->pdev->device == 0x514D) && |
902 | ((dev->pdev->device == 0x514D) && |
976 | (dev->pdev->subsystem_vendor == 0x174B) && |
903 | (dev->pdev->subsystem_vendor == 0x174B) && |
977 | (dev->pdev->subsystem_device == 0x7149)) { |
904 | (dev->pdev->subsystem_device == 0x7149))) { |
978 | /* vbios value is bad, use the default */ |
905 | /* vbios value is bad, use the default */ |
979 | found = 0; |
906 | found = 0; |
Line 980... | Line 907... | ||
980 | } |
907 | } |