All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: "Jack Zhang" <Jack.Zhang1@amd.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Luben Tuikov" <luben.tuikov@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Daniel Vetter" <daniel.vetter@intel.com>,
	"Christian König" <christian.koenig@amd.com>
Subject: [PATCH 10/11] drm/scheduler: Don't store self-dependencies
Date: Thu, 24 Jun 2021 16:00:24 +0200	[thread overview]
Message-ID: <20210624140025.438303-11-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20210624140025.438303-1-daniel.vetter@ffwll.ch>

This is essentially part of drm_sched_dependency_optimized(), which
only amdgpu seems to make use of. Use it a bit more.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Luben Tuikov <luben.tuikov@amd.com>
Cc: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Jack Zhang <Jack.Zhang1@amd.com>
---
 drivers/gpu/drm/scheduler/sched_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index 370c336d383f..c31d7cf7df74 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -649,6 +649,13 @@ int drm_sched_job_await_fence(struct drm_sched_job *job,
 	if (!fence)
 		return 0;
 
+	/* if it's a fence from us it's guaranteed to be earlier */
+	if (fence->context == job->entity->fence_context ||
+	    fence->context == job->entity->fence_context + 1) {
+		dma_fence_put(fence);
+		return 0;
+	}
+
 	/* Deduplicate if we already depend on a fence from the same context.
 	 * This lets the size of the array of deps scale with the number of
 	 * engines involved, rather than the number of BOs.
-- 
2.32.0.rc2


  parent reply	other threads:[~2021-06-24 14:00 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24 14:00 [PATCH 00/11] drm/scheduler dependency tracking Daniel Vetter
2021-06-24 14:00 ` [PATCH 01/11] drm/sched: Split drm_sched_job_init Daniel Vetter
2021-06-24 14:00   ` Daniel Vetter
2021-06-24 14:32   ` Steven Price
2021-06-24 14:32     ` Steven Price
2021-06-24 17:29   ` Christian König
2021-06-24 17:29     ` Christian König
2021-06-24 17:37     ` Daniel Vetter
2021-06-24 17:37       ` Daniel Vetter
2021-06-24 17:39       ` Christian König
2021-06-24 17:39         ` Christian König
2021-06-24 18:22         ` Daniel Vetter
2021-06-24 18:22           ` Daniel Vetter
2021-06-24 20:45   ` [PATCH] " Daniel Vetter
2021-06-24 20:45     ` Daniel Vetter
2021-06-24 21:00     ` Emma Anholt
2021-06-24 21:00       ` Emma Anholt
2021-06-24 21:30       ` Daniel Vetter
2021-06-24 21:30         ` Daniel Vetter
2021-06-24 14:00 ` [PATCH 02/11] drm/sched: Add dependency tracking Daniel Vetter
2021-06-24 14:00   ` Daniel Vetter
2021-06-24 14:32   ` Steven Price
2021-06-24 14:32     ` Steven Price
2021-06-24 14:39   ` Lucas Stach
2021-06-24 14:39     ` Lucas Stach
2021-06-24 15:26     ` Daniel Vetter
2021-06-24 15:26       ` Daniel Vetter
2021-06-24 16:59     ` Christian König
2021-06-24 16:59       ` Christian König
2021-06-24 14:00 ` [PATCH 03/11] drm/sched: drop entity parameter from drm_sched_push_job Daniel Vetter
2021-06-24 14:00   ` Daniel Vetter
2021-06-24 14:32   ` Steven Price
2021-06-24 14:32     ` Steven Price
2021-06-24 14:00 ` [PATCH 04/11] drm/panfrost: use scheduler dependency tracking Daniel Vetter
2021-06-24 14:00   ` Daniel Vetter
2021-06-24 14:32   ` Steven Price
2021-06-24 14:32     ` Steven Price
2021-06-24 14:00 ` [PATCH 05/11] drm/lima: " Daniel Vetter
2021-06-24 14:00 ` [PATCH 06/11] drm/v3d: Move drm_sched_job_init to v3d_job_init Daniel Vetter
2021-06-24 16:59   ` Emma Anholt
2021-06-24 17:24     ` Daniel Vetter
2021-06-24 20:45   ` [PATCH] " Daniel Vetter
2021-06-24 20:49     ` Emma Anholt
2021-06-24 14:00 ` [PATCH 07/11] drm/v3d: Use scheduler dependency handling Daniel Vetter
2021-06-24 14:00 ` [PATCH 08/11] drm/etnaviv: " Daniel Vetter
2021-06-24 14:00   ` Daniel Vetter
2021-06-24 14:00 ` [PATCH 09/11] drm/gem: Delete gem array fencing helpers Daniel Vetter
2021-06-24 14:00   ` Daniel Vetter
2021-06-24 14:00 ` Daniel Vetter [this message]
2021-06-24 14:42   ` [PATCH 10/11] drm/scheduler: Don't store self-dependencies Lucas Stach
2021-06-24 17:03   ` Christian König
2021-06-24 17:29     ` Daniel Vetter
2021-06-24 17:38       ` Christian König
2021-06-24 17:43         ` Daniel Vetter
2021-06-24 17:56           ` Christian König
2021-06-24 18:21             ` Daniel Vetter
2021-06-24 14:00 ` [PATCH 11/11] drm/sched: Check locking in drm_sched_job_await_implicit 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=20210624140025.438303-11-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=Jack.Zhang1@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=luben.tuikov@amd.com \
    --subject='Re: [PATCH 10/11] drm/scheduler: Don'\''t store self-dependencies' \
    /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

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.