nouveau: fix build with libdrm_nouveau 0.6
authorBen Skeggs <bskeggs@redhat.com>
Fri, 5 Jun 2009 02:27:42 +0000 (12:27 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 5 Jun 2009 04:37:04 +0000 (14:37 +1000)
src/gallium/drivers/nouveau/nouveau_push.h
src/gallium/drivers/nouveau/nouveau_screen.c
src/gallium/drivers/nouveau/nouveau_stateobj.h
src/gallium/drivers/nv50/nv50_surface.c
src/gallium/drivers/nv50/nv50_tex.c
src/gallium/drivers/nv50/nv50_transfer.c

index 0f2c42915bb1f0c39e1eb619ccf5140f77d7b7dd..9c235080a55a585a022373d6581919bf06251a34 100644 (file)
@@ -54,7 +54,7 @@ DO_FIRE_RING(struct nouveau_channel *chan, struct pipe_fence_handle **fence)
        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 */
index ab522a124aa214c2c58740564d9f3721ebac7a59..0ab1d82ebcc4ba0f3d25f91e20b48a08f826c411 100644 (file)
@@ -8,6 +8,8 @@
 #include "nouveau_winsys.h"
 #include "nouveau_screen.h"
 
+//#define ENABLE_BUFRANGE
+
 static const char *
 nouveau_screen_get_name(struct pipe_screen *pscreen)
 {
@@ -109,16 +111,13 @@ nouveau_screen_map_flags(unsigned pipe)
                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;
 }
@@ -139,7 +138,7 @@ nouveau_screen_bo_map(struct pipe_screen *pscreen, struct pipe_buffer *pb,
        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)
@@ -226,7 +225,7 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
        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
index 8e818d9d38cf37bc9270f0ed3fb4aaa06f334b49..b595405357f0044255261993c4887f1acdcfb8c5 100644 (file)
@@ -122,8 +122,8 @@ so_emit(struct nouveau_channel *chan, struct nouveau_stateobj *so)
                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;
 }
@@ -145,12 +145,12 @@ so_emit_reloc_markers(struct nouveau_channel *chan, struct nouveau_stateobj *so)
        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);
        }
index cd4e7ef690d213a86a600df84635e7b0a06c1c6d..936fe43561d18658ad3554326404c16adb41a4c7 100644 (file)
@@ -62,7 +62,7 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst)
        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);
@@ -76,7 +76,7 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst)
                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);
index 86947faee3400ae3a93c160a16d2b8e294d0a7a6..5539a796e8bd8217c50f72c352a5cba49649443f 100644 (file)
@@ -122,7 +122,7 @@ nv50_tex_construct(struct nv50_context *nv50, struct nouveau_stateobj *so,
 
        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) |
index a0a2099035372b32b4791f3cad79ac2e1b3c5e2a..babb35a227a54f15db933b66e846493546980bd4 100644 (file)
@@ -34,7 +34,7 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen, struct pipe_buffer *src,
 
        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);
@@ -43,14 +43,14 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen, struct pipe_buffer *src,
        } 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);
@@ -59,7 +59,7 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen, struct pipe_buffer *src,
        } 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);
@@ -76,13 +76,13 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen, struct pipe_buffer *src,
                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 {