Mesa (master): nvfx: allocate a bigger block for queries
Luca Barbieri
lb at kemper.freedesktop.org
Mon Apr 12 21:37:09 UTC 2010
Module: Mesa
Branch: master
Commit: 6f65dcfb9f554619a35f4efb30adc512463bb8d9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f65dcfb9f554619a35f4efb30adc512463bb8d9
Author: Luca Barbieri <luca at luca-barbieri.com>
Date: Mon Jan 18 01:13:40 2010 +0100
nvfx: allocate a bigger block for queries
This patch allocates a bigger chunk of memory to store queries in,
increasing the (hidden) outstanding query limit.
---
src/gallium/drivers/nvfx/nvfx_screen.c | 13 ++++++++++---
src/gallium/drivers/nvfx/nvfx_screen.h | 2 +-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/nvfx/nvfx_screen.c b/src/gallium/drivers/nvfx/nvfx_screen.c
index 651e6ee..6742759 100644
--- a/src/gallium/drivers/nvfx/nvfx_screen.c
+++ b/src/gallium/drivers/nvfx/nvfx_screen.c
@@ -324,7 +324,7 @@ nvfx_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
struct nouveau_channel *chan;
struct pipe_screen *pscreen;
unsigned eng3d_class = 0;
- int ret;
+ int ret, i;
if (!screen)
return NULL;
@@ -397,14 +397,21 @@ nvfx_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
}
/* Query objects */
- ret = nouveau_notifier_alloc(chan, 0xbeef0302, 32, &screen->query);
+ unsigned query_sizes[] = {(4096 - 4 * 32) / 32, 3 * 1024 / 32, 2 * 1024 / 32, 1024 / 32};
+ for(i = 0; i < sizeof(query_sizes) / sizeof(query_sizes[0]); ++i)
+ {
+ ret = nouveau_notifier_alloc(chan, 0xbeef0302, query_sizes[i], &screen->query);
+ if(!ret)
+ break;
+ }
+
if (ret) {
NOUVEAU_ERR("Error initialising query objects: %d\n", ret);
nvfx_screen_destroy(pscreen);
return NULL;
}
- ret = nouveau_resource_init(&screen->query_heap, 0, 32);
+ ret = nouveau_resource_init(&screen->query_heap, 0, query_sizes[i]);
if (ret) {
NOUVEAU_ERR("Error initialising query object heap: %d\n", ret);
nvfx_screen_destroy(pscreen);
diff --git a/src/gallium/drivers/nvfx/nvfx_screen.h b/src/gallium/drivers/nvfx/nvfx_screen.h
index 678ee40..aa1b0e1 100644
--- a/src/gallium/drivers/nvfx/nvfx_screen.h
+++ b/src/gallium/drivers/nvfx/nvfx_screen.h
@@ -1,7 +1,7 @@
#ifndef __NVFX_SCREEN_H__
#define __NVFX_SCREEN_H__
-#include <util/u_double_list.h>
+#include "util/u_double_list.h"
#include "nouveau/nouveau_screen.h"
#include "nv04_surface_2d.h"
#include "nvfx_context.h"
More information about the mesa-commit
mailing list