From: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Martin Peres <martin.peres-Iz16wY1oaNPLSKGbIzaifA@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: "enable ctxprog xfer only when we need it to save power" introduces big performance regression
Date: Wed, 28 Dec 2011 22:39:02 +0100 [thread overview]
Message-ID: <20111228213902.GA4275@joi.lan> (raw)
In-Reply-To: <4EBB78F4.2020902-Iz16wY1oaNPLSKGbIzaifA@public.gmane.org>
On Thu, Nov 10, 2011 at 08:10:44AM +0100, Martin Peres wrote:
> Le 09/11/2011 23:10, Marcin Slusarz a écrit :
> > For anyone who don't read IRC logs - it turns out it regressed only on
> > my box, because I have page flipping disabled (due to page flipping
> > being very buggy here, see
> > https://bugs.freedesktop.org/show_bug.cgi?id=42398), which forces gpu
> > context switch on every frame - even with (OpenGL) full screen apps.
> > And this patch slows down context switches. So, can we disable xfers
> > in ctxprog only when page flipping is enabled? Or is there any other
> > option? Marcin
> Hmm, it isn't logical yet. To test for performance regression, I
> launched the well known context switch test that is glxgears and only
> found a performance decrease of 1%.
>
> I'll test with pageflip disabled though and see for myself.
>
> Anyway, we'll do something about it. I just hope that most cards don't
> have this problem. This is clearly an hw regression.
Heh, with page flipping enabled, regression is still there, only smaller
(61->54, instead of 49 FPS).
I want my Nouveau performance back ;)
---
From: Marcin Slusarz <marcin.slusarz@gmail.com>
Subject: [PATCH] drm/nv50/gr: make "xfers only in ctxprog" optional
Commit fbba036a56fe0e5c5e8c91daf3fa211f88d94a03
"drm/nv50/gr: enable ctxprog xfer only when we need it to save power"
introduced performance regression.
So revert to previous behaviour and add module option (nv50_xfer_ctxprog=0/1)
to restore it back.
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
---
drivers/gpu/drm/nouveau/nouveau_drv.c | 4 ++++
drivers/gpu/drm/nouveau/nouveau_drv.h | 1 +
drivers/gpu/drm/nouveau/nv50_graph.c | 5 ++++-
drivers/gpu/drm/nouveau/nv50_grctx.c | 6 ++++--
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c
index 9791d13..6ce2347 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c
@@ -120,6 +120,10 @@ MODULE_PARM_DESC(msi, "Enable MSI (default: off)\n");
int nouveau_msi;
module_param_named(msi, nouveau_msi, int, 0400);
+MODULE_PARM_DESC(nv50_xfer_ctxprog, "Enable xfers only in ctxprog (decreases performance, lowers power usage) (default: 0)");
+int nouveau_nv50_xfer_ctxprog = 0;
+module_param_named(nv50_xfer_ctxprog, nouveau_nv50_xfer_ctxprog, int, 0400);
+
MODULE_PARM_DESC(ctxfw, "Use external HUB/GPC ucode (fermi)\n");
int nouveau_ctxfw;
module_param_named(ctxfw, nouveau_ctxfw, int, 0400);
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 4c0be3a..cdf5497 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -849,6 +849,7 @@ extern int nouveau_override_conntype;
extern char *nouveau_perflvl;
extern int nouveau_perflvl_wr;
extern int nouveau_msi;
+extern int nouveau_nv50_xfer_ctxprog;
extern int nouveau_ctxfw;
extern int nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state);
diff --git a/drivers/gpu/drm/nouveau/nv50_graph.c b/drivers/gpu/drm/nouveau/nv50_graph.c
index 01e4f812..d980bc0 100644
--- a/drivers/gpu/drm/nouveau/nv50_graph.c
+++ b/drivers/gpu/drm/nouveau/nv50_graph.c
@@ -167,7 +167,10 @@ nv50_graph_init(struct drm_device *dev, int engine)
nv_wr32(dev, 0x400324, 0x00000000);
for (i = 0; i < pgraph->ctxprog_size; i++)
nv_wr32(dev, 0x400328, pgraph->ctxprog[i]);
- nv_wr32(dev, 0x400824, 0x00000000);
+ if (nouveau_nv50_xfer_ctxprog)
+ nv_wr32(dev, 0x400824, 0x00000000);
+ else
+ nv_wr32(dev, 0x400824, 0x00004000);
nv_wr32(dev, 0x400828, 0x00000000);
nv_wr32(dev, 0x40082c, 0x00000000);
nv_wr32(dev, 0x400830, 0x00000000);
diff --git a/drivers/gpu/drm/nouveau/nv50_grctx.c b/drivers/gpu/drm/nouveau/nv50_grctx.c
index 4b46d69..0bf2b0c 100644
--- a/drivers/gpu/drm/nouveau/nv50_grctx.c
+++ b/drivers/gpu/drm/nouveau/nv50_grctx.c
@@ -202,7 +202,8 @@ nv50_grctx_init(struct nouveau_grctx *ctx)
}
cp_set (ctx, STATE, RUNNING);
- cp_set (ctx, XFER_SWITCH, ENABLE);
+ if (nouveau_nv50_xfer_ctxprog)
+ cp_set (ctx, XFER_SWITCH, ENABLE);
/* decide whether we're loading/unloading the context */
cp_bra (ctx, AUTO_SAVE, PENDING, cp_setup_save);
cp_bra (ctx, USER_SAVE, PENDING, cp_setup_save);
@@ -269,7 +270,8 @@ nv50_grctx_init(struct nouveau_grctx *ctx)
cp_name(ctx, cp_exit);
cp_set (ctx, USER_SAVE, NOT_PENDING);
cp_set (ctx, USER_LOAD, NOT_PENDING);
- cp_set (ctx, XFER_SWITCH, DISABLE);
+ if (nouveau_nv50_xfer_ctxprog)
+ cp_set (ctx, XFER_SWITCH, DISABLE);
cp_set (ctx, STATE, STOPPED);
cp_out (ctx, CP_END);
ctx->ctxvals_pos += 0x400; /* padding... no idea why you need it */
--
1.7.8.rc3
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
next prev parent reply other threads:[~2011-12-28 21:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-29 17:08 "enable ctxprog xfer only when we need it to save power" introduces big performance regression Marcin Slusarz
[not found] ` <20111029170801.GA3219-OI9uyE9O0yo@public.gmane.org>
2011-10-29 17:29 ` Marcin Slusarz
[not found] ` <20111029172923.GA3110-OI9uyE9O0yo@public.gmane.org>
2011-10-29 18:00 ` Maarten Maathuis
[not found] ` <CAGZ4FETt6QzMkxrMQwJsszjuQq0wdt85ujRZbxkdurkduaHh2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-30 1:15 ` Ben Skeggs
2011-10-29 19:09 ` Marcin Slusarz
[not found] ` <20111029190938.GA3105-OI9uyE9O0yo@public.gmane.org>
2011-10-30 0:25 ` Maxim Levitsky
2011-10-30 10:33 ` Marcin Slusarz
[not found] ` <20111030103349.GA3157-OI9uyE9O0yo@public.gmane.org>
2011-10-30 10:37 ` Marcin Kościelnicki
2011-11-09 22:10 ` Marcin Slusarz
[not found] ` <20111109221009.GD3402-OI9uyE9O0yo@public.gmane.org>
2011-11-10 7:10 ` Martin Peres
[not found] ` <4EBB78F4.2020902-Iz16wY1oaNPLSKGbIzaifA@public.gmane.org>
2011-12-28 21:39 ` Marcin Slusarz [this message]
[not found] ` <20111228213902.GA4275-OI9uyE9O0yo@public.gmane.org>
2011-12-28 23:58 ` Martin Peres
[not found] ` <4EFBAD2B.8080207-Iz16wY1oaNPLSKGbIzaifA@public.gmane.org>
2011-12-29 1:38 ` Marcin Slusarz
[not found] ` <20111229013850.GA4076-OI9uyE9O0yo@public.gmane.org>
2012-01-13 21:26 ` Martin Peres
[not found] ` <4F10A18E.1030908-GANU6spQydw@public.gmane.org>
2012-01-17 20:55 ` Lucas Stach
2012-01-17 21:17 ` Martin Peres
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=20111228213902.GA4275@joi.lan \
--to=marcin.slusarz-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=martin.peres-Iz16wY1oaNPLSKGbIzaifA@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.