All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [mesa PATCH] gallium/nouveau: optimize so_reloc2
Date: Wed, 12 Jan 2011 21:43:51 +0100	[thread overview]
Message-ID: <1294865031-22457-3-git-send-email-marcin.slusarz@gmail.com> (raw)
In-Reply-To: <1294865031-22457-1-git-send-email-marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

use one relocation with newly introduced flag

unfortunately we can't enable it unconditionally, because we don't
know if the kernel supports it...
---
 src/gallium/drivers/nouveau/nouveau_stateobj.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_stateobj.h b/src/gallium/drivers/nouveau/nouveau_stateobj.h
index be8850b..4a08ba3 100644
--- a/src/gallium/drivers/nouveau/nouveau_stateobj.h
+++ b/src/gallium/drivers/nouveau/nouveau_stateobj.h
@@ -182,6 +182,9 @@ so_method(struct nouveau_stateobj *so, struct nouveau_grobj *gr,
 	so->cur = 0;
 }
 
+//disabled for now
+//#define NOUVEAU_MESA_NEW_RELOC
+
 static INLINE void
 so_reloc(struct nouveau_stateobj *so, struct nouveau_bo *bo,
 	 unsigned data, unsigned flags, unsigned vor, unsigned tor)
@@ -208,6 +211,10 @@ so_reloc(struct nouveau_stateobj *so, struct nouveau_bo *bo,
 	r[so->cur_reloc].tor = tor;
 
 	so_data(so, data);
+#if defined(NOUVEAU_MESA_NEW_RELOC) && defined(NOUVEAU_BO_HILO)
+	if (flags & NOUVEAU_BO_HILO)
+		so_data(so, data);
+#endif
 	so->cur_reloc++;
 }
 
@@ -215,8 +222,12 @@ static INLINE void
 so_reloc2(struct nouveau_stateobj *so, struct nouveau_bo *bo,
 	 unsigned data, unsigned flags, unsigned vor, unsigned tor)
 {
+#if defined(NOUVEAU_MESA_NEW_RELOC) && defined(NOUVEAU_BO_HILO)
+	so_reloc(so, bo, data, flags | NOUVEAU_BO_HILO, vor, tor);
+#else
 	so_reloc(so, bo, data, flags | NOUVEAU_BO_HIGH, vor, tor);
 	so_reloc(so, bo, data, flags | NOUVEAU_BO_LOW, vor, tor);
+#endif
 }
 
 /* Determine if this buffer object is referenced by this state object. */
-- 
1.7.3.3

  parent reply	other threads:[~2011-01-12 20:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-12 20:43 [kernel PATCH] drm/nouveau: add NOUVEAU_GEM_RELOC_HILO Marcin Slusarz
     [not found] ` <1294865031-22457-1-git-send-email-marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-01-12 20:43   ` [libdrm PATCH] nouveau: optimize OUT_RELOC2 Marcin Slusarz
2011-01-12 20:43   ` Marcin Slusarz [this message]
2011-01-12 21:08   ` [kernel PATCH] drm/nouveau: add NOUVEAU_GEM_RELOC_HILO Francisco Jerez
     [not found]     ` <87d3o1j0d4.fsf-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
2011-01-12 21:41       ` Marcin Slusarz

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=1294865031-22457-3-git-send-email-marcin.slusarz@gmail.com \
    --to=marcin.slusarz-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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.