Rev 4560 | Rev 5354 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4560 | Rev 5060 | ||
---|---|---|---|
Line 119... | Line 119... | ||
119 | out_buf[1] = 0; |
119 | out_buf[1] = 0; |
Line 120... | Line 120... | ||
120 | 120 | ||
121 | if (i2c_transfer(adapter, msgs, 2) == 2) { |
121 | if (i2c_transfer(adapter, msgs, 2) == 2) { |
122 | *ch = in_buf[0]; |
122 | *ch = in_buf[0]; |
123 | return true; |
123 | return true; |
Line 124... | Line 124... | ||
124 | }; |
124 | } |
125 | 125 | ||
126 | if (!ns->quiet) { |
126 | if (!ns->quiet) { |
127 | DRM_DEBUG_KMS |
127 | DRM_DEBUG_KMS |
Line 231... | Line 231... | ||
231 | 231 | ||
232 | static enum drm_mode_status ns2501_mode_valid(struct intel_dvo_device *dvo, |
232 | static enum drm_mode_status ns2501_mode_valid(struct intel_dvo_device *dvo, |
233 | struct drm_display_mode *mode) |
233 | struct drm_display_mode *mode) |
234 | { |
234 | { |
235 | DRM_DEBUG_KMS |
235 | DRM_DEBUG_KMS |
236 | ("%s: is mode valid (hdisplay=%d,htotal=%d,vdisplay=%d,vtotal=%d)\n", |
236 | ("is mode valid (hdisplay=%d,htotal=%d,vdisplay=%d,vtotal=%d)\n", |
237 | __FUNCTION__, mode->hdisplay, mode->htotal, mode->vdisplay, |
- | |
Line 238... | Line 237... | ||
238 | mode->vtotal); |
237 | mode->hdisplay, mode->htotal, mode->vdisplay, mode->vtotal); |
239 | 238 | ||
240 | /* |
239 | /* |
241 | * Currently, these are all the modes I have data from. |
240 | * Currently, these are all the modes I have data from. |
Line 259... | Line 258... | ||
259 | bool ok; |
258 | bool ok; |
260 | int retries = 10; |
259 | int retries = 10; |
261 | struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv); |
260 | struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv); |
Line 262... | Line 261... | ||
262 | 261 | ||
263 | DRM_DEBUG_KMS |
262 | DRM_DEBUG_KMS |
264 | ("%s: set mode (hdisplay=%d,htotal=%d,vdisplay=%d,vtotal=%d).\n", |
263 | ("set mode (hdisplay=%d,htotal=%d,vdisplay=%d,vtotal=%d).\n", |
265 | __FUNCTION__, mode->hdisplay, mode->htotal, mode->vdisplay, |
- | |
Line 266... | Line 264... | ||
266 | mode->vtotal); |
264 | mode->hdisplay, mode->htotal, mode->vdisplay, mode->vtotal); |
267 | 265 | ||
268 | /* |
266 | /* |
269 | * Where do I find the native resolution for which scaling is not required??? |
267 | * Where do I find the native resolution for which scaling is not required??? |
Line 275... | Line 273... | ||
275 | ok = true; |
273 | ok = true; |
Line 276... | Line 274... | ||
276 | 274 | ||
277 | if (mode->hdisplay == 800 && mode->vdisplay == 600) { |
275 | if (mode->hdisplay == 800 && mode->vdisplay == 600) { |
278 | /* mode 277 */ |
276 | /* mode 277 */ |
279 | ns->reg_8_shadow &= ~NS2501_8_BPAS; |
277 | ns->reg_8_shadow &= ~NS2501_8_BPAS; |
280 | DRM_DEBUG_KMS("%s: switching to 800x600\n", |
- | |
Line 281... | Line 278... | ||
281 | __FUNCTION__); |
278 | DRM_DEBUG_KMS("switching to 800x600\n"); |
282 | 279 | ||
283 | /* |
280 | /* |
284 | * No, I do not know where this data comes from. |
281 | * No, I do not know where this data comes from. |
Line 339... | Line 336... | ||
339 | ok &= ns2501_writeb(dvo, 0xc7, 0x73); |
336 | ok &= ns2501_writeb(dvo, 0xc7, 0x73); |
340 | ok &= ns2501_writeb(dvo, 0xc8, 0x02); |
337 | ok &= ns2501_writeb(dvo, 0xc8, 0x02); |
Line 341... | Line 338... | ||
341 | 338 | ||
342 | } else if (mode->hdisplay == 640 && mode->vdisplay == 480) { |
339 | } else if (mode->hdisplay == 640 && mode->vdisplay == 480) { |
343 | /* mode 274 */ |
340 | /* mode 274 */ |
344 | DRM_DEBUG_KMS("%s: switching to 640x480\n", |
- | |
345 | __FUNCTION__); |
341 | DRM_DEBUG_KMS("switching to 640x480\n"); |
346 | /* |
342 | /* |
347 | * No, I do not know where this data comes from. |
343 | * No, I do not know where this data comes from. |
348 | * It is just what the video bios left in the DVO, so |
344 | * It is just what the video bios left in the DVO, so |
349 | * I'm just copying it here over. |
345 | * I'm just copying it here over. |
Line 404... | Line 400... | ||
404 | ok &= ns2501_writeb(dvo, 0xc7, 0x02); |
400 | ok &= ns2501_writeb(dvo, 0xc7, 0x02); |
405 | ok &= ns2501_writeb(dvo, 0xc8, 0x02); |
401 | ok &= ns2501_writeb(dvo, 0xc8, 0x02); |
Line 406... | Line 402... | ||
406 | 402 | ||
407 | } else if (mode->hdisplay == 1024 && mode->vdisplay == 768) { |
403 | } else if (mode->hdisplay == 1024 && mode->vdisplay == 768) { |
408 | /* mode 280 */ |
404 | /* mode 280 */ |
409 | DRM_DEBUG_KMS("%s: switching to 1024x768\n", |
- | |
410 | __FUNCTION__); |
405 | DRM_DEBUG_KMS("switching to 1024x768\n"); |
411 | /* |
406 | /* |
412 | * This might or might not work, actually. I'm silently |
407 | * This might or might not work, actually. I'm silently |
413 | * assuming here that the native panel resolution is |
408 | * assuming here that the native panel resolution is |
414 | * 1024x768. If not, then this leaves the scaler disabled |
409 | * 1024x768. If not, then this leaves the scaler disabled |
Line 456... | Line 451... | ||
456 | bool ok; |
451 | bool ok; |
457 | int retries = 10; |
452 | int retries = 10; |
458 | struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv); |
453 | struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv); |
459 | unsigned char ch; |
454 | unsigned char ch; |
Line 460... | Line 455... | ||
460 | 455 | ||
461 | DRM_DEBUG_KMS("%s: Trying set the dpms of the DVO to %i\n", |
- | |
Line 462... | Line 456... | ||
462 | __FUNCTION__, enable); |
456 | DRM_DEBUG_KMS("Trying set the dpms of the DVO to %i\n", enable); |
Line 463... | Line 457... | ||
463 | 457 | ||
464 | ch = ns->reg_8_shadow; |
458 | ch = ns->reg_8_shadow; |
Line 488... | Line 482... | ||
488 | static void ns2501_dump_regs(struct intel_dvo_device *dvo) |
482 | static void ns2501_dump_regs(struct intel_dvo_device *dvo) |
489 | { |
483 | { |
490 | uint8_t val; |
484 | uint8_t val; |
Line 491... | Line 485... | ||
491 | 485 | ||
492 | ns2501_readb(dvo, NS2501_FREQ_LO, &val); |
486 | ns2501_readb(dvo, NS2501_FREQ_LO, &val); |
493 | DRM_LOG_KMS("NS2501_FREQ_LO: 0x%02x\n", val); |
487 | DRM_DEBUG_KMS("NS2501_FREQ_LO: 0x%02x\n", val); |
494 | ns2501_readb(dvo, NS2501_FREQ_HI, &val); |
488 | ns2501_readb(dvo, NS2501_FREQ_HI, &val); |
495 | DRM_LOG_KMS("NS2501_FREQ_HI: 0x%02x\n", val); |
489 | DRM_DEBUG_KMS("NS2501_FREQ_HI: 0x%02x\n", val); |
496 | ns2501_readb(dvo, NS2501_REG8, &val); |
490 | ns2501_readb(dvo, NS2501_REG8, &val); |
497 | DRM_LOG_KMS("NS2501_REG8: 0x%02x\n", val); |
491 | DRM_DEBUG_KMS("NS2501_REG8: 0x%02x\n", val); |
498 | ns2501_readb(dvo, NS2501_REG9, &val); |
492 | ns2501_readb(dvo, NS2501_REG9, &val); |
499 | DRM_LOG_KMS("NS2501_REG9: 0x%02x\n", val); |
493 | DRM_DEBUG_KMS("NS2501_REG9: 0x%02x\n", val); |
500 | ns2501_readb(dvo, NS2501_REGC, &val); |
494 | ns2501_readb(dvo, NS2501_REGC, &val); |
501 | DRM_LOG_KMS("NS2501_REGC: 0x%02x\n", val); |
495 | DRM_DEBUG_KMS("NS2501_REGC: 0x%02x\n", val); |
Line 502... | Line 496... | ||
502 | } |
496 | } |
503 | 497 | ||
504 | static void ns2501_destroy(struct intel_dvo_device *dvo) |
498 | static void ns2501_destroy(struct intel_dvo_device *dvo) |