Commit e0dfefa0 authored by Maíra Canal's avatar Maíra Canal Committed by Maíra Canal

drm/lima: Use drm_sched_job_add_syncobj_dependency()

As lima_gem_add_deps() performs the same steps as
drm_sched_job_add_syncobj_dependency(), replace the open-coded
implementation in Lima in order to simply use the DRM function.
Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
Reviewed-by: default avatarQiang Yu <yuq825@gmail.com>
Signed-off-by: default avatarMaíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230224214133.411966-1-mcanal@igalia.com
parent e3890d84
...@@ -277,21 +277,13 @@ static int lima_gem_add_deps(struct drm_file *file, struct lima_submit *submit) ...@@ -277,21 +277,13 @@ static int lima_gem_add_deps(struct drm_file *file, struct lima_submit *submit)
int i, err; int i, err;
for (i = 0; i < ARRAY_SIZE(submit->in_sync); i++) { for (i = 0; i < ARRAY_SIZE(submit->in_sync); i++) {
struct dma_fence *fence = NULL;
if (!submit->in_sync[i]) if (!submit->in_sync[i])
continue; continue;
err = drm_syncobj_find_fence(file, submit->in_sync[i], err = drm_sched_job_add_syncobj_dependency(&submit->task->base, file,
0, 0, &fence); submit->in_sync[i], 0);
if (err) if (err)
return err; return err;
err = drm_sched_job_add_dependency(&submit->task->base, fence);
if (err) {
dma_fence_put(fence);
return err;
}
} }
return 0; return 0;
......
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