Commit 3607bfd3 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/disp/nv50-: execute supervisor on its own workqueue

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 7d0a01a6
...@@ -459,7 +459,7 @@ gf119_disp_intr(struct nv50_disp *disp) ...@@ -459,7 +459,7 @@ gf119_disp_intr(struct nv50_disp *disp)
u32 stat = nvkm_rd32(device, 0x6100ac); u32 stat = nvkm_rd32(device, 0x6100ac);
if (stat & 0x00000007) { if (stat & 0x00000007) {
disp->super = (stat & 0x00000007); disp->super = (stat & 0x00000007);
schedule_work(&disp->supervisor); queue_work(disp->wq, &disp->supervisor);
nvkm_wr32(device, 0x6100ac, disp->super); nvkm_wr32(device, 0x6100ac, disp->super);
stat &= ~0x00000007; stat &= ~0x00000007;
} }
......
...@@ -111,6 +111,8 @@ nv50_disp_dtor_(struct nvkm_disp *base) ...@@ -111,6 +111,8 @@ nv50_disp_dtor_(struct nvkm_disp *base)
{ {
struct nv50_disp *disp = nv50_disp(base); struct nv50_disp *disp = nv50_disp(base);
nvkm_event_fini(&disp->uevent); nvkm_event_fini(&disp->uevent);
if (disp->wq)
destroy_workqueue(disp->wq);
return disp; return disp;
} }
...@@ -136,7 +138,6 @@ nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device, ...@@ -136,7 +138,6 @@ nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device,
if (!(disp = kzalloc(sizeof(*disp), GFP_KERNEL))) if (!(disp = kzalloc(sizeof(*disp), GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
INIT_WORK(&disp->supervisor, func->super);
disp->func = func; disp->func = func;
*pdisp = &disp->base; *pdisp = &disp->base;
...@@ -144,6 +145,11 @@ nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device, ...@@ -144,6 +145,11 @@ nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device,
if (ret) if (ret)
return ret; return ret;
disp->wq = create_singlethread_workqueue("nvkm-disp");
if (!disp->wq)
return -ENOMEM;
INIT_WORK(&disp->supervisor, func->super);
for (i = 0; func->head.new && i < heads; i++) { for (i = 0; func->head.new && i < heads; i++) {
ret = func->head.new(&disp->base, i); ret = func->head.new(&disp->base, i);
if (ret) if (ret)
...@@ -803,7 +809,7 @@ nv50_disp_intr(struct nv50_disp *disp) ...@@ -803,7 +809,7 @@ nv50_disp_intr(struct nv50_disp *disp)
if (intr1 & 0x00000070) { if (intr1 & 0x00000070) {
disp->super = (intr1 & 0x00000070); disp->super = (intr1 & 0x00000070);
schedule_work(&disp->supervisor); queue_work(disp->wq, &disp->supervisor);
nvkm_wr32(device, 0x610024, disp->super); nvkm_wr32(device, 0x610024, disp->super);
} }
} }
......
...@@ -12,6 +12,7 @@ struct nv50_disp { ...@@ -12,6 +12,7 @@ struct nv50_disp {
const struct nv50_disp_func *func; const struct nv50_disp_func *func;
struct nvkm_disp base; struct nvkm_disp base;
struct workqueue_struct *wq;
struct work_struct supervisor; struct work_struct supervisor;
u32 super; u32 super;
......
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