aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvd0_display.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-11-08 12:08:55 +1000
committerBen Skeggs <bskeggs@redhat.com>2012-11-29 09:57:46 +1000
commit35b21d39a541a5c3678520004a66d6b6d8700964 (patch)
tree0cce16aadc4054bb12d7edddf58f3495941b6c09 /drivers/gpu/drm/nouveau/nvd0_display.c
parent74b6685089591fa275929109f7b839bf386890a0 (diff)
drm/nvd0/disp: call into core to handle dac power state changes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvd0_display.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvd0_display.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/drivers/gpu/drm/nouveau/nvd0_display.c b/drivers/gpu/drm/nouveau/nvd0_display.c
index ea1ae0da71d0..ac12af7057bd 100644
--- a/drivers/gpu/drm/nouveau/nvd0_display.c
+++ b/drivers/gpu/drm/nouveau/nvd0_display.c
@@ -1076,20 +1076,17 @@ static void
nvd0_dac_dpms(struct drm_encoder *encoder, int mode)
{
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
- struct drm_device *dev = encoder->dev;
- struct nouveau_device *device = nouveau_dev(dev);
+ struct nvd0_disp *disp = nvd0_disp(encoder->dev);
int or = nv_encoder->or;
u32 dpms_ctrl;
- dpms_ctrl = 0x80000000;
+ dpms_ctrl = 0x00000000;
if (mode == DRM_MODE_DPMS_STANDBY || mode == DRM_MODE_DPMS_OFF)
dpms_ctrl |= 0x00000001;
if (mode == DRM_MODE_DPMS_SUSPEND || mode == DRM_MODE_DPMS_OFF)
dpms_ctrl |= 0x00000004;
- nv_wait(device, 0x61a004 + (or * 0x0800), 0x80000000, 0x00000000);
- nv_mask(device, 0x61a004 + (or * 0x0800), 0xc000007f, dpms_ctrl);
- nv_wait(device, 0x61a004 + (or * 0x0800), 0x80000000, 0x00000000);
+ nv_call(disp->core, NV50_DISP_DAC_PWR + or, dpms_ctrl);
}
static bool
@@ -1177,23 +1174,15 @@ nvd0_dac_disconnect(struct drm_encoder *encoder)
static enum drm_connector_status
nvd0_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector)
{
- enum drm_connector_status status = connector_status_disconnected;
- struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
- struct drm_device *dev = encoder->dev;
- struct nouveau_device *device = nouveau_dev(dev);
- int or = nv_encoder->or;
+ struct nvd0_disp *disp = nvd0_disp(encoder->dev);
+ int ret, or = nouveau_encoder(encoder)->or;
u32 load;
- nv_wr32(device, 0x61a00c + (or * 0x800), 0x00100000);
- udelay(9500);
- nv_wr32(device, 0x61a00c + (or * 0x800), 0x80000000);
-
- load = nv_rd32(device, 0x61a00c + (or * 0x800));
- if ((load & 0x38000000) == 0x38000000)
- status = connector_status_connected;
+ ret = nv_exec(disp->core, NV50_DISP_DAC_LOAD + or, &load, sizeof(load));
+ if (ret || load != 7)
+ return connector_status_disconnected;
- nv_wr32(device, 0x61a00c + (or * 0x800), 0x00000000);
- return status;
+ return connector_status_connected;
}
static void