dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Nayan Deshmukh <nayan26deshmukh@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Nayan Deshmukh <nayan26deshmukh@gmail.com>, christian.koenig@amd.com
Subject: [PATCH 1/3] drm/scheduler: fix a corner case in dependency optimization
Date: Fri, 25 May 2018 10:15:46 +0530	[thread overview]
Message-ID: <20180525044548.21014-1-nayan26deshmukh@gmail.com> (raw)

When checking for a dependency fence for belonging to the same entity
compare it with scheduled as well finished fence. Earlier we were only
comparing it with the scheduled fence.

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
---
 drivers/gpu/drm/scheduler/gpu_scheduler.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c
index df1578d6f42e..44d480768dfe 100644
--- a/drivers/gpu/drm/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c
@@ -349,8 +349,13 @@ static bool drm_sched_entity_add_dependency_cb(struct drm_sched_entity *entity)
 	struct dma_fence * fence = entity->dependency;
 	struct drm_sched_fence *s_fence;
 
-	if (fence->context == entity->fence_context) {
-		/* We can ignore fences from ourself */
+	if (fence->context == entity->fence_context ||
+            fence->context == entity->fence_context + 1) {
+                /*
+                 * Fence is a scheduled/finished fence from a job
+                 * which belongs to the same entity, we can ignore
+                 * fences from ourself
+                 */
 		dma_fence_put(entity->dependency);
 		return false;
 	}
-- 
2.14.3

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

             reply	other threads:[~2018-05-25  4:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25  4:45 Nayan Deshmukh [this message]
2018-05-25  4:45 ` [PATCH 2/3] drm/scheduler: add documentation Nayan Deshmukh
2018-05-25 12:06   ` Christian König
2018-05-25 14:54   ` Alex Deucher
2018-05-28  7:09     ` Nayan Deshmukh
2018-05-28  8:09   ` Daniel Vetter
2018-05-28  8:31     ` Nayan Deshmukh
2018-05-29  5:53       ` [PATCH v2] " Nayan Deshmukh
2018-05-29  6:38         ` Christian König
2018-05-29  8:05       ` [PATCH 2/3] " Daniel Vetter
2018-05-25  4:45 ` [PATCH 3/3] drm/doc: add a chapter for gpu scheduler Nayan Deshmukh
2018-05-25 14:54   ` Alex Deucher
2018-05-25 12:01 ` [PATCH 1/3] drm/scheduler: fix a corner case in dependency optimization Christian König

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=20180525044548.21014-1-nayan26deshmukh@gmail.com \
    --to=nayan26deshmukh@gmail.com \
    --cc=christian.koenig@amd.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 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).