return nvkm_mm_init(&fb->tags, 0, 0, tags, 1);
}
+static int
+nvkm_fb_init_scrub_vpr(struct nvkm_fb *fb)
+{
+ struct nvkm_subdev *subdev = &fb->subdev;
+ int ret;
+
+ nvkm_debug(subdev, "VPR locked, running scrubber binary\n");
+
+ if (!fb->vpr_scrubber.size) {
+ nvkm_warn(subdev, "VPR locked, but no scrubber binary!\n");
+ return 0;
+ }
+
+ ret = fb->func->vpr.scrub(fb);
+ if (ret) {
+ nvkm_error(subdev, "VPR scrubber binary failed\n");
+ return ret;
+ }
+
+ if (fb->func->vpr.scrub_required(fb)) {
+ nvkm_error(subdev, "VPR still locked after scrub!\n");
+ return -EIO;
+ }
+
+ nvkm_debug(subdev, "VPR scrubber binary successful\n");
+ return 0;
+}
+
static int
nvkm_fb_init(struct nvkm_subdev *subdev)
{
if (fb->func->vpr.scrub_required &&
fb->func->vpr.scrub_required(fb)) {
- nvkm_debug(subdev, "VPR locked, running scrubber binary\n");
-
- ret = fb->func->vpr.scrub(fb);
+ ret = nvkm_fb_init_scrub_vpr(fb);
if (ret)
return ret;
-
- if (fb->func->vpr.scrub_required(fb)) {
- nvkm_error(subdev, "VPR still locked after scrub!\n");
- return -EIO;
- }
-
- nvkm_debug(subdev, "VPR scrubber binary successful\n");
}
return 0;
if (ret)
return ret;
- return nvkm_firmware_load_blob(&(*pfb)->subdev, "nvdec/scrubber", "", 0,
- &(*pfb)->vpr_scrubber);
+ nvkm_firmware_load_blob(&(*pfb)->subdev, "nvdec/scrubber", "", 0,
+ &(*pfb)->vpr_scrubber);
+ return 0;
}
int