Skip to content

Commit 7854ea0

Browse files
committed
nouveau: fix disp disabling with GSP
This func ptr here is normally static allocation, but gsp r535 uses a dynamic pointer, so we need to handle that better. This fixes a crash with GSP when you use config=disp=0 to avoid disp problems. Signed-off-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 34ce62a commit 7854ea0

File tree

1 file changed

+4
-2
lines changed
  • drivers/gpu/drm/nouveau/nvkm/engine/disp

1 file changed

+4
-2
lines changed

drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ nvkm_disp_dtor(struct nvkm_engine *engine)
209209
nvkm_head_del(&head);
210210
}
211211

212-
if (disp->func->dtor)
212+
if (disp->func && disp->func->dtor)
213213
disp->func->dtor(disp);
214214

215215
return data;
@@ -243,8 +243,10 @@ nvkm_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device,
243243
spin_lock_init(&disp->client.lock);
244244

245245
ret = nvkm_engine_ctor(&nvkm_disp, device, type, inst, true, &disp->engine);
246-
if (ret)
246+
if (ret) {
247+
disp->func = NULL;
247248
return ret;
249+
}
248250

249251
if (func->super) {
250252
disp->super.wq = create_singlethread_workqueue("nvkm-disp");

0 commit comments

Comments
 (0)