So we don't have to change the prototype if we extend the function.

v3:
* Fix subject

Signed-off-by: Boris Brezillon <boris.brezil...@collabora.com>
Reviewed-by: Steven Price <steven.pr...@arm.com>
---
 drivers/gpu/drm/panfrost/panfrost_job.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c 
b/drivers/gpu/drm/panfrost/panfrost_job.c
index 908d79520853..ed8d1588b1de 100644
--- a/drivers/gpu/drm/panfrost/panfrost_job.c
+++ b/drivers/gpu/drm/panfrost/panfrost_job.c
@@ -240,15 +240,13 @@ static void panfrost_job_hw_submit(struct panfrost_job 
*job, int js)
        spin_unlock(&pfdev->js->job_lock);
 }
 
-static int panfrost_acquire_object_fences(struct drm_gem_object **bos,
-                                         int bo_count,
-                                         struct drm_sched_job *job)
+static int panfrost_acquire_object_fences(struct panfrost_job *job)
 {
        int i, ret;
 
-       for (i = 0; i < bo_count; i++) {
+       for (i = 0; i < job->bo_count; i++) {
                /* panfrost always uses write mode in its current uapi */
-               ret = drm_sched_job_add_implicit_dependencies(job, bos[i],
+               ret = drm_sched_job_add_implicit_dependencies(&job->base, 
job->bos[i],
                                                              true);
                if (ret)
                        return ret;
@@ -257,14 +255,12 @@ static int panfrost_acquire_object_fences(struct 
drm_gem_object **bos,
        return 0;
 }
 
-static void panfrost_attach_object_fences(struct drm_gem_object **bos,
-                                         int bo_count,
-                                         struct dma_fence *fence)
+static void panfrost_attach_object_fences(struct panfrost_job *job)
 {
        int i;
 
-       for (i = 0; i < bo_count; i++)
-               dma_resv_add_excl_fence(bos[i]->resv, fence);
+       for (i = 0; i < job->bo_count; i++)
+               dma_resv_add_excl_fence(job->bos[i]->resv, 
job->render_done_fence);
 }
 
 int panfrost_job_push(struct panfrost_job *job)
@@ -283,8 +279,7 @@ int panfrost_job_push(struct panfrost_job *job)
 
        job->render_done_fence = dma_fence_get(&job->base.s_fence->finished);
 
-       ret = panfrost_acquire_object_fences(job->bos, job->bo_count,
-                                            &job->base);
+       ret = panfrost_acquire_object_fences(job);
        if (ret) {
                mutex_unlock(&pfdev->sched_lock);
                goto unlock;
@@ -296,8 +291,7 @@ int panfrost_job_push(struct panfrost_job *job)
 
        mutex_unlock(&pfdev->sched_lock);
 
-       panfrost_attach_object_fences(job->bos, job->bo_count,
-                                     job->render_done_fence);
+       panfrost_attach_object_fences(job);
 
 unlock:
        drm_gem_unlock_reservations(job->bos, job->bo_count, &acquire_ctx);
-- 
2.31.1

Reply via email to