drm/nv50: set DP display power state during DPMS
authorBen Skeggs <bskeggs@redhat.com>
Tue, 6 Jul 2010 01:20:17 +0000 (11:20 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 13 Jul 2010 00:13:34 +0000 (10:13 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nv50_sor.c

index 45a617df6e39004af344ed0da3401ce53c20b9e4..bcd4cf84a7e641cb0d79d5b1d67a8604110a9af3 100644 (file)
@@ -115,8 +115,22 @@ nv50_sor_dpms(struct drm_encoder *encoder, int mode)
                         nv_rd32(dev, NV50_PDISPLAY_SOR_DPMS_STATE(or)));
        }
 
-       if (nv_encoder->dcb->type == OUTPUT_DP && mode == DRM_MODE_DPMS_ON)
-               nouveau_dp_link_train(encoder);
+       if (nv_encoder->dcb->type == OUTPUT_DP) {
+               struct nouveau_i2c_chan *auxch;
+
+               auxch = nouveau_i2c_find(dev, nv_encoder->dcb->i2c_index);
+               if (!auxch)
+                       return;
+
+               if (mode == DRM_MODE_DPMS_ON) {
+                       u8 status = DP_SET_POWER_D0;
+                       nouveau_dp_auxch(auxch, 8, DP_SET_POWER, &status, 1);
+                       nouveau_dp_link_train(encoder);
+               } else {
+                       u8 status = DP_SET_POWER_D3;
+                       nouveau_dp_auxch(auxch, 8, DP_SET_POWER, &status, 1);
+               }
+       }
 }
 
 static void