All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Rob Herring <robh+dt@kernel.org>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
	Steven Price <steven.price@arm.com>,
	Robin Murphy <robin.murphy@arm.com>
Cc: dri-devel@lists.freedesktop.org,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Jason Ekstrand" <jason@jlekstrand.net>,
	"Daniel Stone" <daniel@fooishbar.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Boris Brezillon" <boris.brezillon@collabora.com>
Subject: [PATCH v5 1/8] drm/panfrost: Pass a job to panfrost_{acquire, attach}_object_fences()
Date: Thu, 30 Sep 2021 21:09:47 +0200	[thread overview]
Message-ID: <20210930190954.1525933-2-boris.brezillon@collabora.com> (raw)
In-Reply-To: <20210930190954.1525933-1-boris.brezillon@collabora.com>

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

v3:
* Fix subject

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@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	other threads:[~2021-09-30 19:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 19:09 [PATCH v5 0/8] drm/panfrost: drm/panfrost: Add a new submit ioctl Boris Brezillon
2021-09-30 19:09 ` Boris Brezillon [this message]
2021-09-30 19:09 ` [PATCH v5 2/8] drm/panfrost: Move the mappings collection out of panfrost_lookup_bos() Boris Brezillon
2021-09-30 19:09 ` [PATCH v5 3/8] drm/panfrost: Add BO access flags to relax dependencies between jobs Boris Brezillon
2021-09-30 19:09 ` [PATCH v5 4/8] drm/panfrost: Add the ability to create submit queues Boris Brezillon
2021-09-30 19:09 ` [PATCH v5 5/8] drm/panfrost: Add a new ioctl to submit batches Boris Brezillon
2021-10-04 11:30   ` Steven Price
2021-09-30 19:09 ` [PATCH v5 6/8] drm/panfrost: Support synchronization jobs Boris Brezillon
2021-10-04 11:30   ` Steven Price
2021-10-04 12:24     ` Boris Brezillon
2021-10-04 13:05       ` Steven Price
2021-09-30 19:09 ` [PATCH v5 7/8] drm/panfrost: Advertise the SYNCOBJ_TIMELINE feature Boris Brezillon
2021-09-30 19:09 ` [PATCH v5 8/8] drm/panfrost: Bump minor version to reflect the feature additions Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210930190954.1525933-2-boris.brezillon@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jason@jlekstrand.net \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=steven.price@arm.com \
    --cc=tomeu.vizoso@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.