Commit 1bc9865d authored by Chris Wilson's avatar Chris Wilson

drm/i915: Set fence_work.ops before dma_fence_init

Since dma_fence_init may call ops (because of a meaningless
trace_dma_fence), we need to set the worker ops prior to that call.
Reported-by: default avatarVince Weaver <vincent.weaver@maine.edu>
Fixes: 8e458fe2 ("drm/i915: Generalise the clflush dma-worker")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191212154224.1631531-1-chris@chris-wilson.co.uk
parent b58a8813
...@@ -78,12 +78,11 @@ static const struct dma_fence_ops fence_ops = { ...@@ -78,12 +78,11 @@ static const struct dma_fence_ops fence_ops = {
void dma_fence_work_init(struct dma_fence_work *f, void dma_fence_work_init(struct dma_fence_work *f,
const struct dma_fence_work_ops *ops) const struct dma_fence_work_ops *ops)
{ {
f->ops = ops;
spin_lock_init(&f->lock); spin_lock_init(&f->lock);
dma_fence_init(&f->dma, &fence_ops, &f->lock, 0, 0); dma_fence_init(&f->dma, &fence_ops, &f->lock, 0, 0);
i915_sw_fence_init(&f->chain, fence_notify); i915_sw_fence_init(&f->chain, fence_notify);
INIT_WORK(&f->work, fence_work); INIT_WORK(&f->work, fence_work);
f->ops = ops;
} }
int dma_fence_work_chain(struct dma_fence_work *f, struct dma_fence *signal) int dma_fence_work_chain(struct dma_fence_work *f, struct dma_fence *signal)
......
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