summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2018-01-15 22:50:22 +0100
committerNicolai Hähnle <nicolai.haehnle@amd.com>2018-01-16 20:15:31 +0100
commit4bf73cc6a8abb7bf5dc030ac8860e1d74e236f95 (patch)
tree630f77814357c3377ab6d9f9723ca6e0d5d17e91
parent6f0a63650424b43a59ab44cf8156dbe1f9caaacc (diff)
gallium: use pipe_transfer_map_box inline helper
We will change pipe_context::transfer_map in a subsequent commit. Wrapping it in an inline function makes that subsequent change less noisy.
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_aaline.c2
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h16
-rw-r--r--src/gallium/auxiliary/util/u_surface.c4
-rw-r--r--src/gallium/auxiliary/util/u_transfer.c4
-rw-r--r--src/gallium/auxiliary/util/u_transfer_helper.c2
-rw-r--r--src/gallium/auxiliary/vl/vl_idct.c2
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_decoder.c2
-rw-r--r--src/gallium/auxiliary/vl/vl_zscan.c4
-rw-r--r--src/gallium/drivers/r600/compute_memory_pool.c6
-rw-r--r--src/gallium/drivers/r600/evergreen_compute.c2
-rw-r--r--src/gallium/state_trackers/clover/core/resource.cpp2
-rw-r--r--src/gallium/state_trackers/nine/buffer9.c2
-rw-r--r--src/gallium/state_trackers/nine/device9.c6
-rw-r--r--src/gallium/state_trackers/nine/nine_state.c4
-rw-r--r--src/gallium/state_trackers/nine/surface9.c6
-rw-r--r--src/gallium/state_trackers/nine/volume9.c4
-rw-r--r--src/gallium/state_trackers/omx_bellagio/vid_dec.c2
-rw-r--r--src/gallium/state_trackers/omx_bellagio/vid_enc.c6
-rw-r--r--src/gallium/state_trackers/osmesa/osmesa.c4
-rw-r--r--src/gallium/state_trackers/va/buffer.c2
-rw-r--r--src/gallium/state_trackers/va/image.c4
-rw-r--r--src/gallium/state_trackers/va/surface.c2
-rw-r--r--src/gallium/state_trackers/vdpau/output.c2
-rw-r--r--src/gallium/state_trackers/vdpau/surface.c4
-rw-r--r--src/gallium/state_trackers/xvmc/subpicture.c6
-rw-r--r--src/gallium/tests/trivial/compute.c4
-rw-r--r--src/gallium/tests/trivial/quad-tex.c2
-rw-r--r--src/mesa/state_tracker/st_texture.c2
28 files changed, 62 insertions, 46 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index a859dbc02b..5cbf192280 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -427,7 +427,7 @@ aaline_create_texture(struct aaline_stage *aaline)
/* This texture is new, no need to flush.
*/
- data = pipe->transfer_map(pipe,
+ data = pipe_transfer_map_box(pipe,
aaline->texture,
level,
PIPE_TRANSFER_WRITE,
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index 4ba6ad72b6..a71580cc53 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -436,6 +436,22 @@ pipe_buffer_read(struct pipe_context *pipe,
/**
* Map a resource for reading/writing.
+ */
+static inline void *
+pipe_transfer_map_box(struct pipe_context *context,
+ struct pipe_resource *resource,
+ unsigned level,
+ enum pipe_transfer_usage usage,
+ const struct pipe_box *box,
+ struct pipe_transfer **out_transfer)
+{
+ return context->transfer_map(context, resource, level, usage, box,
+ out_transfer);
+}
+
+
+/**
+ * Map a resource for reading/writing.
* \param access bitmask of PIPE_TRANSFER_x flags
*/
static inline void *
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index 5f07eb1cda..c28c93abd4 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -337,7 +337,7 @@ util_resource_copy_region(struct pipe_context *pipe,
assert((src_box.width / src_bw) * (src_box.height / src_bh) * src_bs ==
(dst_box.width / dst_bw) * (dst_box.height / dst_bh) * dst_bs);
- src_map = pipe->transfer_map(pipe,
+ src_map = pipe_transfer_map_box(pipe,
src,
src_level,
PIPE_TRANSFER_READ,
@@ -347,7 +347,7 @@ util_resource_copy_region(struct pipe_context *pipe,
goto no_src_map;
}
- dst_map = pipe->transfer_map(pipe,
+ dst_map = pipe_transfer_map_box(pipe,
dst,
dst_level,
PIPE_TRANSFER_WRITE |
diff --git a/src/gallium/auxiliary/util/u_transfer.c b/src/gallium/auxiliary/util/u_transfer.c
index 3089bcb1f3..0e0c4cc91c 100644
--- a/src/gallium/auxiliary/util/u_transfer.c
+++ b/src/gallium/auxiliary/util/u_transfer.c
@@ -27,7 +27,7 @@ void u_default_buffer_subdata(struct pipe_context *pipe,
u_box_1d(offset, size, &box);
- map = pipe->transfer_map(pipe, resource, 0, usage, &box, &transfer);
+ map = pipe_transfer_map_box(pipe, resource, 0, usage, &box, &transfer);
if (!map)
return;
@@ -56,7 +56,7 @@ void u_default_texture_subdata(struct pipe_context *pipe,
/* texture_subdata implicitly discards the rewritten buffer range */
usage |= PIPE_TRANSFER_DISCARD_RANGE;
- map = pipe->transfer_map(pipe,
+ map = pipe_transfer_map_box(pipe,
resource,
level,
usage,
diff --git a/src/gallium/auxiliary/util/u_transfer_helper.c b/src/gallium/auxiliary/util/u_transfer_helper.c
index dd31049920..f69015af51 100644
--- a/src/gallium/auxiliary/util/u_transfer_helper.c
+++ b/src/gallium/auxiliary/util/u_transfer_helper.c
@@ -208,7 +208,7 @@ transfer_map_msaa(struct pipe_context *pctx,
pctx->blit(pctx, &blit);
}
- void *ss_map = pctx->transfer_map(pctx, trans->ss, 0, usage, box,
+ void *ss_map = pipe_transfer_map_box(pctx, trans->ss, 0, usage, box,
&trans->trans);
if (!ss_map) {
free(trans);
diff --git a/src/gallium/auxiliary/vl/vl_idct.c b/src/gallium/auxiliary/vl/vl_idct.c
index 3e6f581244..f69b5fffa3 100644
--- a/src/gallium/auxiliary/vl/vl_idct.c
+++ b/src/gallium/auxiliary/vl/vl_idct.c
@@ -708,7 +708,7 @@ vl_idct_upload_matrix(struct pipe_context *pipe, float scale)
if (!matrix)
goto error_matrix;
- f = pipe->transfer_map(pipe, matrix, 0,
+ f = pipe_transfer_map_box(pipe, matrix, 0,
PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_DISCARD_RANGE,
&rect, &buf_transfer);
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index 8a2dae34e3..74a12927e9 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -628,7 +628,7 @@ vl_mpeg12_begin_frame(struct pipe_video_codec *decoder,
rect.height = tex->height0;
buf->texels =
- dec->context->transfer_map(dec->context, tex, 0,
+ pipe_transfer_map_box(dec->context, tex, 0,
PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_DISCARD_RANGE,
&rect, &buf->tex_transfer);
diff --git a/src/gallium/auxiliary/vl/vl_zscan.c b/src/gallium/auxiliary/vl/vl_zscan.c
index 75013c42bf..0d57c61d23 100644
--- a/src/gallium/auxiliary/vl/vl_zscan.c
+++ b/src/gallium/auxiliary/vl/vl_zscan.c
@@ -407,7 +407,7 @@ vl_zscan_layout(struct pipe_context *pipe, const int layout[64], unsigned blocks
if (!res)
goto error_resource;
- f = pipe->transfer_map(pipe, res,
+ f = pipe_transfer_map_box(pipe, res,
0, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
&rect, &buf_transfer);
if (!f)
@@ -573,7 +573,7 @@ vl_zscan_upload_quant(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer,
rect.width *= zscan->blocks_per_line;
- data = pipe->transfer_map(pipe, buffer->quant->texture,
+ data = pipe_transfer_map_box(pipe, buffer->quant->texture,
0, PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_DISCARD_RANGE,
&rect, &buf_transfer);
diff --git a/src/gallium/drivers/r600/compute_memory_pool.c b/src/gallium/drivers/r600/compute_memory_pool.c
index bcda155c71..37e7188110 100644
--- a/src/gallium/drivers/r600/compute_memory_pool.c
+++ b/src/gallium/drivers/r600/compute_memory_pool.c
@@ -540,7 +540,7 @@ void compute_memory_move_item(struct compute_memory_pool *pool,
u_box_1d(new_start_in_dw * 4, (offset + item->size_in_dw) * 4, &box);
- map = pipe->transfer_map(pipe, src, 0, PIPE_TRANSFER_READ_WRITE,
+ map = pipe_transfer_map_box(pipe, src, 0, PIPE_TRANSFER_READ_WRITE,
&box, &trans);
assert(map);
@@ -675,7 +675,7 @@ void compute_memory_transfer(
offset_in_chunk, size);
if (device_to_host) {
- map = pipe->transfer_map(pipe, gart, 0, PIPE_TRANSFER_READ,
+ map = pipe_transfer_map_box(pipe, gart, 0, PIPE_TRANSFER_READ,
&(struct pipe_box) { .width = aligned_size * 4,
.height = 1, .depth = 1 }, &xfer);
assert(xfer);
@@ -683,7 +683,7 @@ void compute_memory_transfer(
memcpy(data, map + internal_offset, size);
pipe->transfer_unmap(pipe, xfer);
} else {
- map = pipe->transfer_map(pipe, gart, 0, PIPE_TRANSFER_WRITE,
+ map = pipe_transfer_map_box(pipe, gart, 0, PIPE_TRANSFER_WRITE,
&(struct pipe_box) { .width = aligned_size * 4,
.height = 1, .depth = 1 }, &xfer);
assert(xfer);
diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index 45fba00778..6925d9e585 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -532,7 +532,7 @@ static void evergreen_compute_upload_input(struct pipe_context *ctx,
}
u_box_1d(0, input_size, &box);
- num_work_groups_start = ctx->transfer_map(ctx,
+ num_work_groups_start = pipe_transfer_map_box(ctx,
(struct pipe_resource*)shader->kernel_param,
0, PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
&box, &transfer);
diff --git a/src/gallium/state_trackers/clover/core/resource.cpp b/src/gallium/state_trackers/clover/core/resource.cpp
index 79911771a0..ebf3ee036e 100644
--- a/src/gallium/state_trackers/clover/core/resource.cpp
+++ b/src/gallium/state_trackers/clover/core/resource.cpp
@@ -197,7 +197,7 @@ mapping::mapping(command_queue &q, resource &r,
PIPE_TRANSFER_DISCARD_RANGE : 0) |
(!blocking ? PIPE_TRANSFER_UNSYNCHRONIZED : 0));
- p = pctx->transfer_map(pctx, r.pipe, 0, usage,
+ p = pipe_transfer_map_box(pctx, r.pipe, 0, (pipe_transfer_usage)usage,
box(origin + r.offset, region), &pxfer);
if (!p) {
pxfer = NULL;
diff --git a/src/gallium/state_trackers/nine/buffer9.c b/src/gallium/state_trackers/nine/buffer9.c
index ca4e438027..f215836c96 100644
--- a/src/gallium/state_trackers/nine/buffer9.c
+++ b/src/gallium/state_trackers/nine/buffer9.c
@@ -371,7 +371,7 @@ NineBuffer9_Lock( struct NineBuffer9 *This,
else
pipe = NineDevice9_GetPipe(device);
- data = pipe->transfer_map(pipe, This->base.resource, 0,
+ data = pipe_transfer_map_box(pipe, This->base.resource, 0,
usage, &box, &This->maps[This->nmaps].transfer);
if (!data) {
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 34f903a694..50c2f17e20 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -318,7 +318,7 @@ NineDevice9_ctor( struct NineDevice9 *This,
return D3DERR_OUTOFVIDEOMEMORY;
u_box_1d(0, 16, &box);
- data = This->context.pipe->transfer_map(This->context.pipe, This->dummy_vbo, 0,
+ data = pipe_transfer_map_box(This->context.pipe, This->dummy_vbo, 0,
PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE,
&box, &transfer);
@@ -724,7 +724,7 @@ NineDevice9_SetCursorProperties( struct NineDevice9 *This,
u_box_origin_2d(This->cursor.w, This->cursor.h, &box);
- ptr = pipe->transfer_map(pipe, This->cursor.image, 0,
+ ptr = pipe_transfer_map_box(pipe, This->cursor.image, 0,
PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE,
&box, &transfer);
@@ -3048,7 +3048,7 @@ NineDevice9_ProcessVertices( struct NineDevice9 *This,
pipe_sw->stream_output_target_destroy(pipe_sw, target);
u_box_1d(0, VertexCount * so.stride[0] * 4, &box);
- map = pipe_sw->transfer_map(pipe_sw, resource, 0, PIPE_TRANSFER_READ, &box,
+ map = pipe_transfer_map_box(pipe_sw, resource, 0, PIPE_TRANSFER_READ, &box,
&transfer);
if (!map) {
hr = D3DERR_DRIVERINTERNALERROR;
diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c
index a9a41af66e..b580655f7e 100644
--- a/src/gallium/state_trackers/nine/nine_state.c
+++ b/src/gallium/state_trackers/nine/nine_state.c
@@ -2747,7 +2747,7 @@ CSMT_ITEM_NO_WAIT_WITH_COUNTER(nine_context_box_upload,
/* We just bind dst for the bind count */
(void)dst;
- map = pipe->transfer_map(pipe,
+ map = pipe_transfer_map_box(pipe,
res,
level,
PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
@@ -3287,7 +3287,7 @@ update_vertex_buffers_sw(struct NineDevice9 *device, int start_vertice, int num_
u_box_1d(vtxbuf.buffer_offset + offset + start_vertice * vtxbuf.stride,
num_vertices * vtxbuf.stride, &box);
- userbuf = pipe->transfer_map(pipe, buf, 0, PIPE_TRANSFER_READ, &box,
+ userbuf = pipe_transfer_map_box(pipe, buf, 0, PIPE_TRANSFER_READ, &box,
&(sw_internal->transfers_so[i]));
vtxbuf.is_user_buffer = true;
vtxbuf.buffer.user = userbuf;
diff --git a/src/gallium/state_trackers/nine/surface9.c b/src/gallium/state_trackers/nine/surface9.c
index d917fa1f86..c0d68cddc8 100644
--- a/src/gallium/state_trackers/nine/surface9.c
+++ b/src/gallium/state_trackers/nine/surface9.c
@@ -510,7 +510,7 @@ NineSurface9_LockRect( struct NineSurface9 *This,
pipe = nine_context_get_pipe_acquire(This->base.base.device);
else
pipe = NineDevice9_GetPipe(This->base.base.device);
- pLockedRect->pBits = pipe->transfer_map(pipe, resource,
+ pLockedRect->pBits = pipe_transfer_map_box(pipe, resource,
This->level, usage, &box,
&This->transfer);
if (no_refs)
@@ -556,7 +556,7 @@ NineSurface9_UnlockRect( struct NineSurface9 *This )
pipe = NineDevice9_GetPipe(This->base.base.device);
if (!dst) {
- dst = pipe->transfer_map(pipe,
+ dst = pipe_transfer_map_box(pipe,
This->base.resource,
This->level,
PIPE_TRANSFER_WRITE |
@@ -703,7 +703,7 @@ NineSurface9_CopyDefaultToMem( struct NineSurface9 *This,
nine_csmt_process(This->base.base.device);
pipe = NineDevice9_GetPipe(This->base.base.device);
- p_src = pipe->transfer_map(pipe, r_src, From->level,
+ p_src = pipe_transfer_map_box(pipe, r_src, From->level,
PIPE_TRANSFER_READ,
&src_box, &transfer);
p_dst = NineSurface9_GetSystemMemPointer(This, 0, 0);
diff --git a/src/gallium/state_trackers/nine/volume9.c b/src/gallium/state_trackers/nine/volume9.c
index 62af3e6225..431b9a1c1d 100644
--- a/src/gallium/state_trackers/nine/volume9.c
+++ b/src/gallium/state_trackers/nine/volume9.c
@@ -333,7 +333,7 @@ NineVolume9_LockBox( struct NineVolume9 *This,
else
pipe = NineDevice9_GetPipe(This->base.device);
pLockedVolume->pBits =
- pipe->transfer_map(pipe, resource, This->level, usage,
+ pipe_transfer_map_box(pipe, resource, This->level, usage,
&box, &This->transfer);
if (no_refs)
nine_context_get_pipe_release(This->base.device);
@@ -380,7 +380,7 @@ NineVolume9_UnlockBox( struct NineVolume9 *This )
pipe = NineDevice9_GetPipe(This->base.device);
if (!dst) {
- dst = pipe->transfer_map(pipe,
+ dst = pipe_transfer_map_box(pipe,
This->resource,
This->level,
PIPE_TRANSFER_WRITE |
diff --git a/src/gallium/state_trackers/omx_bellagio/vid_dec.c b/src/gallium/state_trackers/omx_bellagio/vid_dec.c
index f9fe19f63f..7e4244d45b 100644
--- a/src/gallium/state_trackers/omx_bellagio/vid_dec.c
+++ b/src/gallium/state_trackers/omx_bellagio/vid_dec.c
@@ -562,7 +562,7 @@ static void vid_dec_FillOutput(vid_dec_PrivateType *priv, struct pipe_video_buff
struct pipe_box box = {0, 0, j, width, height, 1};
struct pipe_transfer *transfer;
uint8_t *map, *dst;
- map = priv->pipe->transfer_map(priv->pipe, views[i]->texture, 0,
+ map = pipe_transfer_map_box(priv->pipe, views[i]->texture, 0,
PIPE_TRANSFER_READ, &box, &transfer);
if (!map)
return;
diff --git a/src/gallium/state_trackers/omx_bellagio/vid_enc.c b/src/gallium/state_trackers/omx_bellagio/vid_enc.c
index 1a4fb62d40..de24e79a49 100644
--- a/src/gallium/state_trackers/omx_bellagio/vid_enc.c
+++ b/src/gallium/state_trackers/omx_bellagio/vid_enc.c
@@ -330,7 +330,7 @@ static OMX_ERRORTYPE enc_AllocateBackTexture(omx_base_PortType *port,
box.width = (*resource)->width0;
box.height = (*resource)->height0;
box.depth = (*resource)->depth0;
- ptr = priv->s_pipe->transfer_map(priv->s_pipe, *resource, 0, PIPE_TRANSFER_WRITE, &box, transfer);
+ ptr = pipe_transfer_map_box(priv->s_pipe, *resource, 0, PIPE_TRANSFER_WRITE, &box, transfer);
if (map)
*map = ptr;
@@ -959,7 +959,7 @@ static OMX_ERRORTYPE enc_LoadImage(omx_base_PortType *port, OMX_BUFFERHEADERTYPE
box.width = inp->resource->width0;
box.height = inp->resource->height0;
box.depth = inp->resource->depth0;
- buf->pBuffer = priv->s_pipe->transfer_map(priv->s_pipe, inp->resource, 0,
+ buf->pBuffer = pipe_transfer_map_box(priv->s_pipe, inp->resource, 0,
PIPE_TRANSFER_WRITE, &box,
&inp->transfer);
}
@@ -1262,7 +1262,7 @@ static void vid_enc_BufferEncoded(OMX_COMPONENTTYPE *comp, OMX_BUFFERHEADERTYPE*
box.height = outp->bitstream->height0;
box.depth = outp->bitstream->depth0;
- output->pBuffer = priv->t_pipe->transfer_map(priv->t_pipe, outp->bitstream, 0,
+ output->pBuffer = pipe_transfer_map_box(priv->t_pipe, outp->bitstream, 0,
PIPE_TRANSFER_READ_WRITE,
&box, &outp->transfer);
diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c
index 8baec0a0e4..fe9be40b35 100644
--- a/src/gallium/state_trackers/osmesa/osmesa.c
+++ b/src/gallium/state_trackers/osmesa/osmesa.c
@@ -344,7 +344,7 @@ osmesa_st_framebuffer_flush_front(struct st_context_iface *stctx,
u_box_2d(0, 0, res->width0, res->height0, &box);
- map = pipe->transfer_map(pipe, res, 0, PIPE_TRANSFER_READ, &box,
+ map = pipe_transfer_map_box(pipe, res, 0, PIPE_TRANSFER_READ, &box,
&transfer);
/*
@@ -927,7 +927,7 @@ OSMesaGetDepthBuffer(OSMesaContext c, GLint *width, GLint *height,
u_box_2d(0, 0, res->width0, res->height0, &box);
- *buffer = pipe->transfer_map(pipe, res, 0, PIPE_TRANSFER_READ, &box,
+ *buffer = pipe_transfer_map_box(pipe, res, 0, PIPE_TRANSFER_READ, &box,
&transfer);
if (!*buffer) {
return GL_FALSE;
diff --git a/src/gallium/state_trackers/va/buffer.c b/src/gallium/state_trackers/va/buffer.c
index deaeb1939f..dd21b0a419 100644
--- a/src/gallium/state_trackers/va/buffer.c
+++ b/src/gallium/state_trackers/va/buffer.c
@@ -132,7 +132,7 @@ vlVaMapBuffer(VADriverContextP ctx, VABufferID buf_id, void **pbuff)
box.width = resource->width0;
box.height = resource->height0;
box.depth = resource->depth0;
- *pbuff = drv->pipe->transfer_map(drv->pipe, resource, 0, PIPE_TRANSFER_WRITE,
+ *pbuff = pipe_transfer_map_box(drv->pipe, resource, 0, PIPE_TRANSFER_WRITE,
&box, &buf->derived_surface.transfer);
mtx_unlock(&drv->mutex);
diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c
index 86ae868580..86780edfaf 100644
--- a/src/gallium/state_trackers/va/image.c
+++ b/src/gallium/state_trackers/va/image.c
@@ -407,7 +407,7 @@ vlVaGetImage(VADriverContextP ctx, VASurfaceID surface, int x, int y,
struct pipe_box box = {0, 0, j, width, height, 1};
struct pipe_transfer *transfer;
uint8_t *map;
- map = drv->pipe->transfer_map(drv->pipe, views[i]->texture, 0,
+ map = pipe_transfer_map_box(drv->pipe, views[i]->texture, 0,
PIPE_TRANSFER_READ, &box, &transfer);
if (!map) {
mtx_unlock(&drv->mutex);
@@ -542,7 +542,7 @@ vlVaPutImage(VADriverContextP ctx, VASurfaceID surface, VAImageID image,
struct pipe_transfer *transfer = NULL;
uint8_t *map = NULL;
- map = drv->pipe->transfer_map(drv->pipe,
+ map = pipe_transfer_map_box(drv->pipe,
tex,
0,
PIPE_TRANSFER_WRITE |
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
index 636505b720..f16d20e7fa 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -166,7 +166,7 @@ upload_sampler(struct pipe_context *pipe, struct pipe_sampler_view *dst,
struct pipe_transfer *transfer;
void *map;
- map = pipe->transfer_map(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE,
+ map = pipe_transfer_map_box(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE,
dst_box, &transfer);
if (!map)
return;
diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c
index 8ef826836c..7eaebb26a9 100644
--- a/src/gallium/state_trackers/vdpau/output.c
+++ b/src/gallium/state_trackers/vdpau/output.c
@@ -220,7 +220,7 @@ vlVdpOutputSurfaceGetBitsNative(VdpOutputSurface surface,
res = vlsurface->sampler_view->texture;
box = RectToPipeBox(source_rect, res);
- map = pipe->transfer_map(pipe, res, 0, PIPE_TRANSFER_READ, &box, &transfer);
+ map = pipe_transfer_map_box(pipe, res, 0, PIPE_TRANSFER_READ, &box, &transfer);
if (!map) {
mtx_unlock(&vlsurface->device->mutex);
return VDP_STATUS_RESOURCES;
diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c
index c678eb7037..801aa83e39 100644
--- a/src/gallium/state_trackers/vdpau/surface.c
+++ b/src/gallium/state_trackers/vdpau/surface.c
@@ -260,7 +260,7 @@ vlVdpVideoSurfaceGetBitsYCbCr(VdpVideoSurface surface,
struct pipe_transfer *transfer;
uint8_t *map;
- map = pipe->transfer_map(pipe, sv->texture, 0,
+ map = pipe_transfer_map_box(pipe, sv->texture, 0,
PIPE_TRANSFER_READ, &box, &transfer);
if (!map) {
mtx_unlock(&vlsurface->device->mutex);
@@ -398,7 +398,7 @@ vlVdpVideoSurfacePutBitsYCbCr(VdpVideoSurface surface,
struct pipe_transfer *transfer;
uint8_t *map;
- map = pipe->transfer_map(pipe, tex, 0, usage,
+ map = pipe_transfer_map_box(pipe, tex, 0, usage,
&dst_box, &transfer);
if (!map) {
mtx_unlock(&p_surf->device->mutex);
diff --git a/src/gallium/state_trackers/xvmc/subpicture.c b/src/gallium/state_trackers/xvmc/subpicture.c
index bc26976e28..3eb809da53 100644
--- a/src/gallium/state_trackers/xvmc/subpicture.c
+++ b/src/gallium/state_trackers/xvmc/subpicture.c
@@ -210,7 +210,7 @@ upload_sampler(struct pipe_context *pipe, struct pipe_sampler_view *dst,
struct pipe_transfer *transfer;
void *map;
- map = pipe->transfer_map(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE,
+ map = pipe_transfer_map_box(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE,
dst_box, &transfer);
if (!map)
return;
@@ -231,7 +231,7 @@ upload_sampler_convert(struct pipe_context *pipe, struct pipe_sampler_view *dst,
int i, j;
char *map, *src;
- map = pipe->transfer_map(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE,
+ map = pipe_transfer_map_box(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE,
dst_box, &transfer);
if (!map)
return;
@@ -395,7 +395,7 @@ Status XvMCClearSubpicture(Display *dpy, XvMCSubpicture *subpicture, short x, sh
dst = subpicture_priv->sampler;
/* TODO: Assert clear rect is within bounds? Or clip? */
- map = pipe->transfer_map(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE,
+ map = pipe_transfer_map_box(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE,
&dst_box, &transfer);
if (!map)
return XvMCBadSubpicture;
diff --git a/src/gallium/tests/trivial/compute.c b/src/gallium/tests/trivial/compute.c
index 443451e13d..56d3898d2f 100644
--- a/src/gallium/tests/trivial/compute.c
+++ b/src/gallium/tests/trivial/compute.c
@@ -204,7 +204,7 @@ static void init_tex(struct context *ctx, int slot,
*tex = ctx->screen->resource_create(ctx->screen, &ttex);
assert(*tex);
- map = pipe->transfer_map(pipe, *tex, 0, PIPE_TRANSFER_WRITE,
+ map = pipe_transfer_map_box(pipe, *tex, 0, PIPE_TRANSFER_WRITE,
&(struct pipe_box) { .width = w,
.height = h,
.depth = 1 }, &xfer);
@@ -246,7 +246,7 @@ static void check_tex(struct context *ctx, int slot,
if (!check)
check = default_check;
- map = pipe->transfer_map(pipe, tex, 0, PIPE_TRANSFER_READ,
+ map = pipe_transfer_map_box(pipe, tex, 0, PIPE_TRANSFER_READ,
&(struct pipe_box) { .width = tex->width0,
.height = tex->height0,
.depth = 1 }, &xfer);
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c
index 2ee544a412..c42e393f5e 100644
--- a/src/gallium/tests/trivial/quad-tex.c
+++ b/src/gallium/tests/trivial/quad-tex.c
@@ -175,7 +175,7 @@ static void init_prog(struct program *p)
box.width = 2;
box.height = 2;
- ptr = p->pipe->transfer_map(p->pipe, p->tex, 0, PIPE_TRANSFER_WRITE, &box, &t);
+ ptr = pipe_transfer_map_box(p->pipe, p->tex, 0, PIPE_TRANSFER_WRITE, &box, &t);
ptr[0] = 0xffff0000;
ptr[1] = 0xff0000ff;
ptr[2] = 0xff00ff00;
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 7d8303615e..6dadaa93c4 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -334,7 +334,7 @@ print_center_pixel(struct pipe_context *pipe, struct pipe_resource *src)
region.height = 1;
region.depth = 1;
- map = pipe->transfer_map(pipe, src, 0, PIPE_TRANSFER_READ, &region, &xfer);
+ map = pipe_transfer_map_box(pipe, src, 0, PIPE_TRANSFER_READ, &region, &xfer);
printf("center pixel: %d %d %d %d\n", map[0], map[1], map[2], map[3]);