diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-07-01 01:33:45 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-07-12 20:13:15 -0400 |
commit | ec7fc4a1a7b322380d053fb04bfc4537be3cdfe5 (patch) | |
tree | c091a7c4a55072cf4fd455470691ef473c48e603 /drivers/gpu/drm/nouveau/nv50_crtc.c | |
parent | df4cf1b72d726d788388858673fa61e42fdb9ad8 (diff) |
drm/nv50: supply encoder disable() hook for SOR outputs
Allows us to remove a driver hack that used to be necessary to disable
encoders in certain situations before setting up a mode. The DRM has
better knowledge of when this is needed than the driver does.
This fixes a number of display switching issues.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_crtc.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_crtc.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_crtc.c b/drivers/gpu/drm/nouveau/nv50_crtc.c index b4e4a3b05ea..fb3ed5d80aa 100644 --- a/drivers/gpu/drm/nouveau/nv50_crtc.c +++ b/drivers/gpu/drm/nouveau/nv50_crtc.c | |||
@@ -440,40 +440,9 @@ nv50_crtc_prepare(struct drm_crtc *crtc) | |||
440 | { | 440 | { |
441 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); | 441 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); |
442 | struct drm_device *dev = crtc->dev; | 442 | struct drm_device *dev = crtc->dev; |
443 | struct drm_encoder *encoder; | ||
444 | uint32_t dac = 0, sor = 0; | ||
445 | 443 | ||
446 | NV_DEBUG_KMS(dev, "index %d\n", nv_crtc->index); | 444 | NV_DEBUG_KMS(dev, "index %d\n", nv_crtc->index); |
447 | 445 | ||
448 | /* Disconnect all unused encoders. */ | ||
449 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | ||
450 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); | ||
451 | |||
452 | if (!drm_helper_encoder_in_use(encoder)) | ||
453 | continue; | ||
454 | |||
455 | if (nv_encoder->dcb->type == OUTPUT_ANALOG || | ||
456 | nv_encoder->dcb->type == OUTPUT_TV) | ||
457 | dac |= (1 << nv_encoder->or); | ||
458 | else | ||
459 | sor |= (1 << nv_encoder->or); | ||
460 | } | ||
461 | |||
462 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | ||
463 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); | ||
464 | |||
465 | if (nv_encoder->dcb->type == OUTPUT_ANALOG || | ||
466 | nv_encoder->dcb->type == OUTPUT_TV) { | ||
467 | if (dac & (1 << nv_encoder->or)) | ||
468 | continue; | ||
469 | } else { | ||
470 | if (sor & (1 << nv_encoder->or)) | ||
471 | continue; | ||
472 | } | ||
473 | |||
474 | nv_encoder->disconnect(nv_encoder); | ||
475 | } | ||
476 | |||
477 | nv50_crtc_blank(nv_crtc, true); | 446 | nv50_crtc_blank(nv_crtc, true); |
478 | } | 447 | } |
479 | 448 | ||