drm/sched: drop entity parameter from drm_sched_push_job
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 5 Aug 2021 10:46:50 +0000 (12:46 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 30 Aug 2021 08:54:45 +0000 (10:54 +0200)
Originally a job was only bound to the queue when we pushed this, but
now that's done in drm_sched_job_init, making that parameter entirely
redundant.

Remove it.

The same applies to the context parameter in
lima_sched_context_queue_task, simplify that too.

v2:
Rebase on top of msm adopting drm/sched

Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Steven Price <steven.price@arm.com> (v1)
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> (v1)
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Russell King <linux+etnaviv@armlinux.org.uk>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Qiang Yu <yuq825@gmail.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Steven Price <steven.price@arm.com>
Cc: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: Emma Anholt <emma@anholt.net>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Nirmoy Das <nirmoy.das@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Chen Li <chenli@uniontech.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Deepak R Varma <mh12gx2825@gmail.com>
Cc: Kevin Wang <kevin1.wang@amd.com>
Cc: Luben Tuikov <luben.tuikov@amd.com>
Cc: "Marek Olšák" <marek.olsak@amd.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Cc: Dennis Li <Dennis.Li@amd.com>
Cc: Boris Brezillon <boris.brezillon@collabora.com>
Cc: etnaviv@lists.freedesktop.org
Cc: lima@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: Rob Clark <robdclark@gmail.com>
Cc: Sean Paul <sean@poorly.run>
Cc: Melissa Wen <mwen@igalia.com>
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20210805104705.862416-6-daniel.vetter@ffwll.ch
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
drivers/gpu/drm/etnaviv/etnaviv_sched.c
drivers/gpu/drm/lima/lima_gem.c
drivers/gpu/drm/lima/lima_sched.c
drivers/gpu/drm/lima/lima_sched.h
drivers/gpu/drm/msm/msm_gem_submit.c
drivers/gpu/drm/panfrost/panfrost_job.c
drivers/gpu/drm/scheduler/sched_entity.c
drivers/gpu/drm/v3d/v3d_gem.c
include/drm/gpu_scheduler.h

index 2b7f4b77a572ba4638679f85b55cb301b0857eca..617e39122ea3e21239dd62b94eff1371bc97654d 100644 (file)
@@ -1261,7 +1261,7 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
 
        trace_amdgpu_cs_ioctl(job);
        amdgpu_vm_bo_trace_cs(&fpriv->vm, &p->ticket);
-       drm_sched_entity_push_job(&job->base, entity);
+       drm_sched_entity_push_job(&job->base);
 
        amdgpu_vm_move_to_lru_tail(p->adev, &fpriv->vm);
 
index 5ddb955d2315db6b97f621233746424580a3df14..b8609cccc9c1ad04674ab46c9a930def114be11d 100644 (file)
@@ -174,7 +174,7 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct drm_sched_entity *entity,
 
        *f = dma_fence_get(&job->base.s_fence->finished);
        amdgpu_job_free_resources(job);
-       drm_sched_entity_push_job(&job->base, entity);
+       drm_sched_entity_push_job(&job->base);
 
        return 0;
 }
index 05f41220411882513cf85216e77bb00a8d3cf15a..180bb633d5c53438fcba1fc20216eabfa61ccd8d 100644 (file)
@@ -178,7 +178,7 @@ int etnaviv_sched_push_job(struct drm_sched_entity *sched_entity,
        /* the scheduler holds on to the job now */
        kref_get(&submit->refcount);
 
-       drm_sched_entity_push_job(&submit->sched_job, sched_entity);
+       drm_sched_entity_push_job(&submit->sched_job);
 
 out_unlock:
        mutex_unlock(&submit->gpu->fence_lock);
index de62966243cd53ee86a1efbf6bd3b2f1d3f95522..c528f40981bbcb3a66796f7eb706aa019333ba20 100644 (file)
@@ -359,8 +359,7 @@ int lima_gem_submit(struct drm_file *file, struct lima_submit *submit)
                        goto err_out2;
        }
 
-       fence = lima_sched_context_queue_task(
-               submit->ctx->context + submit->pipe, submit->task);
+       fence = lima_sched_context_queue_task(submit->task);
 
        for (i = 0; i < submit->nr_bos; i++) {
                if (submit->bos[i].flags & LIMA_SUBMIT_BO_WRITE)
index 38f755580507f20009b59b8c7b620bebe8d84766..e968b5a8f0b05c962ff0cd9420aebc0db6c19009 100644 (file)
@@ -177,13 +177,12 @@ void lima_sched_context_fini(struct lima_sched_pipe *pipe,
        drm_sched_entity_fini(&context->base);
 }
 
-struct dma_fence *lima_sched_context_queue_task(struct lima_sched_context *context,
-                                               struct lima_sched_task *task)
+struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task)
 {
        struct dma_fence *fence = dma_fence_get(&task->base.s_fence->finished);
 
        trace_lima_task_submit(task);
-       drm_sched_entity_push_job(&task->base, &context->base);
+       drm_sched_entity_push_job(&task->base);
        return fence;
 }
 
