From: Francisco Jerez <currojerez-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
To: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [kernel PATCH] drm/nouveau: add NOUVEAU_GEM_RELOC_HILO
Date: Wed, 12 Jan 2011 22:08:55 +0100 [thread overview]
Message-ID: <87d3o1j0d4.fsf@riseup.net> (raw)
In-Reply-To: <1294865031-22457-1-git-send-email-marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (Marcin Slusarz's message of "Wed, 12 Jan 2011 21:43:49 +0100")
[-- Attachment #1.1.1: Type: text/plain, Size: 3291 bytes --]
Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> add new relocation flag which allows to halving number of relocation
> entries on >= nv50 cards
>
I suspect that this change is unnecessary. If you're actually seeing a
performance improvement (I guess you are?), it's very likely to be
masking the actual root of the problem -- last time I checked the nv50
gallium pipe driver was rather careless about reloc re-submission (it
re-submits the whole reloc chain once for every draw call instead of
once for every pushbuf flush), and nouveau_reloc_emit() and friends are
very unoptimized.
I'm betting that using HILO or not will make pretty much no difference
once those two places are fixed :).
> Signed-off-by: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/gpu/drm/nouveau/nouveau_gem.c | 22 +++++++++++++++-------
> include/drm/nouveau_drm.h | 1 +
> 2 files changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
> index 9a1fdcf..2e21412 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_gem.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
> @@ -507,6 +507,7 @@ nouveau_gem_pushbuf_reloc_apply(struct drm_device *dev,
> struct drm_nouveau_gem_pushbuf_bo *b;
> struct nouveau_bo *nvbo;
> uint32_t data;
> + uint32_t data2;
>
> if (unlikely(r->bo_index > req->nr_buffers)) {
> NV_ERROR(dev, "reloc bo index invalid\n");
> @@ -544,17 +545,22 @@ nouveau_gem_pushbuf_reloc_apply(struct drm_device *dev,
>
> if (r->flags & NOUVEAU_GEM_RELOC_LOW)
> data = b->presumed.offset + r->data;
> - else
> - if (r->flags & NOUVEAU_GEM_RELOC_HIGH)
> + else if (r->flags & NOUVEAU_GEM_RELOC_HIGH)
> data = (b->presumed.offset + r->data) >> 32;
> - else
> + else if (r->flags & NOUVEAU_GEM_RELOC_HILO) {
> + data = (b->presumed.offset + r->data) >> 32;
> + data2 = b->presumed.offset + r->data;
> + } else
> data = r->data;
>
> if (r->flags & NOUVEAU_GEM_RELOC_OR) {
> - if (b->presumed.domain == NOUVEAU_GEM_DOMAIN_GART)
> - data |= r->tor;
> - else
> - data |= r->vor;
> + if (b->presumed.domain == NOUVEAU_GEM_DOMAIN_GART) {
> + data |= r->tor;
> + data2 |= r->tor;
> + } else {
> + data |= r->vor;
> + data2 |= r->vor;
> + }
> }
>
> spin_lock(&nvbo->bo.lock);
> @@ -566,6 +572,8 @@ nouveau_gem_pushbuf_reloc_apply(struct drm_device *dev,
> }
>
> nouveau_bo_wr32(nvbo, r->reloc_bo_offset >> 2, data);
> + if (r->flags & NOUVEAU_GEM_RELOC_HILO)
> + nouveau_bo_wr32(nvbo, (r->reloc_bo_offset >> 2) + 1, data2);
> }
>
> kfree(reloc);
> diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h
> index bc5590b..126ea8a 100644
> --- a/include/drm/nouveau_drm.h
> +++ b/include/drm/nouveau_drm.h
> @@ -137,6 +137,7 @@ struct drm_nouveau_gem_pushbuf_bo {
> #define NOUVEAU_GEM_RELOC_LOW (1 << 0)
> #define NOUVEAU_GEM_RELOC_HIGH (1 << 1)
> #define NOUVEAU_GEM_RELOC_OR (1 << 2)
> +#define NOUVEAU_GEM_RELOC_HILO (1 << 3)
> #define NOUVEAU_GEM_MAX_RELOCS 1024
> struct drm_nouveau_gem_pushbuf_reloc {
> uint32_t reloc_bo_index;
[-- Attachment #1.2: Type: application/pgp-signature, Size: 229 bytes --]
[-- Attachment #2: Type: text/plain, Size: 181 bytes --]
_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
next prev parent reply other threads:[~2011-01-12 21:08 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 ` [mesa PATCH] gallium/nouveau: optimize so_reloc2 Marcin Slusarz
2011-01-12 21:08 ` Francisco Jerez [this message]
[not found] ` <87d3o1j0d4.fsf-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
2011-01-12 21:41 ` [kernel PATCH] drm/nouveau: add NOUVEAU_GEM_RELOC_HILO 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=87d3o1j0d4.fsf@riseup.net \
--to=currojerez-sgozh3hwpm2stnjn9+bgxg@public.gmane.org \
--cc=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.