linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Rob Clark <robdclark@chromium.org>,
	Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	linux-arm-msm@vger.kernel.org (open list:DRM DRIVER FOR MSM
	ADRENO GPU),
	freedreno@lists.freedesktop.org (open list:DRM DRIVER FOR MSM
	ADRENO GPU), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 14/14] drm/msm: Don't implicit-sync if only a single ring
Date: Sun,  4 Oct 2020 12:21:46 -0700	[thread overview]
Message-ID: <20201004192152.3298573-15-robdclark@gmail.com> (raw)
In-Reply-To: <20201004192152.3298573-1-robdclark@gmail.com>

From: Rob Clark <robdclark@chromium.org>

Any cross-device sync use-cases *must* use explicit sync.  And if there
is only a single ring (no-preemption), everything is FIFO order and
there is no need to implicit-sync.

Mesa should probably just always use MSM_SUBMIT_NO_IMPLICIT, as behavior
is undefined when fences are not used to synchronize buffer usage across
contexts (which is the only case where multiple different priority rings
could come into play).

Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 drivers/gpu/drm/msm/msm_gem_submit.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
index 7d653bdc92dc..b9b68153b7b2 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -219,7 +219,7 @@ static int submit_lock_objects(struct msm_gem_submit *submit)
 	return ret;
 }
 
-static int submit_fence_sync(struct msm_gem_submit *submit, bool no_implicit)
+static int submit_fence_sync(struct msm_gem_submit *submit, bool implicit_sync)
 {
 	int i, ret = 0;
 
@@ -239,7 +239,7 @@ static int submit_fence_sync(struct msm_gem_submit *submit, bool no_implicit)
 				return ret;
 		}
 
-		if (no_implicit)
+		if (!implicit_sync)
 			continue;
 
 		ret = msm_gem_sync_object(&msm_obj->base, submit->ring->fctx,
@@ -704,7 +704,8 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
 	if (ret)
 		goto out;
 
-	ret = submit_fence_sync(submit, !!(args->flags & MSM_SUBMIT_NO_IMPLICIT));
+	ret = submit_fence_sync(submit, (gpu->nr_rings > 1) &&
+			!(args->flags & MSM_SUBMIT_NO_IMPLICIT));
 	if (ret)
 		goto out;
 
-- 
2.26.2


  parent reply	other threads:[~2020-10-04 19:21 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-04 19:21 [PATCH 00/14] drm/msm: de-struct_mutex-ification Rob Clark
2020-10-04 19:21 ` [PATCH 01/14] drm/msm: Use correct drm_gem_object_put() in fail case Rob Clark
2020-10-04 19:21 ` [PATCH 02/14] drm/msm: Drop chatty trace Rob Clark
2020-10-05 14:15   ` [Freedreno] " Jordan Crouse
2020-10-04 19:21 ` [PATCH 03/14] drm/msm: Move update_fences() Rob Clark
2020-10-05 14:16   ` [Freedreno] " Jordan Crouse
2020-10-04 19:21 ` [PATCH 04/14] drm/msm: Add priv->mm_lock to protect active/inactive lists Rob Clark
2020-10-04 22:15   ` Daniel Vetter
2020-10-05  0:10     ` Rob Clark
2020-10-05 14:19   ` [Freedreno] " Jordan Crouse
2020-10-04 19:21 ` [PATCH 05/14] drm/msm: Document and rename preempt_lock Rob Clark
2020-10-05 14:22   ` Jordan Crouse
2020-10-04 19:21 ` [PATCH 06/14] drm/msm: Protect ring->submits with it's own lock Rob Clark
2020-10-05 14:23   ` [Freedreno] " Jordan Crouse
2020-10-04 19:21 ` [PATCH 07/14] drm/msm: Refcount submits Rob Clark
2020-10-05 13:56   ` Daniel Vetter
2020-10-05 16:24     ` Rob Clark
2020-10-05 14:27   ` [Freedreno] " Jordan Crouse
2020-10-04 19:21 ` [PATCH 08/14] drm/msm: Remove obj->gpu Rob Clark
2020-10-05 14:28   ` [Freedreno] " Jordan Crouse
2020-10-04 19:21 ` [PATCH 09/14] drm/msm: Drop struct_mutex from the retire path Rob Clark
2020-10-05 14:29   ` [Freedreno] " Jordan Crouse
2020-10-04 19:21 ` [PATCH 10/14] drm/msm: Drop struct_mutex in free_object() path Rob Clark
2020-10-04 19:21 ` [PATCH 11/14] drm/msm: remove msm_gem_free_work Rob Clark
2020-10-04 19:21 ` [PATCH 12/14] drm/msm: drop struct_mutex in madvise path Rob Clark
2020-10-04 19:21 ` [PATCH 13/14] drm/msm: Drop struct_mutex in shrinker path Rob Clark
2020-10-04 19:21 ` Rob Clark [this message]
     [not found] ` <20201005092419.15608-1-hdanton@sina.com>
2020-10-05 14:02   ` Daniel Vetter
2020-10-05 16:17     ` Kristian Høgsberg
     [not found]       ` <20201006004416.15040-1-hdanton@sina.com>
2020-10-06  3:40         ` Rob Clark
2020-10-06  9:35           ` Daniel Vetter
2020-10-05 16:49     ` Rob Clark
2020-10-05 18:18       ` Daniel Vetter
2020-10-05 16:24 ` [Freedreno] [PATCH 00/14] drm/msm: de-struct_mutex-ification Kristian Høgsberg
2020-10-05 18:20   ` Daniel Vetter
2020-10-06  3:25     ` Rob Clark

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=20201004192152.3298573-15-robdclark@gmail.com \
    --to=robdclark@gmail.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@chromium.org \
    --cc=sean@poorly.run \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).