Message ID | 20230224214133.411966-1-mcanal@igalia.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] drm/lima: Use drm_sched_job_add_syncobj_dependency() | expand |
Patch is: Reviewed-by: Qiang Yu <yuq825@gmail.com> On Sat, Feb 25, 2023 at 5:41 AM Maíra Canal <mcanal@igalia.com> wrote: > > 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: Maíra Canal <mcanal@igalia.com> > --- > drivers/gpu/drm/lima/lima_gem.c | 12 ++---------- > 1 file changed, 2 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c > index 0f1ca0b0db49..10252dc11a22 100644 > --- a/drivers/gpu/drm/lima/lima_gem.c > +++ b/drivers/gpu/drm/lima/lima_gem.c > @@ -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 >
On Fri, 24 Feb 2023 18:41:32 -0300, Maíra Canal wrote: > 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. > > Applied, thanks! [2/2] drm/msm: Use drm_sched_job_add_syncobj_dependency() https://gitlab.freedesktop.org/lumag/msm/-/commit/8fd531e6bc56 Best regards,
diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c index 0f1ca0b0db49..10252dc11a22 100644 --- a/drivers/gpu/drm/lima/lima_gem.c +++ b/drivers/gpu/drm/lima/lima_gem.c @@ -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;
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: Maíra Canal <mcanal@igalia.com> --- drivers/gpu/drm/lima/lima_gem.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)