Commit 28ec70f7 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/bios: suppress some parser errors when dry-running scripts

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 3f196a04
...@@ -64,27 +64,33 @@ init_exec_force(struct nvbios_init *init, bool exec) ...@@ -64,27 +64,33 @@ init_exec_force(struct nvbios_init *init, bool exec)
static inline int static inline int
init_or(struct nvbios_init *init) init_or(struct nvbios_init *init)
{ {
if (init_exec(init)) {
if (init->outp) if (init->outp)
return ffs(init->outp->or) - 1; return ffs(init->outp->or) - 1;
error("script needs OR!!\n"); error("script needs OR!!\n");
}
return 0; return 0;
} }
static inline int static inline int
init_link(struct nvbios_init *init) init_link(struct nvbios_init *init)
{ {
if (init_exec(init)) {
if (init->outp) if (init->outp)
return !(init->outp->sorconf.link & 1); return !(init->outp->sorconf.link & 1);
error("script needs OR link\n"); error("script needs OR link\n");
}
return 0; return 0;
} }
static inline int static inline int
init_crtc(struct nvbios_init *init) init_crtc(struct nvbios_init *init)
{ {
if (init_exec(init)) {
if (init->crtc >= 0) if (init->crtc >= 0)
return init->crtc; return init->crtc;
error("script needs crtc\n"); error("script needs crtc\n");
}
return 0; return 0;
} }
...@@ -92,16 +98,21 @@ static u8 ...@@ -92,16 +98,21 @@ static u8
init_conn(struct nvbios_init *init) init_conn(struct nvbios_init *init)
{ {
struct nouveau_bios *bios = init->bios; struct nouveau_bios *bios = init->bios;
u8 ver, len;
u16 conn;
if (init_exec(init)) {
if (init->outp) { if (init->outp) {
u8 ver, len; conn = init->outp->connector;
u16 conn = dcb_conn(bios, init->outp->connector, &ver, &len); conn = dcb_conn(bios, conn, &ver, &len);
if (conn) if (conn)
return nv_ro08(bios, conn); return nv_ro08(bios, conn);
} }
error("script needs connector type\n"); error("script needs connector type\n");
return 0x00; }
return 0xff;
} }
static inline u32 static inline u32
...@@ -227,6 +238,7 @@ init_i2c(struct nvbios_init *init, int index) ...@@ -227,6 +238,7 @@ init_i2c(struct nvbios_init *init, int index)
} else } else
if (index < 0) { if (index < 0) {
if (!init->outp) { if (!init->outp) {
if (init_exec(init))
error("script needs output for i2c\n"); error("script needs output for i2c\n");
return NULL; return NULL;
} }
...@@ -544,6 +556,7 @@ init_tmds_reg(struct nvbios_init *init, u8 tmds) ...@@ -544,6 +556,7 @@ init_tmds_reg(struct nvbios_init *init, u8 tmds)
return 0x6808b0 + dacoffset; return 0x6808b0 + dacoffset;
} }
if (init_exec(init))
error("tmds opcodes need dcb\n"); error("tmds opcodes need dcb\n");
} else { } else {
if (tmds < ARRAY_SIZE(pramdac_table)) if (tmds < ARRAY_SIZE(pramdac_table))
...@@ -792,6 +805,7 @@ init_dp_condition(struct nvbios_init *init) ...@@ -792,6 +805,7 @@ init_dp_condition(struct nvbios_init *init)
break; break;
} }
if (init_exec(init))
warn("script needs dp output table data\n"); warn("script needs dp output table data\n");
break; break;
case 5: case 5:
......
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