diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2020-01-29 11:29:05 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2020-01-29 15:49:56 +1000 |
commit | c3463aed05abf06bd5ebaac12f2c015db298b98f (patch) | |
tree | 926bf40ac1dd77d82780838225f2eaf54dff3eb3 /drivers/gpu | |
parent | 1c338ed5e52b62737a9d45f37f085bdbb367821b (diff) | |
download | linux-c3463aed05abf06bd5ebaac12f2c015db298b98f.tar.bz2 |
drm/nouveau/fb/gp102-: allow module to load even when scrubber binary is missing
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c | 39 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/fb/gp102.c | 5 |
2 files changed, 32 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c index d09db7c6b7ee..5940e0dea2f8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c @@ -126,6 +126,34 @@ nvkm_fb_oneinit(struct nvkm_subdev *subdev) } 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) { struct nvkm_fb *fb = nvkm_fb(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; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gp102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gp102.c index 9be7316c6642..fc8c93aa3da5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gp102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gp102.c @@ -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 |