Commit 5087f51d authored by Emil Velikov's avatar Emil Velikov Committed by Ben Skeggs

drm/nv50/disp: prevent false output detection on the original nv50

Commit ea9197cc effectively enabled the
use of an improved DAC detection code, but introduced a regression on
the original nv50 chipset, causing a ghost monitor to be detected.

v2 (Ben Skeggs): the offending line was likely a thinko, removed it for
all chipsets (tested nv50 and nve6 to cover entire range) and added
some additional debugging.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67382Tested-by: default avatarMartin Peres <martin.peres@labri.fr>
Signed-off-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
Cc: <stable@vger.kernel.org> # 3.9+
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent c865534f
...@@ -49,18 +49,23 @@ int ...@@ -49,18 +49,23 @@ int
nv50_dac_sense(struct nv50_disp_priv *priv, int or, u32 loadval) nv50_dac_sense(struct nv50_disp_priv *priv, int or, u32 loadval)
{ {
const u32 doff = (or * 0x800); const u32 doff = (or * 0x800);
int load = -EINVAL;
nv_mask(priv, 0x61a004 + doff, 0x807f0000, 0x80150000); nv_mask(priv, 0x61a004 + doff, 0x807f0000, 0x80150000);
nv_wait(priv, 0x61a004 + doff, 0x80000000, 0x00000000); nv_wait(priv, 0x61a004 + doff, 0x80000000, 0x00000000);
nv_wr32(priv, 0x61a00c + doff, 0x00100000 | loadval); nv_wr32(priv, 0x61a00c + doff, 0x00100000 | loadval);
mdelay(9); mdelay(9);
udelay(500); udelay(500);
nv_wr32(priv, 0x61a00c + doff, 0x80000000); loadval = nv_mask(priv, 0x61a00c + doff, 0xffffffff, 0x00000000);
load = (nv_rd32(priv, 0x61a00c + doff) & 0x38000000) >> 27;
nv_wr32(priv, 0x61a00c + doff, 0x00000000);
nv_mask(priv, 0x61a004 + doff, 0x807f0000, 0x80550000); nv_mask(priv, 0x61a004 + doff, 0x807f0000, 0x80550000);
nv_wait(priv, 0x61a004 + doff, 0x80000000, 0x00000000); nv_wait(priv, 0x61a004 + doff, 0x80000000, 0x00000000);
return load;
nv_debug(priv, "DAC%d sense: 0x%08x\n", or, loadval);
if (!(loadval & 0x80000000))
return -ETIMEDOUT;
return (loadval & 0x38000000) >> 27;
} }
int int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment