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;
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;
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 **);
#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;
#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 *);
}
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);
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;
}
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;