From 26ed0f02347e5b6f119ac51b87231dcebd42d546 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 4 Oct 2018 13:40:43 +0100 Subject: [PATCH] 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 Reviewed-by: Ilia Mirkin --- 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 2c604419ce0..97305d993ff 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 eb184d3559b..a6c1a2ee47f 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 e4fbae99ca4..9273d52c1de 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 2eecf59ce0d..d0d39aa5334 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 | -- 2.30.2