[Mesa-dev] [PATCH 1/2] gallium: remove deprecated PIPE_TRANSFER_DISCARD

Marek Olšák maraeo at gmail.com
Sun Jan 1 16:22:57 PST 2012


PIPE_TRANSFER_DISCARD_RANGE is defined the same.
---
 src/gallium/auxiliary/vl/vl_compositor.c           |    6 +++---
 src/gallium/auxiliary/vl/vl_idct.c                 |    2 +-
 src/gallium/auxiliary/vl/vl_mpeg12_decoder.c       |    2 +-
 src/gallium/auxiliary/vl/vl_vertex_buffers.c       |    8 ++++----
 src/gallium/auxiliary/vl/vl_zscan.c                |    4 ++--
 src/gallium/drivers/nouveau/nouveau_winsys.h       |    2 +-
 src/gallium/drivers/r300/r300_screen_buffer.c      |    2 +-
 src/gallium/drivers/r600/r600_buffer.c             |    2 +-
 .../drivers/svga/svga_resource_buffer_upload.c     |    2 +-
 src/gallium/drivers/svga/svga_swtnl_backend.c      |    2 +-
 src/gallium/include/pipe/p_defines.h               |    1 -
 11 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index f20941b..3631145 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -502,14 +502,14 @@ gen_vertex_data(struct vl_compositor *c, struct u_rect *dirty)
    assert(c);
 
    vb = pipe_buffer_map(c->pipe, c->vertex_buf.buffer,
-                        PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD | PIPE_TRANSFER_DONTBLOCK,
+                        PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE | PIPE_TRANSFER_DONTBLOCK,
                         &buf_transfer);
 
    if (!vb) {
       // If buffer is still locked from last draw create a new one
       create_vertex_buffer(c);
       vb = pipe_buffer_map(c->pipe, c->vertex_buf.buffer,
-                           PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+                           PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
                            &buf_transfer);
    }
 
@@ -635,7 +635,7 @@ vl_compositor_set_csc_matrix(struct vl_compositor *c, const float matrix[16])
    memcpy
    (
       pipe_buffer_map(c->pipe, c->csc_matrix,
-                      PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+                      PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
                       &buf_transfer),
       matrix,
       sizeof(csc_matrix)
diff --git a/src/gallium/auxiliary/vl/vl_idct.c b/src/gallium/auxiliary/vl/vl_idct.c
index a2b3537..73d13b6 100644
--- a/src/gallium/auxiliary/vl/vl_idct.c
+++ b/src/gallium/auxiliary/vl/vl_idct.c
@@ -715,7 +715,7 @@ vl_idct_upload_matrix(struct pipe_context *pipe, float scale)
    buf_transfer = pipe->get_transfer
    (
       pipe, matrix,
-      0, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+      0, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
       &rect
    );
    if (!buf_transfer)
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index e502fc6..f4c961f 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -596,7 +596,7 @@ vl_mpeg12_begin_frame(struct pipe_video_decoder *decoder)
    buf->tex_transfer = dec->base.context->get_transfer
    (
       dec->base.context, tex,
-      0, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+      0, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
       &rect
    );
 
diff --git a/src/gallium/auxiliary/vl/vl_vertex_buffers.c b/src/gallium/auxiliary/vl/vl_vertex_buffers.c
index e2665a5..96765fc 100644
--- a/src/gallium/auxiliary/vl/vl_vertex_buffers.c
+++ b/src/gallium/auxiliary/vl/vl_vertex_buffers.c
@@ -65,7 +65,7 @@ vl_vb_upload_quads(struct pipe_context *pipe)
    (
       pipe,
       quad.buffer,
-      PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+      PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
       &buf_transfer
    );
 
@@ -109,7 +109,7 @@ vl_vb_upload_pos(struct pipe_context *pipe, unsigned width, unsigned height)
    (
       pipe,
       pos.buffer,
-      PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+      PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
       &buf_transfer
    );
 
@@ -298,7 +298,7 @@ vl_vb_map(struct vl_vertex_buffer *buffer, struct pipe_context *pipe)
       (
          pipe,
          buffer->ycbcr[i].resource,
-         PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+         PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
          &buffer->ycbcr[i].transfer
       );
    }
@@ -308,7 +308,7 @@ vl_vb_map(struct vl_vertex_buffer *buffer, struct pipe_context *pipe)
       (
          pipe,
          buffer->mv[i].resource,
-         PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+         PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
          &buffer->mv[i].transfer
       );
    }
