aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-07-07 21:14:50 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-09-20 02:07:22 -0400
commitb681993f7a48b847f3129abd8e8b3926c108a0d9 (patch)
tree698aad78e3db4fb95431dc179de45b7211174bae /drivers/gpu
parent629c1b9207386b00abd6453b72a19b15cd2202f8 (diff)
drm/nvd0/disp: dac load detect
VBIOS does more than this, as does nv50/nvc0 driver in nouveau. Traces of the NVIDIA binary driver however, show pretty much just this being done... Seems to work for me, it'll be fine for the moment. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nvd0_display.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvd0_display.c b/drivers/gpu/drm/nouveau/nvd0_display.c
index 6720d63cfccc..f4788d819ed6 100644
--- a/drivers/gpu/drm/nouveau/nvd0_display.c
+++ b/drivers/gpu/drm/nouveau/nvd0_display.c
@@ -685,7 +685,22 @@ nvd0_dac_disconnect(struct drm_encoder *encoder)
685static enum drm_connector_status 685static enum drm_connector_status
686nvd0_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) 686nvd0_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector)
687{ 687{
688 return connector_status_disconnected; 688 enum drm_connector_status status = connector_status_disconnected;
689 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
690 struct drm_device *dev = encoder->dev;
691 int or = nv_encoder->or;
692 u32 load;
693
694 nv_wr32(dev, 0x61a00c + (or * 0x800), 0x00100000);
695 udelay(9500);
696 nv_wr32(dev, 0x61a00c + (or * 0x800), 0x80000000);
697
698 load = nv_rd32(dev, 0x61a00c + (or * 0x800));
699 if ((load & 0x38000000) == 0x38000000)
700 status = connector_status_connected;
701
702 nv_wr32(dev, 0x61a00c + (or * 0x800), 0x00000000);
703 return status;
689} 704}
690 705
691static void 706static void