drm/lima: Use drm_sched_job_add_syncobj_dependency()
PATCH 1/2 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.
--- drivers/gpu/drm/lima/lima_gem.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/lima/lima_gem.c +2 -10
@@ -277,21 +277,13 @@ static int lima_gem_add_deps(struct drm_file *file, struct lima_submit *submit)int i, err;for (i =0 ; i <ARRAY_SIZE (submit->in_sync); i++) { -struct dma_fence *fence =NULL ; -if (!submit->in_sync[i])continue ; - err =drm_syncobj_find_fence (file, submit->in_sync[i], -0 ,0 , &fence); + err =drm_sched_job_add_syncobj_dependency (&submit->task->base, file, + submit->in_sync[i],0 );if (err)return err; - - err =drm_sched_job_add_dependency (&submit->task->base, fence); -if (err) { -dma_fence_put (fence); -return err; - } }return 0 ;
Signature · 1 line
2.39.2
PATCH 2/2 drm/msm: Use drm_sched_job_add_syncobj_dependency()
As msm_parse_deps() performs the same steps as drm_sched_job_add_syncobj_dependency(), replace the open-coded implementation in msm in order to simply use the DRM function.
--- drivers/gpu/drm/msm/msm_gem_submit.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/msm_gem_submit.c +2 -7
@@ -550,7 +550,6 @@ static struct drm_syncobj **msm_parse_deps(struct msm_gem_submit *submit,for (i =0 ; i < nr_in_syncobjs; ++i) {uint64_t address = in_syncobjs_addr + i * syncobj_stride; -struct dma_fence *fence; if (copy_from_user(&syncobj_desc, u64_to_user_ptr(address),
@@ -570,12 +569,8 @@ static struct drm_syncobj **msm_parse_deps(struct msm_gem_submit *submit,break ; } - ret =drm_syncobj_find_fence (file, syncobj_desc.handle, - syncobj_desc.point,0 , &fence); -if (ret) -break ; - - ret =drm_sched_job_add_dependency (&submit->base, fence); + ret =drm_sched_job_add_syncobj_dependency (&submit->base, file, + syncobj_desc.handle, syncobj_desc.point);if (ret)break ;
Signature · 1 line
2.39.2
Patch is:
Quoted 41 lines · Maíra Canal
As
lima_gem_add_deps()performs the same steps asdrm_sched_job_add_syncobj_dependency(), replace the open-coded implementation in Lima in order to simply use the DRM function.Signed-off-by Maíra Canal <[email protected]>--- drivers/gpu/drm/lima/lima_gem.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)drivers/gpu/drm/lima/lima_gem.c +2
-11@@ -277,21 +277,13 @@ static int lima_gem_add_deps(struct drm_file *file, struct lima_submit *submit)int i, err;for (i =0 ; i <ARRAY_SIZE (submit->in_sync); i++) { -struct dma_fence *fence =NULL ; -if (!submit->in_sync[i])continue ; - err =drm_syncobj_find_fence (file, submit->in_sync[i], -0 ,0 , &fence); + err =drm_sched_job_add_syncobj_dependency (&submit->task->base, file, + submit->in_sync[i],0 );if (err)return err; - - err =drm_sched_job_add_dependency (&submit->task->base, fence); -if (err) { -dma_fence_put (fence); -return err; - } }return 0 ; --2.39.2
Dmitry Baryshkov
AppliedQuoted 5 lines · Maíra Canal
As
lima_gem_add_deps()performs the same steps asdrm_sched_job_add_syncobj_dependency(), replace the open-coded implementation in Lima in order to simply use the DRM function.
Applied, thanks!
[2/2] drm/msm: Use drm_sched_job_add_syncobj_dependency()
https://gitlab.freedesktop.org/lumag/msm/-/commit/8fd531e6bc56
Best regards,
Signature · 1 line
Dmitry Baryshkov <[email protected]>