summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_dac.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-11-09 09:32:56 +1000
committerBen Skeggs <bskeggs@redhat.com>2012-11-29 09:57:49 +1000
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 de964e84c74..34abb588b48 100644
--- a/drivers/gpu/drm/nouveau/nv50_dac.c
+++ b/drivers/gpu/drm/nouveau/nv50_dac.c
@@ -36,6 +36,8 @@
#include "nouveau_crtc.h"
#include "nv50_display.h"
+#include <core/class.h>
+
#include <subdev/timer.h>
static void
@@ -124,7 +126,7 @@ nv50_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector)
static void
nv50_dac_dpms(struct drm_encoder *encoder, int mode)
{
- struct nouveau_device *device = nouveau_dev(encoder->dev);
+ struct nv50_display *priv = nv50_display(encoder->dev);
struct nouveau_drm *drm = nouveau_drm(encoder->dev);
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
uint32_t val;
@@ -132,19 +134,10 @@ nv50_dac_dpms(struct drm_encoder *encoder, int mode)
NV_DEBUG(drm, "or %d mode %d\n", or, mode);
- /* wait for it to be done */
- if (!nv_wait(device, NV50_PDISPLAY_DAC_DPMS_CTRL(or),
- NV50_PDISPLAY_DAC_DPMS_CTRL_PENDING, 0)) {
- NV_ERROR(drm, "timeout: DAC_DPMS_CTRL_PENDING(%d) == 0\n", or);
- NV_ERROR(drm, "DAC_DPMS_CTRL(%d) = 0x%08x\n", or,
- nv_rd32(device, NV50_PDISPLAY_DAC_DPMS_CTRL(or)));
- return;
- }
-
- val = nv_rd32(device, NV50_PDISPLAY_DAC_DPMS_CTRL(or)) & ~0x7F;
-
if (mode != DRM_MODE_DPMS_ON)
- val |= NV50_PDISPLAY_DAC_DPMS_CTRL_BLANKED;
+ val = NV50_PDISPLAY_DAC_DPMS_CTRL_BLANKED;
+ else
+ val = 0;
switch (mode) {
case DRM_MODE_DPMS_STANDBY:
@@ -162,8 +155,7 @@ nv50_dac_dpms(struct drm_encoder *encoder, int mode)
break;
}
- nv_wr32(device, NV50_PDISPLAY_DAC_DPMS_CTRL(or), val |
- NV50_PDISPLAY_DAC_DPMS_CTRL_PENDING);
+ nv_call(priv->core, NV50_DISP_DAC_PWR + or, val);
}
static void