]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/nouveau/fb/gp102-: allow module to load even when scrubber binary is missing
authorBen Skeggs <bskeggs@redhat.com>
Wed, 29 Jan 2020 01:29:05 +0000 (11:29 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 29 Jan 2020 05:49:56 +0000 (15:49 +1000)
Without relaxing this requirement, TU10x boards will fail to load without
an updated linux-firmware, and TU11x will completely fail to load because
FW isn't available yet.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gp102.c

index d09db7c6b7ee8b26b98542e320cd6b991a33d6c7..5940e0dea2f8b96f3d9f548d33dc75d14a088e6c 100644 (file)
@@ -125,6 +125,34 @@ nvkm_fb_oneinit(struct nvkm_subdev *subdev)
        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)
 {
@@ -157,18 +185,9 @@ 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;
index 9be7316c664211d8421f511d9a64849e0b04682c..fc8c93aa3da52e6b85fcb99a8d83a1589023b0c6 100644 (file)
@@ -120,8 +120,9 @@ gp102_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device,
        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