Skip to content

Commit c3463ae

Browse files
author
Ben Skeggs
committed
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 <[email protected]>
1 parent 1c338ed commit c3463ae

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

drivers/gpu/drm/nouveau/nvkm/subdev/fb/base.c

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,34 @@ nvkm_fb_oneinit(struct nvkm_subdev *subdev)
125125
return nvkm_mm_init(&fb->tags, 0, 0, tags, 1);
126126
}
127127

128+
static int
129+
nvkm_fb_init_scrub_vpr(struct nvkm_fb *fb)
130+
{
131+
struct nvkm_subdev *subdev = &fb->subdev;
132+
int ret;
133+
134+
nvkm_debug(subdev, "VPR locked, running scrubber binary\n");
135+
136+
if (!fb->vpr_scrubber.size) {
137+
nvkm_warn(subdev, "VPR locked, but no scrubber binary!\n");
138+
return 0;
139+
}
140+
141+
ret = fb->func->vpr.scrub(fb);
142+
if (ret) {
143+
nvkm_error(subdev, "VPR scrubber binary failed\n");
144+
return ret;
145+
}
146+
147+
if (fb->func->vpr.scrub_required(fb)) {
148+
nvkm_error(subdev, "VPR still locked after scrub!\n");
149+
return -EIO;
150+
}
151+
152+
nvkm_debug(subdev, "VPR scrubber binary successful\n");
153+
return 0;
154+
}
155+
128156
static int
129157
nvkm_fb_init(struct nvkm_subdev *subdev)
130158
{
@@ -157,18 +185,9 @@ nvkm_fb_init(struct nvkm_subdev *subdev)
157185

158186
if (fb->func->vpr.scrub_required &&
159187
fb->func->vpr.scrub_required(fb)) {
160-
nvkm_debug(subdev, "VPR locked, running scrubber binary\n");
161-
162-
ret = fb->func->vpr.scrub(fb);
188+
ret = nvkm_fb_init_scrub_vpr(fb);
163189
if (ret)
164190
return ret;
165-
166-
if (fb->func->vpr.scrub_required(fb)) {
167-
nvkm_error(subdev, "VPR still locked after scrub!\n");
168-
return -EIO;
169-
}
170-
171-
nvkm_debug(subdev, "VPR scrubber binary successful\n");
172191
}
173192

174193
return 0;

drivers/gpu/drm/nouveau/nvkm/subdev/fb/gp102.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ gp102_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device,
120120
if (ret)
121121
return ret;
122122

123-
return nvkm_firmware_load_blob(&(*pfb)->subdev, "nvdec/scrubber", "", 0,
124-
&(*pfb)->vpr_scrubber);
123+
nvkm_firmware_load_blob(&(*pfb)->subdev, "nvdec/scrubber", "", 0,
124+
&(*pfb)->vpr_scrubber);
125+
return 0;
125126
}
126127

127128
int

0 commit comments

Comments
 (0)