index 90f03c48ef4a89323cb0f06f0ab579f20b477ef2..ac70006b0e261d717421101c27b2c9b0305e6b57 100644 (file)
@@ -98,8 +98,7 @@ int lima_sched_context_init(struct lima_sched_pipe *pipe,
                            atomic_t *guilty);
 void lima_sched_context_fini(struct lima_sched_pipe *pipe,
                             struct lima_sched_context *context);
-struct dma_fence *lima_sched_context_queue_task(struct lima_sched_context *context,
-                                               struct lima_sched_task *task);
+struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task);
 
 int lima_sched_pipe_init(struct lima_sched_pipe *pipe, const char *name);
 void lima_sched_pipe_fini(struct lima_sched_pipe *pipe);
index 71b8c8f752a37e061d4cfd6d3faa0ce79539af72..37a8059ac7982056bd3d551b8713f695ecf8cb05 100644 (file)
@@ -908,7 +908,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
        /* The scheduler owns a ref now: */
        msm_gem_submit_get(submit);
 
-       drm_sched_entity_push_job(&submit->base, &queue->entity);
+       drm_sched_entity_push_job(&submit->base);
 
        args->fence = submit->fence_id;
 
index aaa662cbc43bd528b221569f0ad838e24a417bee..42aa01445ee4fe718326ddacefc5789884adbe8d 100644 (file)
@@ -301,7 +301,7 @@ int panfrost_job_push(struct panfrost_job *job)
 
        kref_get(&job->refcount); /* put by scheduler job completion */
 
-       drm_sched_entity_push_job(&job->base, entity);
+       drm_sched_entity_push_job(&job->base);
 
        mutex_unlock(&pfdev->sched_lock);
 
index 381fbf462ea7e8310eb1b1ba8bf611ecabc0b601..e4d33db1eb45d7cbd5e8eadf266dbe75d083dfa3 100644 (file)
@@ -516,9 +516,7 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity)
 
 /**
  * drm_sched_entity_push_job - Submit a job to the entity's job queue
- *
  * @sched_job: job to submit
- * @entity: scheduler entity
  *
  * Note: To guarantee that the order of insertion to queue matches the job's
  * fence sequence number this function should be called with drm_sched_job_arm()
@@ -526,9 +524,9 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity)
  *
  * Returns 0 for success, negative error code otherwise.
  */
-void drm_sched_entity_push_job(struct drm_sched_job *sched_job,
-                              struct drm_sched_entity *entity)
+void drm_sched_entity_push_job(struct drm_sched_job *sched_job)
 {
+       struct drm_sched_entity *entity = sched_job->entity;
        bool first;
 
        trace_drm_sched_job(sched_job, entity);
index 2e808097b4d18f2e86af9c56f0c167bcfde9b502..957228bef29cbab7012094d6f12ace93cc558460 100644 (file)
@@ -487,7 +487,7 @@ v3d_push_job(struct v3d_file_priv *v3d_priv,
        /* put by scheduler job completion */
        kref_get(&job->refcount);
 
-       drm_sched_entity_push_job(&job->base, &v3d_priv->sched_entity[queue]);
+       drm_sched_entity_push_job(&job->base);
 
        return 0;
 }
index a47946f904b62d92e0ac9f966c8b133f064d4d3f..b72f73b375a2c51007e25cce8dc48540c5531b5d 100644 (file)
@@ -409,8 +409,7 @@ void drm_sched_entity_fini(struct drm_sched_entity *entity);
 void drm_sched_entity_destroy(struct drm_sched_entity *entity);
 void drm_sched_entity_select_rq(struct drm_sched_entity *entity);
 struct drm_sched_job *drm_sched_entity_pop_job(struct drm_sched_entity *entity);
-void drm_sched_entity_push_job(struct drm_sched_job *sched_job,
-                              struct drm_sched_entity *entity);
+void drm_sched_entity_push_job(struct drm_sched_job *sched_job);
 void drm_sched_entity_set_priority(struct drm_sched_entity *entity,
                                   enum drm_sched_priority priority);
 bool drm_sched_entity_is_ready(struct drm_sched_entity *entity);