diff --git a/src/gallium/auxiliary/vl/vl_zscan.c b/src/gallium/auxiliary/vl/vl_zscan.c
index b720d53..873c465 100644
--- a/src/gallium/auxiliary/vl/vl_zscan.c
+++ b/src/gallium/auxiliary/vl/vl_zscan.c
@@ -382,7 +382,7 @@ vl_zscan_layout(struct pipe_context *pipe, const int layout[64], unsigned blocks
    buf_transfer = pipe->get_transfer
    (
       pipe, res,
-      0, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+      0, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
       &rect
    );
    if (!buf_transfer)
@@ -562,7 +562,7 @@ vl_zscan_upload_quant(struct vl_zscan_buffer *buffer, const uint8_t matrix[64],
    buf_transfer = pipe->get_transfer
    (
       pipe, buffer->quant->texture,
-      0, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+      0, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
       &rect
    );
    if (!buf_transfer)
diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h
index 1abfa79..3423451 100644
--- a/src/gallium/drivers/nouveau/nouveau_winsys.h
+++ b/src/gallium/drivers/nouveau/nouveau_winsys.h
@@ -31,7 +31,7 @@ nouveau_screen_transfer_flags(unsigned pipe)
 		flags |= NOUVEAU_BO_RD;
 	if (pipe & PIPE_TRANSFER_WRITE)
 		flags |= NOUVEAU_BO_WR;
-	if (pipe & PIPE_TRANSFER_DISCARD)
+	if (pipe & PIPE_TRANSFER_DISCARD_RANGE)
 		flags |= NOUVEAU_BO_INVAL;
 	if (pipe & PIPE_TRANSFER_UNSYNCHRONIZED)
 		flags |= NOUVEAU_BO_NOSYNC;
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index 9d8ce62..37f6e8d 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -161,7 +161,7 @@ static void r300_buffer_transfer_inline_write(struct pipe_context *pipe,
     assert(rbuf->b.user_ptr == NULL);
 
     map = rws->buffer_map(rbuf->buf, r300->cs,
-                          PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD | usage);
+                          PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE | usage);
 
     memcpy(map + box->x, data, box->width);
 
diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c
index b7f0b24..4511a94 100644
--- a/src/gallium/drivers/r600/r600_buffer.c
+++ b/src/gallium/drivers/r600/r600_buffer.c
@@ -127,7 +127,7 @@ static void r600_buffer_transfer_inline_write(struct pipe_context *pipe,
 	assert(rbuffer->b.user_ptr == NULL);
 
 	map = rctx->ws->buffer_map(rbuffer->buf, rctx->ctx.cs,
-				   PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD | usage);
+				   PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE | usage);
 
 	memcpy(map + box->x, data, box->width);
 
diff --git a/src/gallium/drivers/svga/svga_resource_buffer_upload.c b/src/gallium/drivers/svga/svga_resource_buffer_upload.c
index 36782d5..f4a96cb 100644
--- a/src/gallium/drivers/svga/svga_resource_buffer_upload.c
+++ b/src/gallium/drivers/svga/svga_resource_buffer_upload.c
@@ -500,7 +500,7 @@ svga_buffer_upload_piecewise(struct svga_screen *ss,
 
          map = sws->buffer_map(sws, hwbuf,
                                PIPE_TRANSFER_WRITE |
-                               PIPE_TRANSFER_DISCARD);
+                               PIPE_TRANSFER_DISCARD_RANGE);
          assert(map);
          if (map) {
             memcpy(map, sbuf->swbuf, size);
diff --git a/src/gallium/drivers/svga/svga_swtnl_backend.c b/src/gallium/drivers/svga/svga_swtnl_backend.c
index e149d21..521226c 100644
--- a/src/gallium/drivers/svga/svga_swtnl_backend.c
+++ b/src/gallium/drivers/svga/svga_swtnl_backend.c
@@ -126,7 +126,7 @@ svga_vbuf_render_map_vertices( struct vbuf_render *render )
                                          svga_render->vbuf,
                                          PIPE_TRANSFER_WRITE |
                                          PIPE_TRANSFER_FLUSH_EXPLICIT |
-                                         PIPE_TRANSFER_DISCARD |
+                                         PIPE_TRANSFER_DISCARD_RANGE |
                                          PIPE_TRANSFER_UNSYNCHRONIZED,
                                          &svga_render->vbuf_transfer);
       if (ptr)
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 05aa1cd..3b3940d 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -233,7 +233,6 @@ enum pipe_transfer_usage {
     * See also:
     * - OpenGL's ARB_map_buffer_range extension, MAP_INVALIDATE_RANGE_BIT flag.
     */
-   PIPE_TRANSFER_DISCARD = (1 << 8), /* DEPRECATED */
    PIPE_TRANSFER_DISCARD_RANGE = (1 << 8),
 
    /**
-- 
1.7.4.1



More information about the mesa-dev mailing list