mirror of
https://github.com/torvalds/linux.git
synced 2026-12-02 19:42:26 +00:00
drm/scheduler: fix drm_sched_job_add_implicit_dependencies harder
drm_sched_job_add_dependency() could drop the last ref, so we need to do
the dma_fence_get() first.
Cc: Christian König <[email protected]>
Fixes: 9c2ba26535 ("drm/scheduler: use new iterator in drm_sched_job_add_implicit_dependencies v2")
Signed-off-by: Rob Clark <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Daniel Vetter <[email protected]>
Reviewed-by: Christian König <[email protected]>
Tested-by: Amit Pundir <[email protected]>
Signed-off-by: Christian König <[email protected]>
This commit is contained in:
committed by
Christian König
parent
4eaf02d607
commit
963d0b3569
@@ -704,12 +704,13 @@ int drm_sched_job_add_implicit_dependencies(struct drm_sched_job *job,
|
||||
int ret;
|
||||
|
||||
dma_resv_for_each_fence(&cursor, obj->resv, write, fence) {
|
||||
ret = drm_sched_job_add_dependency(job, fence);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Make sure to grab an additional ref on the added fence */
|
||||
dma_fence_get(fence);
|
||||
ret = drm_sched_job_add_dependency(job, fence);
|
||||
if (ret) {
|
||||
dma_fence_put(fence);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user