#define BEGIN_RING(obj,mthd,size) do { \
NOUVEAU_PUSH_CONTEXT(pc); \
if (pc->nvws->channel->pushbuf->remaining < ((size) + 1)) \
- pc->nvws->push_flush(pc->nvws->channel, ((size) + 1)); \
+ pc->nvws->push_flush(pc->nvws, ((size) + 1)); \
OUT_RING((pc->obj->subc << 13) | ((size) << 18) | (mthd)); \
pc->nvws->channel->pushbuf->remaining -= ((size) + 1); \
} while(0)
#define FIRE_RING() do { \
NOUVEAU_PUSH_CONTEXT(pc); \
- pc->nvws->push_flush(pc->nvws->channel, 0); \
+ pc->nvws->push_flush(pc->nvws, 0); \
} while(0)
#define OUT_RELOC(bo,data,flags,vor,tor) do { \
NOUVEAU_PUSH_CONTEXT(pc); \
- pc->nvws->push_reloc(pc->nvws->channel, \
- pc->nvws->channel->pushbuf->cur++, \
+ pc->nvws->push_reloc(pc->nvws, pc->nvws->channel->pushbuf->cur++, \
(bo), (data), (flags), (vor), (tor)); \
} while(0)
nr = so->cur - so->push;
if (pb->remaining < nr)
- nvws->push_flush(nvws->channel, nr);
+ nvws->push_flush(nvws, nr);
pb->remaining -= nr;
memcpy(pb->cur, so->push, nr * 4);
for (i = 0; i < so->cur_reloc; i++) {
struct nouveau_stateobj_reloc *r = &so->reloc[i];
- nvws->push_reloc(nvws->channel, pb->cur + r->offset, r->bo,
+ nvws->push_reloc(nvws, pb->cur + r->offset, r->bo,
r->data, r->flags, r->vor, r->tor);
}
pb->cur += nr;
i = so->cur_reloc << 1;
if (nvws->channel->pushbuf->remaining < i)
- nvws->push_flush(nvws->channel, i);
+ nvws->push_flush(nvws, i);
nvws->channel->pushbuf->remaining -= i;
for (i = 0; i < so->cur_reloc; i++) {
struct nouveau_stateobj_reloc *r = &so->reloc[i];
- nvws->push_reloc(nvws->channel, pb->cur++, r->bo, r->packet,
+ nvws->push_reloc(nvws, pb->cur++, r->bo, r->packet,
(r->flags &
(NOUVEAU_BO_VRAM | NOUVEAU_BO_GART)) |
NOUVEAU_BO_DUMMY, 0, 0);
- nvws->push_reloc(nvws->channel, pb->cur++, r->bo, r->data,
+ nvws->push_reloc(nvws, pb->cur++, r->bo, r->data,
r->flags | NOUVEAU_BO_DUMMY, r->vor, r->tor);
}
}
struct nouveau_resource **);
void (*res_free)(struct nouveau_resource **);
- int (*push_reloc)(struct nouveau_channel *, void *ptr,
+ int (*push_reloc)(struct nouveau_winsys *, void *ptr,
struct pipe_buffer *, uint32_t data,
uint32_t flags, uint32_t vor, uint32_t tor);
- int (*push_flush)(struct nouveau_channel *, unsigned size);
+ int (*push_flush)(struct nouveau_winsys *, unsigned size);
int (*grobj_alloc)(struct nouveau_winsys *, int grclass,
struct nouveau_grobj **);
+++ /dev/null
-#ifndef __NV40_DMA_H__
-#define __NV40_DMA_H__
-
-#include "pipe/nouveau/nouveau_winsys.h"
-
-#define OUT_RING(data) do { \
- (*nv40->nvws->channel->pushbuf->cur++) = (data); \
-} while(0)
-
-#define OUT_RINGp(src,size) do { \
- memcpy(nv40->nvws->channel->pushbuf->cur, (src), (size) * 4); \
- nv40->nvws->channel->pushbuf->cur += (size); \
-} while(0)
-
-#define OUT_RINGf(data) do { \
- union { float v; uint32_t u; } c; \
- c.v = (data); \
- OUT_RING(c.u); \
-} while(0)
-
-#define BEGIN_RING(obj,mthd,size) do { \
- if (nv40->nvws->channel->pushbuf->remaining < ((size) + 1)) \
- nv40->nvws->push_flush(nv40->nvws->channel, ((size) + 1)); \
- OUT_RING((nv40->obj->subc << 13) | ((size) << 18) | (mthd)); \
- nv40->nvws->channel->pushbuf->remaining -= ((size) + 1); \
-} while(0)
-
-#define BEGIN_RING_NI(obj,mthd,size) do { \
- BEGIN_RING(obj, (mthd) | 0x40000000, (size)); \
-} while(0)
-
-#define FIRE_RING() do { \
- nv40->nvws->push_flush(nv40->nvws->channel, 0); \
-} while(0)
-
-#define OUT_RELOC(bo,data,flags,vor,tor) do { \
- nv40->nvws->push_reloc(nv40->nvws->channel, \
- nv40->nvws->channel->pushbuf->cur, \
- (struct nouveau_bo *)(bo), \
- (data), (flags), (vor), (tor)); \
- OUT_RING(0); \
-} while(0)
-
-/* Raw data + flags depending on FB/TT buffer */
-#define OUT_RELOCd(bo,data,flags,vor,tor) do { \
- OUT_RELOC((bo), (data), (flags) | NOUVEAU_BO_OR, (vor), (tor)); \
-} while(0)
-
-/* FB/TT object handle */
-#define OUT_RELOCo(bo,flags) do { \
- OUT_RELOC((bo), 0, (flags) | NOUVEAU_BO_OR, \
- nv40->nvws->channel->vram->handle, \
- nv40->nvws->channel->gart->handle); \
-} while(0)
-
-/* Low 32-bits of offset */
-#define OUT_RELOCl(bo,delta,flags) do { \
- OUT_RELOC((bo), (delta), (flags) | NOUVEAU_BO_LOW, 0, 0); \
-} while(0)
-
-/* High 32-bits of offset */
-#define OUT_RELOCh(bo,delta,flags) do { \
- OUT_RELOC((bo), (delta), (flags) | NOUVEAU_BO_HIGH, 0, 0); \
-} while(0)
-
-#endif
so_emit(nvws, so);
so_ref(NULL, &so);
- nvws->push_flush(nvws->channel, 0);
+ nvws->push_flush(nvws, 0);
screen->pipe.winsys = ws;
screen->pipe.destroy = nv40_screen_destroy;
so_emit(nvws, so);
so_ref(NULL, &so);
- nvws->push_flush(nvws->channel, 0);
+ nvws->push_flush(nvws, 0);
screen->pipe.winsys = ws;
}
static int
-nouveau_pipe_emit_reloc(struct nouveau_channel *chan, void *ptr,
+nouveau_pipe_push_reloc(struct nouveau_winsys *nvws, void *ptr,
struct pipe_buffer *buf, uint32_t data,
uint32_t flags, uint32_t vor, uint32_t tor)
{
- return nouveau_pushbuf_emit_reloc(chan, ptr, nouveau_buffer(buf)->bo,
+ return nouveau_pushbuf_emit_reloc(nvws->channel, ptr,
+ nouveau_buffer(buf)->bo,
data, flags, vor, tor);
}
+static int
+nouveau_pipe_push_flush(struct nouveau_winsys *nvws, unsigned size)
+{
+ return nouveau_pushbuf_flush(nvws->channel, size);
+}
+
struct pipe_context *
nouveau_pipe_create(struct nouveau_context *nv)
{
nvws->res_alloc = nouveau_resource_alloc;
nvws->res_free = nouveau_resource_free;
- nvws->push_reloc = nouveau_pipe_emit_reloc;
- nvws->push_flush = nouveau_pushbuf_flush;
+ nvws->push_reloc = nouveau_pipe_push_reloc;
+ nvws->push_flush = nouveau_pipe_push_flush;
nvws->grobj_alloc = nouveau_pipe_grobj_alloc;
nvws->grobj_free = nouveau_grobj_free;