Skip to content

Commit

Permalink
drm/nvd0/disp: dac load detect
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Skeggs committed Sep 20, 2011
1 parent 629c1b9 commit b681993
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion drivers/gpu/drm/nouveau/nvd0_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,22 @@ nvd0_dac_disconnect(struct drm_encoder *encoder)
static enum drm_connector_status
nvd0_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector)
{
return connector_status_disconnected;
enum drm_connector_status status = connector_status_disconnected;
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
struct drm_device *dev = encoder->dev;
int or = nv_encoder->or;
u32 load;

nv_wr32(dev, 0x61a00c + (or * 0x800), 0x00100000);
udelay(9500);
nv_wr32(dev, 0x61a00c + (or * 0x800), 0x80000000);

load = nv_rd32(dev, 0x61a00c + (or * 0x800));
if ((load & 0x38000000) == 0x38000000)
status = connector_status_connected;

nv_wr32(dev, 0x61a00c + (or * 0x800), 0x00000000);
return status;
}

static void
Expand Down

0 comments on commit b681993

Please sign in to comment.