diff options
author | Francisco Jerez <currojerez@riseup.net> | 2010-08-30 13:55:52 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-09-24 02:19:09 -0400 |
commit | 217275d03d7e1f3e62c7b0d9718df99456b7c356 (patch) | |
tree | 18637a60e8e767f8415e03e540561db84e8296d6 /drivers/gpu/drm | |
parent | 7314dec95c054258d5e5a3d1d55e1fd042f8eaad (diff) |
drm/nv40: Try to set up CRE_LCD even if it has unknown bits set.
They don't seem to do anything useful, and we really want to program
CRE_LCD if we aren't lucky enough to find the right CRTC binding
already set.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv04_dac.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv04_dfp.c | 35 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv17_tv.c | 13 |
3 files changed, 20 insertions, 36 deletions
diff --git a/drivers/gpu/drm/nouveau/nv04_dac.c b/drivers/gpu/drm/nouveau/nv04_dac.c index 509c05015d5..9cc560c792a 100644 --- a/drivers/gpu/drm/nouveau/nv04_dac.c +++ b/drivers/gpu/drm/nouveau/nv04_dac.c | |||
@@ -352,15 +352,9 @@ static void nv04_dac_prepare(struct drm_encoder *encoder) | |||
352 | helper->dpms(encoder, DRM_MODE_DPMS_OFF); | 352 | helper->dpms(encoder, DRM_MODE_DPMS_OFF); |
353 | 353 | ||
354 | nv04_dfp_disable(dev, head); | 354 | nv04_dfp_disable(dev, head); |
355 | 355 | crtcstate[head].CRTC[NV_CIO_CRE_LCD__INDEX] = 0; | |
356 | /* Some NV4x have unknown values (0x3f, 0x50, 0x54, 0x6b, 0x79, 0x7f) | ||
357 | * at LCD__INDEX which we don't alter | ||
358 | */ | ||
359 | if (!(crtcstate[head].CRTC[NV_CIO_CRE_LCD__INDEX] & 0x44)) | ||
360 | crtcstate[head].CRTC[NV_CIO_CRE_LCD__INDEX] = 0; | ||
361 | } | 356 | } |
362 | 357 | ||
363 | |||
364 | static void nv04_dac_mode_set(struct drm_encoder *encoder, | 358 | static void nv04_dac_mode_set(struct drm_encoder *encoder, |
365 | struct drm_display_mode *mode, | 359 | struct drm_display_mode *mode, |
366 | struct drm_display_mode *adjusted_mode) | 360 | struct drm_display_mode *adjusted_mode) |
diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/nv04_dfp.c index 0d3206a7046..e331b4faeb1 100644 --- a/drivers/gpu/drm/nouveau/nv04_dfp.c +++ b/drivers/gpu/drm/nouveau/nv04_dfp.c | |||
@@ -253,26 +253,21 @@ static void nv04_dfp_prepare(struct drm_encoder *encoder) | |||
253 | 253 | ||
254 | nv04_dfp_prepare_sel_clk(dev, nv_encoder, head); | 254 | nv04_dfp_prepare_sel_clk(dev, nv_encoder, head); |
255 | 255 | ||
256 | /* Some NV4x have unknown values (0x3f, 0x50, 0x54, 0x6b, 0x79, 0x7f) | 256 | *cr_lcd = 0x3; |
257 | * at LCD__INDEX which we don't alter | 257 | |
258 | */ | 258 | if (nv_two_heads(dev)) { |
259 | if (!(*cr_lcd & 0x44)) { | 259 | if (nv_encoder->dcb->location == DCB_LOC_ON_CHIP) |
260 | *cr_lcd = 0x3; | 260 | *cr_lcd |= head ? 0x0 : 0x8; |
261 | 261 | else { | |
262 | if (nv_two_heads(dev)) { | 262 | *cr_lcd |= (nv_encoder->dcb->or << 4) & 0x30; |
263 | if (nv_encoder->dcb->location == DCB_LOC_ON_CHIP) | 263 | if (nv_encoder->dcb->type == OUTPUT_LVDS) |
264 | *cr_lcd |= head ? 0x0 : 0x8; | 264 | *cr_lcd |= 0x30; |
265 | else { | 265 | if ((*cr_lcd & 0x30) == (*cr_lcd_oth & 0x30)) { |
266 | *cr_lcd |= (nv_encoder->dcb->or << 4) & 0x30; | 266 | /* avoid being connected to both crtcs */ |
267 | if (nv_encoder->dcb->type == OUTPUT_LVDS) | 267 | *cr_lcd_oth &= ~0x30; |
268 | *cr_lcd |= 0x30; | 268 | NVWriteVgaCrtc(dev, head ^ 1, |
269 | if ((*cr_lcd & 0x30) == (*cr_lcd_oth & 0x30)) { | 269 | NV_CIO_CRE_LCD__INDEX, |
270 | /* avoid being connected to both crtcs */ | 270 | *cr_lcd_oth); |
271 | *cr_lcd_oth &= ~0x30; | ||
272 | NVWriteVgaCrtc(dev, head ^ 1, | ||
273 | NV_CIO_CRE_LCD__INDEX, | ||
274 | *cr_lcd_oth); | ||
275 | } | ||
276 | } | 271 | } |
277 | } | 272 | } |
278 | } | 273 | } |
diff --git a/drivers/gpu/drm/nouveau/nv17_tv.c b/drivers/gpu/drm/nouveau/nv17_tv.c index 13cdc05b7c2..703c188c32d 100644 --- a/drivers/gpu/drm/nouveau/nv17_tv.c +++ b/drivers/gpu/drm/nouveau/nv17_tv.c | |||
@@ -408,15 +408,10 @@ static void nv17_tv_prepare(struct drm_encoder *encoder) | |||
408 | 408 | ||
409 | } | 409 | } |
410 | 410 | ||
411 | /* Some NV4x have unknown values (0x3f, 0x50, 0x54, 0x6b, 0x79, 0x7f) | 411 | if (tv_norm->kind == CTV_ENC_MODE) |
412 | * at LCD__INDEX which we don't alter | 412 | *cr_lcd = 0x1 | (head ? 0x0 : 0x8); |
413 | */ | 413 | else |
414 | if (!(*cr_lcd & 0x44)) { | 414 | *cr_lcd = 0; |
415 | if (tv_norm->kind == CTV_ENC_MODE) | ||
416 | *cr_lcd = 0x1 | (head ? 0x0 : 0x8); | ||
417 | else | ||
418 | *cr_lcd = 0; | ||
419 | } | ||
420 | 415 | ||
421 | /* Set the DACCLK register */ | 416 | /* Set the DACCLK register */ |
422 | dacclk = (NVReadRAMDAC(dev, 0, dacclk_off) & ~0x30) | 0x1; | 417 | dacclk = (NVReadRAMDAC(dev, 0, dacclk_off) & ~0x30) | 0x1; |