diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-02-16 13:49:21 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-02-20 16:01:01 +1000 |
commit | 46c13c131d3b73080aa0f50f45e834a9ab3c0e71 (patch) | |
tree | 5d07f5f26e04a6eb4d0bcd41107cd50e3ba4e23b /drivers/gpu/drm/nouveau/core/engine/disp/nv50.c | |
parent | ac8cc241a81941932da44993242e68c62e115ec7 (diff) | |
download | op-kernel-dev-46c13c131d3b73080aa0f50f45e834a9ab3c0e71.zip op-kernel-dev-46c13c131d3b73080aa0f50f45e834a9ab3c0e71.tar.gz |
drm/nv50-/disp: 0x0000 is a valid udisp config value
Return an out-of-range value instead to signal a failure from
exec_clkcmp().
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/engine/disp/nv50.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/disp/nv50.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c index 78f09c3..c3806122d 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c @@ -863,8 +863,8 @@ exec_clkcmp(struct nv50_disp_priv *priv, int head, int id, u32 pclk, struct nvbios_outp info1; struct nvbios_ocfg info2; u8 ver, hdr, cnt, len; - u16 data, conf; u32 ctrl = 0x00000000; + u32 data, conf = ~0; int i; for (i = 0; !(ctrl & (1 << head)) && i < 3; i++) @@ -885,12 +885,12 @@ exec_clkcmp(struct nv50_disp_priv *priv, int head, int id, u32 pclk, } if (!(ctrl & (1 << head))) - return 0x0000; + return conf; i--; data = exec_lookup(priv, head, i, ctrl, outp, &ver, &hdr, &cnt, &len, &info1); if (!data) - return 0x0000; + return conf; switch (outp->type) { case DCB_OUTPUT_TMDS: @@ -923,13 +923,11 @@ exec_clkcmp(struct nv50_disp_priv *priv, int head, int id, u32 pclk, .execute = 1, }; - if (nvbios_exec(&init)) - return 0x0000; - return conf; + nvbios_exec(&init); } } - return 0x0000; + return conf; } static void @@ -1082,7 +1080,7 @@ nv50_disp_intr_unk20(struct nv50_disp_priv *priv, u32 super) if (head >= 0) { u32 pclk = nv_rd32(priv, 0x610ad0 + (head * 0x540)) & 0x3fffff; u32 conf = exec_clkcmp(priv, head, 0, pclk, &outp); - if (conf) { + if (conf != ~0) { if (outp.type == DCB_OUTPUT_ANALOG) { addr = 0x614280 + (ffs(outp.or) - 1) * 0x800; mask = 0xffffffff; @@ -1132,7 +1130,7 @@ nv50_disp_intr_unk40(struct nv50_disp_priv *priv, u32 super) if (head >= 0) { struct dcb_output outp; u32 pclk = nv_rd32(priv, 0x610ad0 + (head * 0x540)) & 0x3fffff; - if (pclk && exec_clkcmp(priv, head, 1, pclk, &outp)) { + if (exec_clkcmp(priv, head, 1, pclk, &outp) != ~0) { if (outp.type == DCB_OUTPUT_TMDS) nv50_disp_intr_unk40_tmds(priv, &outp); } |