Lines Matching refs:mthd
43 struct shadow *mthd = (void *)nv_object(bios)->oclass; in shadow_fetch() local
46 void *data = mthd->data; in shadow_fetch()
48 u32 read = mthd->func->read(data, start, limit - start, bios); in shadow_fetch()
92 shadow_image(struct nvkm_bios *bios, int idx, struct shadow *mthd) in shadow_image() argument
113 if (mthd->func->rw) in shadow_image()
126 score += shadow_image(bios, idx + 1, mthd); in shadow_image()
131 shadow_score(struct nvkm_bios *bios, struct shadow *mthd) in shadow_score() argument
135 nv_object(bios)->oclass = &mthd->base; in shadow_score()
136 score = shadow_image(bios, 0, mthd); in shadow_score()
143 shadow_method(struct nvkm_bios *bios, struct shadow *mthd, const char *name) in shadow_method() argument
145 const struct nvbios_source *func = mthd->func; in shadow_method()
149 mthd->data = func->init(bios, name); in shadow_method()
150 if (IS_ERR(mthd->data)) { in shadow_method()
151 mthd->data = NULL; in shadow_method()
155 mthd->score = shadow_score(bios, mthd); in shadow_method()
157 func->fini(mthd->data); in shadow_method()
158 nv_debug(bios, "scored %d\n", mthd->score); in shadow_method()
159 mthd->data = bios->data; in shadow_method()
160 mthd->size = bios->size; in shadow_method()
164 return mthd->score; in shadow_method()
210 }, *mthd = mthds, *best = NULL; in nvbios_shadow() local
220 for (mthd = mthds; mthd->func; mthd++) { in nvbios_shadow()
221 if (mthd->func->name && in nvbios_shadow()
222 !strcasecmp(source, mthd->func->name)) { in nvbios_shadow()
223 best = mthd; in nvbios_shadow()
224 if (shadow_method(bios, mthd, NULL)) in nvbios_shadow()
230 if (!best && (best = mthd)) { in nvbios_shadow()
231 mthd->func = &shadow_fw; in nvbios_shadow()
232 shadow_method(bios, mthd, source); in nvbios_shadow()
233 mthd->func = NULL; in nvbios_shadow()
245 for (mthd = mthds, best = mthd; mthd->func; mthd++) { in nvbios_shadow()
246 if (!mthd->skip || best->score < mthd->skip) { in nvbios_shadow()
247 if (shadow_method(bios, mthd, NULL)) { in nvbios_shadow()
248 if (mthd->score > best->score) in nvbios_shadow()
249 best = mthd; in nvbios_shadow()
256 for (mthd = mthds; mthd->func; mthd++) { in nvbios_shadow()
257 if (mthd != best) in nvbios_shadow()
258 kfree(mthd->data); in nvbios_shadow()