All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 05/10] drm/radeon: add sync helper function
Date: Mon, 13 Aug 2012 12:26:03 +0200	[thread overview]
Message-ID: <1344853568-3870-6-git-send-email-deathsimple@vodafone.de> (raw)
In-Reply-To: <1344853568-3870-1-git-send-email-deathsimple@vodafone.de>

Signed-off-by: Christian König <deathsimple@vodafone.de>
---
 drivers/gpu/drm/radeon/radeon_cs.c |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index 0a9d1eb..85a80e4 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -115,19 +115,27 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, u32 ring, s32 priority
 	return 0;
 }
 
+static void radeon_cs_sync_to(struct radeon_cs_parser *p,
+			      struct radeon_fence *fence)
+{
+	struct radeon_fence *other;
+
+	if (!fence)
+		return;
+
+	other = p->ib.sync_to[fence->ring];
+	p->ib.sync_to[fence->ring] = radeon_fence_later(fence, other);
+}
+
 static void radeon_cs_sync_rings(struct radeon_cs_parser *p)
 {
 	int i;
 
 	for (i = 0; i < p->nrelocs; i++) {
-		struct radeon_fence *a, *b;
-
-		if (!p->relocs[i].robj || !p->relocs[i].robj->tbo.sync_obj)
+		if (!p->relocs[i].robj)
 			continue;
 
-		a = p->relocs[i].robj->tbo.sync_obj;
-		b = p->ib.sync_to[a->ring];
-		p->ib.sync_to[a->ring] = radeon_fence_later(a, b);
+		radeon_cs_sync_to(p, p->relocs[i].robj->tbo.sync_obj);
 	}
 }
 
-- 
1.7.9.5

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

  parent reply	other threads:[~2012-08-13 10:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 10:25 [RFC] make VM handling async Christian König
2012-08-13 10:25 ` [PATCH 01/10] drm/radeon: fence virtual address and free it once idle v4 Christian König
2012-08-13 10:26 ` [PATCH 02/10] drm/radeon: cleanup VM id handling a bit Christian König
2012-08-13 10:26 ` [PATCH 03/10] drm/radeon: move VM funcs into asic structure Christian König
2012-08-13 10:26 ` [PATCH 04/10] drm/radeon: remove vm_unbind Christian König
2012-08-13 10:26 ` Christian König [this message]
2012-08-13 10:26 ` [PATCH 06/10] drm/radeon: make VM flushs a ring operation Christian König
2012-08-13 10:26 ` [PATCH 07/10] drm/radeon: rework VMID handling Christian König
2012-08-13 10:26 ` [PATCH 08/10] drm/radeon: rework VM page table handling Christian König
2012-08-13 10:26 ` [PATCH 09/10] drm/radeon: Move looping over the PTEs into chip code Christian König
2012-08-13 10:26 ` [PATCH 10/10] drm/radeon: make page table updates async Christian König
2012-08-13 16:19   ` Jerome Glisse
2012-08-13 16:53     ` Christian König
2012-08-13 17:14       ` Jerome Glisse
2012-08-13 12:53 ` [RFC] make VM handling async Sylvain BERTRAND
2012-08-13 16:58   ` Christian König
2012-08-13 16:19 ` Jerome Glisse

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=1344853568-3870-6-git-send-email-deathsimple@vodafone.de \
    --to=deathsimple@vodafone.de \
    --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.