Skip to content

Commit

Permalink
nouveau: fix disp disabling with GSP
Browse files Browse the repository at this point in the history
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 <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-4-airlied@gmail.com
  • Loading branch information
Dave Airlie authored and Dave Airlie committed Jan 5, 2024
1 parent 34ce62a commit 7854ea0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ nvkm_disp_dtor(struct nvkm_engine *engine)
nvkm_head_del(&head);
}

if (disp->func->dtor)
if (disp->func && disp->func->dtor)
disp->func->dtor(disp);

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

ret = nvkm_engine_ctor(&nvkm_disp, device, type, inst, true, &disp->engine);
if (ret)
if (ret) {
disp->func = NULL;
return ret;
}

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

0 comments on commit 7854ea0

Please sign in to comment.