On 24/06/2021 15:00, Daniel Vetter wrote: > This is a very confusingly named function, because not just does it > init an object, it arms it and provides a point of no return for > pushing a job into the scheduler. It would be nice if that's a bit > clearer in the interface. > > But the real reason is that I want to push the dependency tracking > helpers into the scheduler code, and that means drm_sched_job_init > must be called a lot earlier, without arming the job. > > Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx> > Cc: Lucas Stach <l.stach@xxxxxxxxxxxxxx> > Cc: Russell King <linux+etnaviv@xxxxxxxxxxxxxxx> > Cc: Christian Gmeiner <christian.gmeiner@xxxxxxxxx> > Cc: Qiang Yu <yuq825@xxxxxxxxx> > Cc: Rob Herring <robh@xxxxxxxxxx> > Cc: Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx> > Cc: Steven Price <steven.price@xxxxxxx> > Cc: Alyssa Rosenzweig <alyssa.rosenzweig@xxxxxxxxxxxxx> > Cc: David Airlie <airlied@xxxxxxxx> > Cc: Daniel Vetter <daniel@xxxxxxxx> > Cc: Sumit Semwal <sumit.semwal@xxxxxxxxxx> > Cc: "Christian König" <christian.koenig@xxxxxxx> > Cc: Masahiro Yamada <masahiroy@xxxxxxxxxx> > Cc: Kees Cook <keescook@xxxxxxxxxxxx> > Cc: Adam Borowski <kilobyte@xxxxxxxxxx> > Cc: Nick Terrell <terrelln@xxxxxx> > Cc: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx> > Cc: Paul Menzel <pmenzel@xxxxxxxxxxxxx> > Cc: Sami Tolvanen <samitolvanen@xxxxxxxxxx> > Cc: Viresh Kumar <viresh.kumar@xxxxxxxxxx> > Cc: Alex Deucher <alexander.deucher@xxxxxxx> > Cc: Dave Airlie <airlied@xxxxxxxxxx> > Cc: Nirmoy Das <nirmoy.das@xxxxxxx> > Cc: Deepak R Varma <mh12gx2825@xxxxxxxxx> > Cc: Lee Jones <lee.jones@xxxxxxxxxx> > Cc: Kevin Wang <kevin1.wang@xxxxxxx> > Cc: Chen Li <chenli@xxxxxxxxxxxxx> > Cc: Luben Tuikov <luben.tuikov@xxxxxxx> > Cc: "Marek Olšák" <marek.olsak@xxxxxxx> > Cc: Dennis Li <Dennis.Li@xxxxxxx> > Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx> > Cc: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx> > Cc: Sonny Jiang <sonny.jiang@xxxxxxx> > Cc: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> > Cc: Tian Tao <tiantao6@xxxxxxxxxxxxx> > Cc: Jack Zhang <Jack.Zhang1@xxxxxxx> > Cc: etnaviv@xxxxxxxxxxxxxxxxxxxxx > Cc: lima@xxxxxxxxxxxxxxxxxxxxx > Cc: linux-media@xxxxxxxxxxxxxxx > Cc: linaro-mm-sig@xxxxxxxxxxxxxxxx > --- > .gitignore | 1 + > drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++ > drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 ++ > drivers/gpu/drm/etnaviv/etnaviv_sched.c | 2 ++ > drivers/gpu/drm/lima/lima_sched.c | 2 ++ > drivers/gpu/drm/panfrost/panfrost_job.c | 2 ++ > drivers/gpu/drm/scheduler/sched_entity.c | 6 +++--- > drivers/gpu/drm/scheduler/sched_fence.c | 15 ++++++++++----- > drivers/gpu/drm/scheduler/sched_main.c | 23 ++++++++++++++++++++++- > include/drm/gpu_scheduler.h | 6 +++++- > 10 files changed, 51 insertions(+), 10 deletions(-) > > diff --git a/.gitignore b/.gitignore > index 7afd412dadd2..52433a930299 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -66,6 +66,7 @@ modules.order > /modules.builtin > /modules.builtin.modinfo > /modules.nsdeps > +*.builtin I don't think this belongs in this patch! [...] > diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c > index beb62c8fc851..1e950534b9b0 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_job.c > +++ b/drivers/gpu/drm/panfrost/panfrost_job.c > @@ -244,6 +244,8 @@ int panfrost_job_push(struct panfrost_job *job) > goto unlock; > } > > + drm_sched_job_arm(&job->base); > + > job->render_done_fence = dma_fence_get(&job->base.s_fence->finished); > > ret = panfrost_acquire_object_fences(job->bos, job->bo_count, Acked-by: Steven Price <steven.price@xxxxxxx>