Commit 7854ea0e authored by Dave Airlie's avatar Dave Airlie Committed by Dave Airlie

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: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-4-airlied@gmail.com
parent 34ce62a5
...@@ -209,7 +209,7 @@ nvkm_disp_dtor(struct nvkm_engine *engine) ...@@ -209,7 +209,7 @@ nvkm_disp_dtor(struct nvkm_engine *engine)
nvkm_head_del(&head); nvkm_head_del(&head);
} }
if (disp->func->dtor) if (disp->func && disp->func->dtor)
disp->func->dtor(disp); disp->func->dtor(disp);
return data; return data;
...@@ -243,8 +243,10 @@ nvkm_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device, ...@@ -243,8 +243,10 @@ nvkm_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device,
spin_lock_init(&disp->client.lock); spin_lock_init(&disp->client.lock);
ret = nvkm_engine_ctor(&nvkm_disp, device, type, inst, true, &disp->engine); ret = nvkm_engine_ctor(&nvkm_disp, device, type, inst, true, &disp->engine);
if (ret) if (ret) {
disp->func = NULL;
return ret; return ret;
}
if (func->super) { if (func->super) {
disp->super.wq = create_singlethread_workqueue("nvkm-disp"); disp->super.wq = create_singlethread_workqueue("nvkm-disp");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment