Mesa (master): nvc0: increase NOUVEAU_TRANSFER_PUSHBUF_THRESHOLD to 1024 on Kepler+

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 25 14:25:24 UTC 2018


Module: Mesa
Branch: master
Commit: 26ed0f02347e5b6f119ac51b87231dcebd42d546
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=26ed0f02347e5b6f119ac51b87231dcebd42d546

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Thu Oct  4 13:40:43 2018 +0100

nvc0: increase NOUVEAU_TRANSFER_PUSHBUF_THRESHOLD to 1024 on Kepler+

Gives a +3.89% to +5.27% FPS improvement with Hitman and +2.73% to +2.82%
FPS improvement with Dirt Rally on my GTX 1060.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/gallium/drivers/nouveau/nouveau_buffer.c   | 4 +---
 src/gallium/drivers/nouveau/nouveau_screen.c   | 1 +
 src/gallium/drivers/nouveau/nouveau_screen.h   | 2 ++
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 7 +++++++
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c
index 2c604419ce..97305d993f 100644
--- a/src/gallium/drivers/nouveau/nouveau_buffer.c
+++ b/src/gallium/drivers/nouveau/nouveau_buffer.c
@@ -11,8 +11,6 @@
 #include "nouveau_buffer.h"
 #include "nouveau_mm.h"
 
-#define NOUVEAU_TRANSFER_PUSHBUF_THRESHOLD 192
-
 struct nouveau_transfer {
    struct pipe_transfer base;
 
@@ -147,7 +145,7 @@ nouveau_transfer_staging(struct nouveau_context *nv,
    if (!nv->push_data)
       permit_pb = false;
 
-   if ((size <= NOUVEAU_TRANSFER_PUSHBUF_THRESHOLD) && permit_pb) {
+   if ((size <= nv->screen->transfer_pushbuf_threshold) && permit_pb) {
       tx->map = align_malloc(size, NOUVEAU_MIN_BUFFER_MAP_ALIGN);
       if (tx->map)
          tx->map += adj;
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index eb184d3559..a6c1a2ee47 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -242,6 +242,7 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
 
    nouveau_disk_cache_create(screen);
 
+   screen->transfer_pushbuf_threshold = 192;
    screen->lowmem_bindings = PIPE_BIND_GLOBAL; /* gallium limit */
    screen->vidmem_bindings =
       PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL |
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.h b/src/gallium/drivers/nouveau/nouveau_screen.h
index e4fbae99ca..9273d52c1d 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.h
+++ b/src/gallium/drivers/nouveau/nouveau_screen.h
@@ -26,6 +26,8 @@ struct nouveau_screen {
 
    int refcount;
 
+   unsigned transfer_pushbuf_threshold;
+
    unsigned vidmem_bindings; /* PIPE_BIND_* where VRAM placement is desired */
    unsigned sysmem_bindings; /* PIPE_BIND_* where GART placement is desired */
    unsigned lowmem_bindings; /* PIPE_BIND_* that require an address < 4 GiB */
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 2eecf59ce0..d0d39aa533 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -928,6 +928,13 @@ nvc0_screen_create(struct nouveau_device *dev)
    push->user_priv = screen;
    push->rsvd_kick = 5;
 
+   /* TODO: could this be higher on Kepler+? how does reclocking vs no
+    * reclocking affect performance?
+    * TODO: could this be higher on Fermi?
+    */
+   if (dev->chipset >= 0xe0)
+      screen->base.transfer_pushbuf_threshold = 1024;
+
    screen->base.vidmem_bindings |= PIPE_BIND_CONSTANT_BUFFER |
       PIPE_BIND_SHADER_BUFFER |
       PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER |




More information about the mesa-commit mailing list