Skip to content

Commit 5087f51

Browse files
evelikovBen Skeggs
authored andcommitted
drm/nv50/disp: prevent false output detection on the original nv50
Commit ea9197c 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=67382 Tested-by: Martin Peres <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Cc: <[email protected]> # 3.9+ Signed-off-by: Ben Skeggs <[email protected]>
1 parent c865534 commit 5087f51

File tree

1 file changed

+10
-5
lines changed
  • drivers/gpu/drm/nouveau/core/engine/disp

1 file changed

+10
-5
lines changed

drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,23 @@ int
4949
nv50_dac_sense(struct nv50_disp_priv *priv, int or, u32 loadval)
5050
{
5151
const u32 doff = (or * 0x800);
52-
int load = -EINVAL;
52+
5353
nv_mask(priv, 0x61a004 + doff, 0x807f0000, 0x80150000);
5454
nv_wait(priv, 0x61a004 + doff, 0x80000000, 0x00000000);
55+
5556
nv_wr32(priv, 0x61a00c + doff, 0x00100000 | loadval);
5657
mdelay(9);
5758
udelay(500);
58-
nv_wr32(priv, 0x61a00c + doff, 0x80000000);
59-
load = (nv_rd32(priv, 0x61a00c + doff) & 0x38000000) >> 27;
60-
nv_wr32(priv, 0x61a00c + doff, 0x00000000);
59+
loadval = nv_mask(priv, 0x61a00c + doff, 0xffffffff, 0x00000000);
60+
6161
nv_mask(priv, 0x61a004 + doff, 0x807f0000, 0x80550000);
6262
nv_wait(priv, 0x61a004 + doff, 0x80000000, 0x00000000);
63-
return load;
63+
64+
nv_debug(priv, "DAC%d sense: 0x%08x\n", or, loadval);
65+
if (!(loadval & 0x80000000))
66+
return -ETIMEDOUT;
67+
68+
return (loadval & 0x38000000) >> 27;
6469
}
6570

6671
int

0 commit comments

Comments
 (0)