NOUVEAU_PUSH_CONTEXT(pc); \
struct nouveau_channel *chan = pc->base.channel; \
nouveau_pushbuf_emit_reloc(chan, chan->pushbuf->cur++, nouveau_bo(bo), \
- (data), (flags), (vor), (tor)); \
+ (data), 0, (flags), (vor), (tor)); \
} while(0)
/* Raw data + flags depending on FB/TT buffer */
#include "nouveau_winsys.h"
#include "nouveau_screen.h"
+//#define ENABLE_BUFRANGE
+
static const char *
nouveau_screen_get_name(struct pipe_screen *pscreen)
{
flags |= NOUVEAU_BO_RD;
if (pipe & PIPE_BUFFER_USAGE_CPU_WRITE)
flags |= NOUVEAU_BO_WR;
-#ifdef NOUVEAU_BO_NOWAIT
if (pipe & PIPE_BUFFER_USAGE_DISCARD)
flags |= NOUVEAU_BO_INVAL;
-
if (pipe & PIPE_BUFFER_USAGE_DONTBLOCK)
flags |= NOUVEAU_BO_NOWAIT;
else
if (pipe & 0 /*PIPE_BUFFER_USAGE_UNSYNCHRONIZED*/)
flags |= NOUVEAU_BO_NOSYNC;
-#endif
return flags;
}
return bo->map;
}
-#ifdef NOUVEAU_BO_NOWAIT
+#ifdef ENABLE_BUFRANGE
static void *
nouveau_screen_bo_map_range(struct pipe_screen *pscreen, struct pipe_buffer *pb,
unsigned offset, unsigned length, unsigned usage)
pscreen->buffer_create = nouveau_screen_bo_new;
pscreen->user_buffer_create = nouveau_screen_bo_user;
pscreen->buffer_map = nouveau_screen_bo_map;
-#ifdef NOUVEAU_BO_NOWAIT
+#ifdef ENABLE_BUFRANGE
pscreen->buffer_map_range = nouveau_screen_bo_map_range;
pscreen->buffer_flush_mapped_range = nouveau_screen_bo_map_flush;
#endif
struct nouveau_stateobj_reloc *r = &so->reloc[i];
nouveau_pushbuf_emit_reloc(chan, pb->cur + r->offset,
- r->bo, r->data, r->flags, r->vor,
- r->tor);
+ r->bo, r->data, 0, r->flags,
+ r->vor, r->tor);
}
pb->cur += nr;
}
for (i = 0; i < so->cur_reloc; i++) {
struct nouveau_stateobj_reloc *r = &so->reloc[i];
- nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, r->packet,
+ nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, r->packet, 0,
(r->flags & (NOUVEAU_BO_VRAM |
NOUVEAU_BO_GART |
NOUVEAU_BO_RDWR)) |
NOUVEAU_BO_DUMMY, 0, 0);
- nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, r->data,
+ nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, r->data, 0,
r->flags | NOUVEAU_BO_DUMMY,
r->vor, r->tor);
}
if (format < 0)
return 1;
- if (!bo->tiled) {
+ if (!bo->tile_flags) {
BEGIN_RING(chan, eng2d, mthd, 2);
OUT_RING (chan, format);
OUT_RING (chan, 1);
BEGIN_RING(chan, eng2d, mthd, 5);
OUT_RING (chan, format);
OUT_RING (chan, 0);
- OUT_RING (chan, 0);
+ OUT_RING (chan, bo->tile_mode << 4);
OUT_RING (chan, 1);
OUT_RING (chan, 0);
BEGIN_RING(chan, eng2d, mthd + 0x18, 4);
so_reloc(so, bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW |
NOUVEAU_BO_RD, 0, 0);
- so_data (so, 0xd0005000);
+ so_data (so, 0xd0005000 | bo->tile_mode << 22);
so_data (so, 0x00300000);
so_data (so, mt->base.width[0]);
so_data (so, (mt->base.last_level << 28) |
WAIT_RING (chan, 14);
- if (!src_bo->tiled) {
+ if (!src_bo->tile_flags) {
BEGIN_RING(chan, m2mf, 0x0200, 1);
OUT_RING (chan, 1);
BEGIN_RING(chan, m2mf, 0x0314, 1);
} else {
BEGIN_RING(chan, m2mf, 0x0200, 6);
OUT_RING (chan, 0);
- OUT_RING (chan, 0);
+ OUT_RING (chan, src_bo->tile_mode << 4);
OUT_RING (chan, sw * cpp);
OUT_RING (chan, sh);
OUT_RING (chan, 1);
OUT_RING (chan, 0);
}
- if (!dst_bo->tiled) {
+ if (!dst_bo->tile_flags) {
BEGIN_RING(chan, m2mf, 0x021c, 1);
OUT_RING (chan, 1);
BEGIN_RING(chan, m2mf, 0x0318, 1);
} else {
BEGIN_RING(chan, m2mf, 0x021c, 6);
OUT_RING (chan, 0);
- OUT_RING (chan, 0);
+ OUT_RING (chan, dst_bo->tile_mode << 4);
OUT_RING (chan, dw * cpp);
OUT_RING (chan, dh);
OUT_RING (chan, 1);
BEGIN_RING(chan, m2mf, 0x030c, 2);
OUT_RELOCl(chan, src_bo, src_offset, src_reloc);
OUT_RELOCl(chan, dst_bo, dst_offset, dst_reloc);
- if (src_bo->tiled) {
+ if (src_bo->tile_flags) {
BEGIN_RING(chan, m2mf, 0x0218, 1);
OUT_RING (chan, (dy << 16) | sx);
} else {
src_offset += (line_count * src_pitch);
}
- if (dst_bo->tiled) {
+ if (dst_bo->tile_flags) {
BEGIN_RING(chan, m2mf, 0x0234, 1);
OUT_RING (chan, (sy << 16) | dx);
} else {