nvc0: increase NOUVEAU_TRANSFER_PUSHBUF_THRESHOLD to 1024 on Kepler+
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 4 Oct 2018 12:40:43 +0000 (13:40 +0100)
committerRhys Perry <pendingchaos02@gmail.com>
Thu, 25 Oct 2018 14:25:10 +0000 (15:25 +0100)
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@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nouveau_buffer.c
src/gallium/drivers/nouveau/nouveau_screen.c
src/gallium/drivers/nouveau/nouveau_screen.h
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c

index 2c604419ce05a3b5badbf9fffbf8594b5ca2772d..97305d993ff99941b154cb6c6b2896e45e4d6222 100644 (file)
@@ -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;
index eb184d3559b8fea1fc882d3b150fa5a112bd15c8..a6c1a2ee47f560149fc88f9a9c30e074fae5a380 100644 (file)
@@ -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 |
index e4fbae99ca440e1eabe9dadbd3720e8c5824c8d9..9273d52c1de6006d086746eb348ce4bdf36f8c39 100644 (file)
@@ -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 */
index 2eecf59ce0d7098b4b677b60f1d45a3eb438abc3..d0d39aa5334b4f1b273a76f4bc2efc73f4237636 100644 (file)
@@ -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 |