summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-09-28 22:45:27 +0200
committerFrancisco Jerez <currojerez@riseup.net>2010-10-12 04:10:09 +0200
commit09b1062628f2cbddb3ebae20e7b3b8a0a93acebf (patch)
treefba939828713bc549be66aa2fb97feff65468a49
parent1b9187c43a0c17600611edb9e299141748e87974 (diff)
nouveau: Let the user choose the push buffer size.
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Acked-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--nouveau/nouveau_channel.c5
-rw-r--r--nouveau/nouveau_channel.h2
-rw-r--r--nouveau/nouveau_private.h6
-rw-r--r--nouveau/nouveau_pushbuf.c8
4 files changed, 11 insertions, 10 deletions
diff --git a/nouveau/nouveau_channel.c b/nouveau/nouveau_channel.c
index 40a0b344..ded54241 100644
--- a/nouveau/nouveau_channel.c
+++ b/nouveau/nouveau_channel.c
@@ -28,7 +28,8 @@
int
nouveau_channel_alloc(struct nouveau_device *dev, uint32_t fb_ctxdma,
- uint32_t tt_ctxdma, struct nouveau_channel **chan)
+ uint32_t tt_ctxdma, int pushbuf_size,
+ struct nouveau_channel **chan)
{
struct nouveau_device_priv *nvdev = nouveau_device(dev);
struct nouveau_channel_priv *nvchan;
@@ -90,7 +91,7 @@ nouveau_channel_alloc(struct nouveau_device *dev, uint32_t fb_ctxdma,
return ret;
}
- ret = nouveau_pushbuf_init(&nvchan->base);
+ ret = nouveau_pushbuf_init(&nvchan->base, pushbuf_size);
if (ret) {
nouveau_channel_free((void *)&nvchan);
return ret;
diff --git a/nouveau/nouveau_channel.h b/nouveau/nouveau_channel.h
index ddcf8e49..d61a4c0d 100644
--- a/nouveau/nouveau_channel.h
+++ b/nouveau/nouveau_channel.h
@@ -49,7 +49,7 @@ struct nouveau_channel {
int
nouveau_channel_alloc(struct nouveau_device *, uint32_t fb, uint32_t tt,
- struct nouveau_channel **);
+ int pushbuf_size, struct nouveau_channel **);
void
nouveau_channel_free(struct nouveau_channel **);
diff --git a/nouveau/nouveau_private.h b/nouveau/nouveau_private.h
index 5a952f73..4c535345 100644
--- a/nouveau/nouveau_private.h
+++ b/nouveau/nouveau_private.h
@@ -37,8 +37,8 @@
#include "nouveau_pushbuf.h"
#include "nouveau_reloc.h"
-#define CALPB_BUFFERS 4
-#define CALPB_BUFSZ 16384
+#define CALPB_BUFFERS 3
+
struct nouveau_pushbuf_priv {
uint32_t cal_suffix0;
uint32_t cal_suffix1;
@@ -64,7 +64,7 @@ struct nouveau_pushbuf_priv {
#define nouveau_pushbuf(n) ((struct nouveau_pushbuf_priv *)(n))
int
-nouveau_pushbuf_init(struct nouveau_channel *);
+nouveau_pushbuf_init(struct nouveau_channel *, int buf_size);
void
nouveau_pushbuf_fini(struct nouveau_channel *);
diff --git a/nouveau/nouveau_pushbuf.c b/nouveau/nouveau_pushbuf.c
index 28b8018a..90836bcd 100644
--- a/nouveau/nouveau_pushbuf.c
+++ b/nouveau/nouveau_pushbuf.c
@@ -78,7 +78,7 @@ nouveau_pushbuf_fini_call(struct nouveau_channel *chan)
}
static int
-nouveau_pushbuf_init_call(struct nouveau_channel *chan)
+nouveau_pushbuf_init_call(struct nouveau_channel *chan, int buf_size)
{
struct drm_nouveau_gem_pushbuf req;
struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
@@ -101,7 +101,7 @@ nouveau_pushbuf_init_call(struct nouveau_channel *chan)
for (i = 0; i < CALPB_BUFFERS; i++) {
ret = nouveau_bo_new(dev, flags | NOUVEAU_BO_MAP,
- 0, CALPB_BUFSZ, &nvpb->buffer[i]);
+ 0, buf_size, &nvpb->buffer[i]);
if (ret) {
nouveau_pushbuf_fini_call(chan);
return ret;
@@ -114,13 +114,13 @@ nouveau_pushbuf_init_call(struct nouveau_channel *chan)
}
int
-nouveau_pushbuf_init(struct nouveau_channel *chan)
+nouveau_pushbuf_init(struct nouveau_channel *chan, int buf_size)
{
struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
struct nouveau_pushbuf_priv *nvpb = &nvchan->pb;
int ret;
- ret = nouveau_pushbuf_init_call(chan);
+ ret = nouveau_pushbuf_init_call(chan, buf_size);
if (ret)
return ret;