aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv04_dfp.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-08-20 08:19:45 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-08-26 01:11:24 -0400
commitd31e078d847fb2816d26c9476f4a68e89dc65a0b (patch)
tree0a5273cd2a0b0cff2dd54421900c97c3129362d8 /drivers/gpu/drm/nouveau/nv04_dfp.c
parentf5cb8ab1541390d5ac3bb906f81c4300d0fdb574 (diff)
drm/nouveau: Fix backlight control on PPC machines with an internal TMDS panel.
This commit fixes fdo bug 29685. Reported-by: Vlado Plaga <rechner@vlado-do.de> Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv04_dfp.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv04_dfp.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/nv04_dfp.c
index ea89f6e69d4c..0d3206a7046c 100644
--- a/drivers/gpu/drm/nouveau/nv04_dfp.c
+++ b/drivers/gpu/drm/nouveau/nv04_dfp.c
@@ -475,6 +475,27 @@ static void nv04_dfp_commit(struct drm_encoder *encoder)
475 nv_crtc->index, '@' + ffs(nv_encoder->dcb->or)); 475 nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
476} 476}
477 477
478static void nv04_dfp_update_backlight(struct drm_encoder *encoder, int mode)
479{
480#ifdef __powerpc__
481 struct drm_device *dev = encoder->dev;
482
483 /* BIOS scripts usually take care of the backlight, thanks
484 * Apple for your consistency.
485 */
486 if (dev->pci_device == 0x0179 || dev->pci_device == 0x0189 ||
487 dev->pci_device == 0x0329) {
488 if (mode == DRM_MODE_DPMS_ON) {
489 nv_mask(dev, NV_PBUS_DEBUG_DUALHEAD_CTL, 0, 1 << 31);
490 nv_mask(dev, NV_PCRTC_GPIO_EXT, 3, 1);
491 } else {
492 nv_mask(dev, NV_PBUS_DEBUG_DUALHEAD_CTL, 1 << 31, 0);
493 nv_mask(dev, NV_PCRTC_GPIO_EXT, 3, 0);
494 }
495 }
496#endif
497}
498
478static inline bool is_powersaving_dpms(int mode) 499static inline bool is_powersaving_dpms(int mode)
479{ 500{
480 return (mode != DRM_MODE_DPMS_ON); 501 return (mode != DRM_MODE_DPMS_ON);
@@ -522,6 +543,7 @@ static void nv04_lvds_dpms(struct drm_encoder *encoder, int mode)
522 LVDS_PANEL_OFF, 0); 543 LVDS_PANEL_OFF, 0);
523 } 544 }
524 545
546 nv04_dfp_update_backlight(encoder, mode);
525 nv04_dfp_update_fp_control(encoder, mode); 547 nv04_dfp_update_fp_control(encoder, mode);
526 548
527 if (mode == DRM_MODE_DPMS_ON) 549 if (mode == DRM_MODE_DPMS_ON)
@@ -545,6 +567,7 @@ static void nv04_tmds_dpms(struct drm_encoder *encoder, int mode)
545 NV_INFO(dev, "Setting dpms mode %d on tmds encoder (output %d)\n", 567 NV_INFO(dev, "Setting dpms mode %d on tmds encoder (output %d)\n",
546 mode, nv_encoder->dcb->index); 568 mode, nv_encoder->dcb->index);
547 569
570 nv04_dfp_update_backlight(encoder, mode);
548 nv04_dfp_update_fp_control(encoder, mode); 571 nv04_dfp_update_fp_control(encoder, mode);
549} 572}
550 573