aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_dac.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-11-08 18:32:56 -0500
committerBen Skeggs <bskeggs@redhat.com>2012-11-28 18:57:49 -0500
commitef22c8bb7b3fac45919b7fde412d36d1a8367d51 (patch)
tree330649fda5cbc97963a8a0ed88c9c93b65613dc8 /drivers/gpu/drm/nouveau/nv50_dac.c
parent2d0aca211994241c36f2bcfff7141e708f66b005 (diff)
drm/nv50/disp: call into core to handle dac/sor power state changes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_dac.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_dac.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_dac.c b/drivers/gpu/drm/nouveau/nv50_dac.c
index de964e84c74f..34abb588b482 100644
--- a/drivers/gpu/drm/nouveau/nv50_dac.c
+++ b/drivers/gpu/drm/nouveau/nv50_dac.c
@@ -36,6 +36,8 @@
36#include "nouveau_crtc.h" 36#include "nouveau_crtc.h"
37#include "nv50_display.h" 37#include "nv50_display.h"
38 38
39#include <core/class.h>
40
39#include <subdev/timer.h> 41#include <subdev/timer.h>
40 42
41static void 43static void
@@ -124,7 +126,7 @@ nv50_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector)
124static void 126static void
125nv50_dac_dpms(struct drm_encoder *encoder, int mode) 127nv50_dac_dpms(struct drm_encoder *encoder, int mode)
126{ 128{
127 struct nouveau_device *device = nouveau_dev(encoder->dev); 129 struct nv50_display *priv = nv50_display(encoder->dev);
128 struct nouveau_drm *drm = nouveau_drm(encoder->dev); 130 struct nouveau_drm *drm = nouveau_drm(encoder->dev);
129 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 131 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
130 uint32_t val; 132 uint32_t val;
@@ -132,19 +134,10 @@ nv50_dac_dpms(struct drm_encoder *encoder, int mode)
132 134
133 NV_DEBUG(drm, "or %d mode %d\n", or, mode); 135 NV_DEBUG(drm, "or %d mode %d\n", or, mode);
134 136
135 /* wait for it to be done */
136 if (!nv_wait(device, NV50_PDISPLAY_DAC_DPMS_CTRL(or),
137 NV50_PDISPLAY_DAC_DPMS_CTRL_PENDING, 0)) {
138 NV_ERROR(drm, "timeout: DAC_DPMS_CTRL_PENDING(%d) == 0\n", or);
139 NV_ERROR(drm, "DAC_DPMS_CTRL(%d) = 0x%08x\n", or,
140 nv_rd32(device, NV50_PDISPLAY_DAC_DPMS_CTRL(or)));
141 return;
142 }
143
144 val = nv_rd32(device, NV50_PDISPLAY_DAC_DPMS_CTRL(or)) & ~0x7F;
145
146 if (mode != DRM_MODE_DPMS_ON) 137 if (mode != DRM_MODE_DPMS_ON)
147 val |= NV50_PDISPLAY_DAC_DPMS_CTRL_BLANKED; 138 val = NV50_PDISPLAY_DAC_DPMS_CTRL_BLANKED;
139 else
140 val = 0;
148 141
149 switch (mode) { 142 switch (mode) {
150 case DRM_MODE_DPMS_STANDBY: 143 case DRM_MODE_DPMS_STANDBY:
@@ -162,8 +155,7 @@ nv50_dac_dpms(struct drm_encoder *encoder, int mode)
162 break; 155 break;
163 } 156 }
164 157
165 nv_wr32(device, NV50_PDISPLAY_DAC_DPMS_CTRL(or), val | 158 nv_call(priv->core, NV50_DISP_DAC_PWR + or, val);
166 NV50_PDISPLAY_DAC_DPMS_CTRL_PENDING);
167} 159}
168 160
169static void 161static void