All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 10/12] drm/panfrost: add DMA-buf user fence support
Date: Tue,  4 May 2021 15:27:27 +0200	[thread overview]
Message-ID: <20210504132729.2046-11-christian.koenig@amd.com> (raw)
In-Reply-To: <20210504132729.2046-1-christian.koenig@amd.com>

Just add the call before taking locks.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/panfrost/panfrost_job.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c
index 6003cfeb1322..9174ceb1d16d 100644
--- a/drivers/gpu/drm/panfrost/panfrost_job.c
+++ b/drivers/gpu/drm/panfrost/panfrost_job.c
@@ -216,6 +216,18 @@ static void panfrost_attach_object_fences(struct drm_gem_object **bos,
 		dma_resv_add_excl_fence(bos[i]->resv, fence);
 }
 
+static int panfrost_sync_user_fences(struct drm_gem_object **bos, int bo_count)
+{
+	int i, ret;
+
+	for (i = 0; i < bo_count; i++) {
+		ret = dma_resv_sync_user_fence(bos[i]->resv);
+		if (ret)
+			return ret;
+	}
+	return 0;
+}
+
 int panfrost_job_push(struct panfrost_job *job)
 {
 	struct panfrost_device *pfdev = job->pfdev;
@@ -224,6 +236,10 @@ int panfrost_job_push(struct panfrost_job *job)
 	struct ww_acquire_ctx acquire_ctx;
 	int ret = 0;
 
+	ret = panfrost_sync_user_fences(job->bos, job->bo_count);
+	if (ret)
+		return ret;
+
 	mutex_lock(&pfdev->sched_lock);
 
 	ret = drm_gem_lock_reservations(job->bos, job->bo_count,
-- 
2.25.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2021-05-04 13:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 13:27 [RFC] Implicit vs explicit user fence sync Christian König
2021-05-04 13:27 ` [PATCH 01/12] dma-buf: add interface for user fence synchronization Christian König
2021-05-04 13:27 ` [PATCH 02/12] RDMA/mlx5: add DMA-buf user fence support Christian König
2021-05-04 13:27 ` [PATCH 03/12] drm/amdgpu: " Christian König
2021-05-04 13:27 ` [PATCH 04/12] drm/gem: dd DMA-buf user fence support for the atomic helper Christian König
2021-05-04 13:27 ` [PATCH 05/12] drm/etnaviv: add DMA-buf user fence support Christian König
2021-05-04 13:27 ` [PATCH 06/12] drm/i915: " Christian König
2021-05-04 13:27 ` [PATCH 07/12] drm/lima: " Christian König
2021-05-04 13:27 ` [PATCH 08/12] drm/msm: " Christian König
2021-05-04 13:27 ` [PATCH 09/12] drm/nouveau: " Christian König
2021-05-04 13:27 ` Christian König [this message]
2021-05-04 13:27 ` [PATCH 11/12] drm/radeon: " Christian König
2021-05-04 13:27 ` [PATCH 12/12] drm/v3d: " Christian König
2021-05-04 14:15 ` [RFC] Implicit vs explicit user fence sync Daniel Vetter
2021-05-04 14:26   ` Christian König
2021-05-04 15:11     ` Daniel Vetter
2021-05-10 18:12       ` Christian König
2021-05-11  7:31         ` Daniel Vetter
2021-05-11  7:47           ` Christian König
2021-05-11 14:23             ` Daniel Vetter
2021-05-11 15:32               ` Christian König
2021-05-11 16:48                 ` Daniel Vetter
2021-05-11 19:34                   ` Christian König
2021-05-12  8:13                     ` Daniel Vetter
2021-05-12  8:23                       ` Christian König
2021-05-12  8:50                         ` Daniel Vetter

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=20210504132729.2046-11-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /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.