diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-04-15 00:47:05 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-04-26 01:37:48 -0400 |
commit | 28ec70f7fb2a2cefc098020b2f29f1fc97cdb524 (patch) | |
tree | 196bb587d66722e100b9683d06e4164cb97cc5f2 /drivers/gpu/drm/nouveau/core | |
parent | 3f196a045e2f7e0b7c5302d359a9772c1567d55b (diff) |
drm/nouveau/bios: suppress some parser errors when dry-running scripts
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/bios/init.c | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c index 9c41b58d57e2..346834757343 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c | |||
@@ -64,27 +64,33 @@ init_exec_force(struct nvbios_init *init, bool exec) | |||
64 | static inline int | 64 | static inline int |
65 | init_or(struct nvbios_init *init) | 65 | init_or(struct nvbios_init *init) |
66 | { | 66 | { |
67 | if (init->outp) | 67 | if (init_exec(init)) { |
68 | return ffs(init->outp->or) - 1; | 68 | if (init->outp) |
69 | error("script needs OR!!\n"); | 69 | return ffs(init->outp->or) - 1; |
70 | error("script needs OR!!\n"); | ||
71 | } | ||
70 | return 0; | 72 | return 0; |
71 | } | 73 | } |
72 | 74 | ||
73 | static inline int | 75 | static inline int |
74 | init_link(struct nvbios_init *init) | 76 | init_link(struct nvbios_init *init) |
75 | { | 77 | { |
76 | if (init->outp) | 78 | if (init_exec(init)) { |
77 | return !(init->outp->sorconf.link & 1); | 79 | if (init->outp) |
78 | error("script needs OR link\n"); | 80 | return !(init->outp->sorconf.link & 1); |
81 | error("script needs OR link\n"); | ||
82 | } | ||
79 | return 0; | 83 | return 0; |
80 | } | 84 | } |
81 | 85 | ||
82 | static inline int | 86 | static inline int |
83 | init_crtc(struct nvbios_init *init) | 87 | init_crtc(struct nvbios_init *init) |
84 | { | 88 | { |
85 | if (init->crtc >= 0) | 89 | if (init_exec(init)) { |
86 | return init->crtc; | 90 | if (init->crtc >= 0) |
87 | error("script needs crtc\n"); | 91 | return init->crtc; |
92 | error("script needs crtc\n"); | ||
93 | } | ||
88 | return 0; | 94 | return 0; |
89 | } | 95 | } |
90 | 96 | ||
@@ -92,16 +98,21 @@ static u8 | |||
92 | init_conn(struct nvbios_init *init) | 98 | init_conn(struct nvbios_init *init) |
93 | { | 99 | { |
94 | struct nouveau_bios *bios = init->bios; | 100 | struct nouveau_bios *bios = init->bios; |
101 | u8 ver, len; | ||
102 | u16 conn; | ||
95 | 103 | ||
96 | if (init->outp) { | 104 | if (init_exec(init)) { |
97 | u8 ver, len; | 105 | if (init->outp) { |
98 | u16 conn = dcb_conn(bios, init->outp->connector, &ver, &len); | 106 | conn = init->outp->connector; |
99 | if (conn) | 107 | conn = dcb_conn(bios, conn, &ver, &len); |
100 | return nv_ro08(bios, conn); | 108 | if (conn) |
109 | return nv_ro08(bios, conn); | ||
110 | } | ||
111 | |||
112 | error("script needs connector type\n"); | ||
101 | } | 113 | } |
102 | 114 | ||
103 | error("script needs connector type\n"); | 115 | return 0xff; |
104 | return 0x00; | ||
105 | } | 116 | } |
106 | 117 | ||
107 | static inline u32 | 118 | static inline u32 |
@@ -227,7 +238,8 @@ init_i2c(struct nvbios_init *init, int index) | |||
227 | } else | 238 | } else |
228 | if (index < 0) { | 239 | if (index < 0) { |
229 | if (!init->outp) { | 240 | if (!init->outp) { |
230 | error("script needs output for i2c\n"); | 241 | if (init_exec(init)) |
242 | error("script needs output for i2c\n"); | ||
231 | return NULL; | 243 | return NULL; |
232 | } | 244 | } |
233 | 245 | ||
@@ -544,7 +556,8 @@ init_tmds_reg(struct nvbios_init *init, u8 tmds) | |||
544 | return 0x6808b0 + dacoffset; | 556 | return 0x6808b0 + dacoffset; |
545 | } | 557 | } |
546 | 558 | ||
547 | error("tmds opcodes need dcb\n"); | 559 | if (init_exec(init)) |
560 | error("tmds opcodes need dcb\n"); | ||
548 | } else { | 561 | } else { |
549 | if (tmds < ARRAY_SIZE(pramdac_table)) | 562 | if (tmds < ARRAY_SIZE(pramdac_table)) |
550 | return pramdac_table[tmds]; | 563 | return pramdac_table[tmds]; |
@@ -792,7 +805,8 @@ init_dp_condition(struct nvbios_init *init) | |||
792 | break; | 805 | break; |
793 | } | 806 | } |
794 | 807 | ||
795 | warn("script needs dp output table data\n"); | 808 | if (init_exec(init)) |
809 | warn("script needs dp output table data\n"); | ||
796 | break; | 810 | break; |
797 | case 5: | 811 | case 5: |
798 | if (!(init_rdauxr(init, 0x0d) & 1)) | 812 | if (!(init_rdauxr(init, 0x0d) & 1)) |