Commit 22253e6b authored by Marek Olšák's avatar Marek Olšák Committed by Marge Bot

gallium: rename PIPE_TRANSFER_* -> PIPE_MAP_*

Acked-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Part-of: <!5749>
parent 44f1b1be
......@@ -754,49 +754,49 @@ the last (partial) page requires a box that ends at the end of the buffer
.. _pipe_transfer:
PIPE_TRANSFER
PIPE_MAP
^^^^^^^^^^^^^
These flags control the behavior of a transfer object.
``PIPE_TRANSFER_READ``
``PIPE_MAP_READ``
Resource contents read back (or accessed directly) at transfer create time.
``PIPE_TRANSFER_WRITE``
``PIPE_MAP_WRITE``
Resource contents will be written back at transfer_unmap time (or modified
as a result of being accessed directly).
``PIPE_TRANSFER_MAP_DIRECTLY``
``PIPE_MAP_DIRECTLY``
a transfer should directly map the resource. May return NULL if not supported.
``PIPE_TRANSFER_DISCARD_RANGE``
``PIPE_MAP_DISCARD_RANGE``
The memory within the mapped region is discarded. Cannot be used with
``PIPE_TRANSFER_READ``.
``PIPE_MAP_READ``.
``PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE``
``PIPE_MAP_DISCARD_WHOLE_RESOURCE``
Discards all memory backing the resource. It should not be used with
``PIPE_TRANSFER_READ``.
``PIPE_MAP_READ``.
``PIPE_TRANSFER_DONTBLOCK``
``PIPE_MAP_DONTBLOCK``
Fail if the resource cannot be mapped immediately.
``PIPE_TRANSFER_UNSYNCHRONIZED``
``PIPE_MAP_UNSYNCHRONIZED``
Do not synchronize pending operations on the resource when mapping. The
interaction of any writes to the map and any operations pending on the
resource are undefined. Cannot be used with ``PIPE_TRANSFER_READ``.
resource are undefined. Cannot be used with ``PIPE_MAP_READ``.
``PIPE_TRANSFER_FLUSH_EXPLICIT``
``PIPE_MAP_FLUSH_EXPLICIT``
Written ranges will be notified later with :ref:`transfer_flush_region`.
Cannot be used with ``PIPE_TRANSFER_READ``.
Cannot be used with ``PIPE_MAP_READ``.
``PIPE_TRANSFER_PERSISTENT``
``PIPE_MAP_PERSISTENT``
Allows the resource to be used for rendering while mapped.
PIPE_RESOURCE_FLAG_MAP_PERSISTENT must be set when creating
the resource.
If COHERENT is not set, memory_barrier(PIPE_BARRIER_MAPPED_BUFFER)
must be called to ensure the device can see what the CPU has written.
``PIPE_TRANSFER_COHERENT``
``PIPE_MAP_COHERENT``
If PERSISTENT is set, this ensures any writes done by the device are
immediately visible to the CPU and vice versa.
PIPE_RESOURCE_FLAG_MAP_COHERENT must be set when creating
......@@ -909,4 +909,4 @@ uploaded data, unless:
mapping, memory_barrier(PIPE_BARRIER_MAPPED_BUFFER) should be called on the
context that has mapped the resource. No flush is required.
* Mapping the resource with PIPE_TRANSFER_MAP_DIRECTLY.
* Mapping the resource with PIPE_MAP_DIRECTLY.
......@@ -210,7 +210,7 @@ The integer capabilities:
hardware implements the SM5 features, component selection,
shadow comparison, and run-time offsets.
* ``PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT``: Whether
PIPE_TRANSFER_PERSISTENT and PIPE_TRANSFER_COHERENT are supported
PIPE_MAP_PERSISTENT and PIPE_MAP_COHERENT are supported
for buffers.
* ``PIPE_CAP_TEXTURE_QUERY_LOD``: Whether the ``LODQ`` instruction is
supported.
......
......@@ -272,7 +272,7 @@ rbug_texture_read(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32_
tex = tr_tex->resource;
map = pipe_transfer_map(context, tex,
gptr->level, gptr->face + gptr->zslice,
PIPE_TRANSFER_READ,
PIPE_MAP_READ,
gptr->x, gptr->y, gptr->w, gptr->h, &t);
rbug_send_texture_read_reply(tr_rbug->con, serial,
......
......@@ -1440,7 +1440,7 @@ trace_context_transfer_map(struct pipe_context *_context,
*transfer = trace_transfer_create(tr_context, resource, result);
if (map) {
if (usage & PIPE_TRANSFER_WRITE) {
if (usage & PIPE_MAP_WRITE) {
trace_transfer(*transfer)->map = map;
}
}
......
......@@ -417,7 +417,7 @@ util_font_create_fixed_8x13(struct pipe_context *pipe,
return FALSE;
}
map = pipe_transfer_map(pipe, tex, 0, 0, PIPE_TRANSFER_WRITE, 0, 0,
map = pipe_transfer_map(pipe, tex, 0, 0, PIPE_MAP_WRITE, 0, 0,
tex->width0, tex->height0, &transfer);
if (!map) {
pipe_resource_reference(&tex, NULL);
......
......@@ -130,7 +130,7 @@ util_primconvert_draw_vbo(struct primconvert_context *pc,
src = info->has_user_indices ? info->index.user : NULL;
if (!src) {
src = pipe_buffer_map(pc->pipe, info->index.resource,
PIPE_TRANSFER_READ, &src_transfer);
PIPE_MAP_READ, &src_transfer);
}
src = (const uint8_t *)src;
}
......
......@@ -256,7 +256,7 @@ pp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n,
u_box_2d(0, 0, 165, 165, &box);
ppq->p->pipe->texture_subdata(ppq->p->pipe, ppq->areamaptex, 0,
PIPE_TRANSFER_WRITE, &box,
PIPE_MAP_WRITE, &box,
areamap, 165 * 2, sizeof(areamap));
ppq->shaders[n][1] = pp_tgsi_to_state(ppq->p->pipe, offsetvs, true,
......
......@@ -216,9 +216,9 @@ debug_flush_map(struct debug_flush_buf *fbuf, unsigned flags)
return;
mtx_lock(&fbuf->mutex);
map_sync = !(flags & PIPE_TRANSFER_UNSYNCHRONIZED);
map_sync = !(flags & PIPE_MAP_UNSYNCHRONIZED);
persistent = !map_sync || fbuf->supports_persistent ||
!!(flags & PIPE_TRANSFER_PERSISTENT);
!!(flags & PIPE_MAP_PERSISTENT);
/* Recursive maps are allowed if previous maps are persistent,
* or if the current map is unsync. In other cases we might flush
......
......@@ -115,7 +115,7 @@ debug_dump_surface(struct pipe_context *pipe,
data = pipe_transfer_map(pipe, texture, surface->u.tex.level,
surface->u.tex.first_layer,
PIPE_TRANSFER_READ,
PIPE_MAP_READ,
0, 0, surface->width, surface->height, &transfer);
if (!data)
return;
......@@ -193,7 +193,7 @@ debug_dump_surface_bmp(struct pipe_context *pipe,
void *ptr;
ptr = pipe_transfer_map(pipe, texture, surface->u.tex.level,
surface->u.tex.first_layer, PIPE_TRANSFER_READ,
surface->u.tex.first_layer, PIPE_MAP_READ,
0, 0, surface->width, surface->height, &transfer);
debug_dump_transfer_bmp(pipe, filename, transfer, ptr);
......
......@@ -150,7 +150,7 @@ util_draw_indirect(struct pipe_context *pipe,
uint32_t *dc_param = pipe_buffer_map_range(pipe,
info_in->indirect->indirect_draw_count,
info_in->indirect->indirect_draw_count_offset,
4, PIPE_TRANSFER_READ, &dc_transfer);
4, PIPE_MAP_READ, &dc_transfer);
if (!dc_transfer) {
debug_printf("%s: failed to map indirect draw count buffer\n", __FUNCTION__);
return;
......@@ -167,7 +167,7 @@ util_draw_indirect(struct pipe_context *pipe,
info_in->indirect->buffer,
info_in->indirect->offset,
(num_params * info_in->indirect->draw_count) * sizeof(uint32_t),
PIPE_TRANSFER_READ,
PIPE_MAP_READ,
&transfer);
if (!transfer) {
debug_printf("%s: failed to map indirect buffer\n", __FUNCTION__);
......
......@@ -512,16 +512,16 @@ util_dump_query_value_type(FILE *stream, unsigned value)
static const char * const
util_transfer_usage_names[] = {
"PIPE_TRANSFER_READ",
"PIPE_TRANSFER_WRITE",
"PIPE_TRANSFER_MAP_DIRECTLY",
"PIPE_TRANSFER_DISCARD_RANGE",
"PIPE_TRANSFER_DONTBLOCK",
"PIPE_TRANSFER_UNSYNCHRONIZED",
"PIPE_TRANSFER_FLUSH_EXPLICIT",
"PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE",
"PIPE_TRANSFER_PERSISTENT",
"PIPE_TRANSFER_COHERENT",
"PIPE_MAP_READ",
"PIPE_MAP_WRITE",
"PIPE_MAP_DIRECTLY",
"PIPE_MAP_DISCARD_RANGE",
"PIPE_MAP_DONTBLOCK",
"PIPE_MAP_UNSYNCHRONIZED",
"PIPE_MAP_FLUSH_EXPLICIT",
"PIPE_MAP_DISCARD_WHOLE_RESOURCE",
"PIPE_MAP_PERSISTENT",
"PIPE_MAP_COHERENT",
};
DEFINE_UTIL_DUMP_FLAGS_CONTINUOUS(transfer_usage)
......@@ -43,7 +43,7 @@ void util_shorten_ubyte_elts_to_userptr(struct pipe_context *context,
in_map = info->index.user;
} else {
in_map = pipe_buffer_map(context, info->index.resource,
PIPE_TRANSFER_READ |
PIPE_MAP_READ |
add_transfer_flags,
&src_transfer);
}
......@@ -77,7 +77,7 @@ void util_rebuild_ushort_elts_to_userptr(struct pipe_context *context,
in_map = info->index.user;
} else {
in_map = pipe_buffer_map(context, info->index.resource,
PIPE_TRANSFER_READ |
PIPE_MAP_READ |
add_transfer_flags,
&in_transfer);
}
......@@ -111,7 +111,7 @@ void util_rebuild_uint_elts_to_userptr(struct pipe_context *context,
in_map = info->index.user;
} else {
in_map = pipe_buffer_map(context, info->index.resource,
PIPE_TRANSFER_READ |
PIPE_MAP_READ |
add_transfer_flags,
&in_transfer);
}
......
......@@ -321,7 +321,7 @@ pipe_buffer_create_const0(struct pipe_screen *screen,
* Map a range of a resource.
* \param offset start of region, in bytes
* \param length size of region, in bytes
* \param access bitmask of PIPE_TRANSFER_x flags
* \param access bitmask of PIPE_MAP_x flags
* \param transfer returns a transfer object
*/
static inline void *
......@@ -352,7 +352,7 @@ pipe_buffer_map_range(struct pipe_context *pipe,
/**
* Map whole resource.
* \param access bitmask of PIPE_TRANSFER_x flags
* \param access bitmask of PIPE_MAP_x flags
* \param transfer returns a transfer object
*/
static inline void *
......@@ -405,7 +405,7 @@ pipe_buffer_write(struct pipe_context *pipe,
const void *data)
{
/* Don't set any other usage bits. Drivers should derive them. */
pipe->buffer_subdata(pipe, buf, PIPE_TRANSFER_WRITE, offset, size, data);
pipe->buffer_subdata(pipe, buf, PIPE_MAP_WRITE, offset, size, data);
}
/**
......@@ -421,8 +421,8 @@ pipe_buffer_write_nooverlap(struct pipe_context *pipe,
const void *data)
{
pipe->buffer_subdata(pipe, buf,
(PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_UNSYNCHRONIZED),
(PIPE_MAP_WRITE |
PIPE_MAP_UNSYNCHRONIZED),
offset, size, data);
}
......@@ -458,7 +458,7 @@ pipe_buffer_read(struct pipe_context *pipe,
map = (ubyte *) pipe_buffer_map_range(pipe,
buf,
offset, size,
PIPE_TRANSFER_READ,
PIPE_MAP_READ,
&src_transfer);
if (!map)
return;
......@@ -470,7 +470,7 @@ pipe_buffer_read(struct pipe_context *pipe,
/**
* Map a resource for reading/writing.
* \param access bitmask of PIPE_TRANSFER_x flags
* \param access bitmask of PIPE_MAP_x flags
*/
static inline void *
pipe_transfer_map(struct pipe_context *context,
......@@ -493,7 +493,7 @@ pipe_transfer_map(struct pipe_context *context,
/**
* Map a 3D (texture) resource for reading/writing.
* \param access bitmask of PIPE_TRANSFER_x flags
* \param access bitmask of PIPE_MAP_x flags
*/
static inline void *
pipe_transfer_map_3d(struct pipe_context *context,
......
......@@ -49,7 +49,7 @@ read_indirect_elements(struct pipe_context *context, struct pipe_draw_indirect_i
map = pipe_buffer_map_range(context, indirect->buffer,
indirect->offset,
read_size,
PIPE_TRANSFER_READ,
PIPE_MAP_READ,
&transfer);
assert(map);
memcpy(&ret, map, read_size);
......@@ -129,7 +129,7 @@ util_translate_prim_restart_ib(struct pipe_context *context,
/* Map new / dest index buffer */
dst_map = pipe_buffer_map(context, *dst_buffer,
PIPE_TRANSFER_WRITE, &dst_transfer);
PIPE_MAP_WRITE, &dst_transfer);
if (!dst_map)
goto error;
......@@ -140,7 +140,7 @@ util_translate_prim_restart_ib(struct pipe_context *context,
src_map = pipe_buffer_map_range(context, info->index.resource,
start * src_index_size,
count * src_index_size,
PIPE_TRANSFER_READ,
PIPE_MAP_READ,
&src_transfer);
if (!src_map)
goto error;
......@@ -248,7 +248,7 @@ util_draw_vbo_without_prim_restart(struct pipe_context *context,
src_map = pipe_buffer_map_range(context, info->index.resource,
info_start * info->index_size,
info_count * info->index_size,
PIPE_TRANSFER_READ,
PIPE_MAP_READ,
&src_transfer);
if (!src_map) {
return PIPE_ERROR_OUT_OF_MEMORY;
......
......@@ -70,7 +70,7 @@ util_pstipple_update_stipple_texture(struct pipe_context *pipe,
/* map texture memory */
data = pipe_transfer_map(pipe, tex, 0, 0,
PIPE_TRANSFER_WRITE, 0, 0, 32, 32, &transfer);
PIPE_MAP_WRITE, 0, 0, 32, 32, &transfer);
/*
* Load alpha texture.
......
......@@ -131,7 +131,7 @@ u_suballocator_alloc(struct u_suballocator *allocator, unsigned size,
} else {
struct pipe_transfer *transfer = NULL;
void *ptr = pipe_buffer_map(pipe, allocator->buffer,
PIPE_TRANSFER_WRITE, &transfer);
PIPE_MAP_WRITE, &transfer);
memset(ptr, 0, allocator->size);
pipe_buffer_unmap(pipe, transfer);
}
......
......@@ -285,7 +285,7 @@ util_resource_copy_region(struct pipe_context *pipe,
src_map = pipe->transfer_map(pipe,
src,
src_level,
PIPE_TRANSFER_READ,
PIPE_MAP_READ,
&src_box, &src_trans);
assert(src_map);
if (!src_map) {
......@@ -295,8 +295,8 @@ util_resource_copy_region(struct pipe_context *pipe,
dst_map = pipe->transfer_map(pipe,
dst,
dst_level,
PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_DISCARD_RANGE, &dst_box,
PIPE_MAP_WRITE |
PIPE_MAP_DISCARD_RANGE, &dst_box,
&dst_trans);
assert(dst_map);
if (!dst_map) {
......@@ -358,7 +358,7 @@ util_clear_color_texture(struct pipe_context *pipe,
dst_map = pipe_transfer_map_3d(pipe,
texture,
level,
PIPE_TRANSFER_WRITE,
PIPE_MAP_WRITE,
dstx, dsty, dstz,
width, height, depth,
&dst_trans);
......@@ -410,7 +410,7 @@ util_clear_render_target(struct pipe_context *pipe,
dst_map = pipe_transfer_map(pipe,
dst->texture,
0, 0,
PIPE_TRANSFER_WRITE,
PIPE_MAP_WRITE,
dx, 0, w, 1,
&dst_trans);
if (dst_map) {
......@@ -561,8 +561,8 @@ util_clear_depth_stencil_texture(struct pipe_context *pipe,
dst_map = pipe_transfer_map_3d(pipe,
texture,
level,
(need_rmw ? PIPE_TRANSFER_READ_WRITE :
PIPE_TRANSFER_WRITE),
(need_rmw ? PIPE_MAP_READ_WRITE :
PIPE_MAP_WRITE),
dstx, dsty, dstz,
width, height, depth, &dst_trans);
assert(dst_map);
......
......@@ -227,7 +227,7 @@ util_probe_rect_rgba_multi(struct pipe_context *ctx, struct pipe_resource *tex,
unsigned x,y,e,c;
bool pass = true;
map = pipe_transfer_map(ctx, tex, 0, 0, PIPE_TRANSFER_READ,
map = pipe_transfer_map(ctx, tex, 0, 0, PIPE_MAP_READ,
offx, offy, w, h, &transfer);
pipe_get_tile_rgba(transfer, map, 0, 0, w, h, tex->format, pixels);
pipe_transfer_unmap(ctx, transfer);
......
......@@ -1359,17 +1359,17 @@ tc_improve_map_buffer_flags(struct threaded_context *tc,
return usage;
/* Use the staging upload if it's preferred. */
if (usage & (PIPE_TRANSFER_DISCARD_RANGE |
PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE) &&
!(usage & PIPE_TRANSFER_PERSISTENT) &&
if (usage & (PIPE_MAP_DISCARD_RANGE |
PIPE_MAP_DISCARD_WHOLE_RESOURCE) &&
!(usage & PIPE_MAP_PERSISTENT) &&
/* Try not to decrement the counter if it's not positive. Still racy,
* but it makes it harder to wrap the counter from INT_MIN to INT_MAX. */
tres->max_forced_staging_uploads > 0 &&
p_atomic_dec_return(&tres->max_forced_staging_uploads) >= 0) {
usage &= ~(PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE |
PIPE_TRANSFER_UNSYNCHRONIZED);
usage &= ~(PIPE_MAP_DISCARD_WHOLE_RESOURCE |
PIPE_MAP_UNSYNCHRONIZED);
return usage | tc_flags | PIPE_TRANSFER_DISCARD_RANGE;
return usage | tc_flags | PIPE_MAP_DISCARD_RANGE;
}
/* Sparse buffers can't be mapped directly and can't be reallocated
......@@ -1380,8 +1380,8 @@ tc_improve_map_buffer_flags(struct threaded_context *tc,
/* We can use DISCARD_RANGE instead of full discard. This is the only
* fast path for sparse buffers that doesn't need thread synchronization.
*/
if (usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE)
usage |= PIPE_TRANSFER_DISCARD_RANGE;
if (usage & PIPE_MAP_DISCARD_WHOLE_RESOURCE)
usage |= PIPE_MAP_DISCARD_RANGE;
/* Allow DISCARD_WHOLE_RESOURCE and infering UNSYNCHRONIZED in drivers.
* The threaded context doesn't do unsychronized mappings and invalida-
......@@ -1394,50 +1394,50 @@ tc_improve_map_buffer_flags(struct threaded_context *tc,
usage |= tc_flags;
/* Handle CPU reads trivially. */
if (usage & PIPE_TRANSFER_READ) {
if (usage & PIPE_TRANSFER_UNSYNCHRONIZED)
if (usage & PIPE_MAP_READ) {
if (usage & PIPE_MAP_UNSYNCHRONIZED)
usage |= TC_TRANSFER_MAP_THREADED_UNSYNC; /* don't sync */
/* Drivers aren't allowed to do buffer invalidations. */
return usage & ~PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
return usage & ~PIPE_MAP_DISCARD_WHOLE_RESOURCE;
}
/* See if the buffer range being mapped has never been initialized,
* in which case it can be mapped unsynchronized. */
if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED) &&
if (!(usage & PIPE_MAP_UNSYNCHRONIZED) &&
!tres->is_shared &&
!util_ranges_intersect(&tres->valid_buffer_range, offset, offset + size))
usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
usage |= PIPE_MAP_UNSYNCHRONIZED;
if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED)) {
if (!(usage & PIPE_MAP_UNSYNCHRONIZED)) {
/* If discarding the entire range, discard the whole resource instead. */
if (usage & PIPE_TRANSFER_DISCARD_RANGE &&
if (usage & PIPE_MAP_DISCARD_RANGE &&
offset == 0 && size == tres->b.width0)
usage |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
usage |= PIPE_MAP_DISCARD_WHOLE_RESOURCE;
/* Discard the whole resource if needed. */
if (usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE) {
if (usage & PIPE_MAP_DISCARD_WHOLE_RESOURCE) {
if (tc_invalidate_buffer(tc, tres))
usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
usage |= PIPE_MAP_UNSYNCHRONIZED;
else
usage |= PIPE_TRANSFER_DISCARD_RANGE; /* fallback */
usage |= PIPE_MAP_DISCARD_RANGE; /* fallback */
}
}
/* We won't need this flag anymore. */
/* TODO: We might not need TC_TRANSFER_MAP_NO_INVALIDATE with this. */
usage &= ~PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
usage &= ~PIPE_MAP_DISCARD_WHOLE_RESOURCE;
/* GL_AMD_pinned_memory and persistent mappings can't use staging
* buffers. */
if (usage & (PIPE_TRANSFER_UNSYNCHRONIZED |
PIPE_TRANSFER_PERSISTENT) ||
if (usage & (PIPE_MAP_UNSYNCHRONIZED |
PIPE_MAP_PERSISTENT) ||
tres->is_user_ptr)
usage &= ~PIPE_TRANSFER_DISCARD_RANGE;
usage &= ~PIPE_MAP_DISCARD_RANGE;
/* Unsychronized buffer mappings don't have to synchronize the thread. */
if (usage & PIPE_TRANSFER_UNSYNCHRONIZED) {
usage &= ~PIPE_TRANSFER_DISCARD_RANGE;
if (usage & PIPE_MAP_UNSYNCHRONIZED) {
usage &= ~PIPE_MAP_DISCARD_RANGE;
usage |= TC_TRANSFER_MAP_THREADED_UNSYNC; /* notify the driver */
}
......@@ -1460,7 +1460,7 @@ tc_transfer_map(struct pipe_context *_pipe,
/* Do a staging transfer within the threaded context. The driver should
* only get resource_copy_region.
*/
if (usage & PIPE_TRANSFER_DISCARD_RANGE) {
if (usage & PIPE_MAP_DISCARD_RANGE) {
struct threaded_transfer *ttrans = slab_alloc(&tc->pool_transfers);
uint8_t *map;
......@@ -1488,8 +1488,8 @@ tc_transfer_map(struct pipe_context *_pipe,
/* Unsychronized buffer mappings don't have to synchronize the thread. */
if (!(usage & TC_TRANSFER_MAP_THREADED_UNSYNC))
tc_sync_msg(tc, resource->target != PIPE_BUFFER ? " texture" :
usage & PIPE_TRANSFER_DISCARD_RANGE ? " discard_range" :
usage & PIPE_TRANSFER_READ ? " read" : " ??");
usage & PIPE_MAP_DISCARD_RANGE ? " discard_range" :
usage & PIPE_MAP_READ ? " read" : " ??");
tc->bytes_mapped_estimate += box->width;
......@@ -1559,8 +1559,8 @@ tc_transfer_flush_region(struct pipe_context *_pipe,
struct threaded_context *tc = threaded_context(_pipe);
struct threaded_transfer *ttrans = threaded_transfer(transfer);
struct threaded_resource *tres = threaded_resource(transfer->resource);
unsigned required_usage = PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_FLUSH_EXPLICIT;
unsigned required_usage = PIPE_MAP_WRITE |
PIPE_MAP_FLUSH_EXPLICIT;
if (tres->b.target == PIPE_BUFFER) {
if ((transfer->usage & required_usage) == required_usage) {
......@@ -1599,13 +1599,13 @@ tc_transfer_unmap(struct pipe_context *_pipe, struct pipe_transfer *transfer)
struct threaded_transfer *ttrans = threaded_transfer(transfer);
struct threaded_resource *tres = threaded_resource(transfer->resource);
/* PIPE_TRANSFER_THREAD_SAFE is only valid with UNSYNCHRONIZED. It can be
/* PIPE_MAP_THREAD_SAFE is only valid with UNSYNCHRONIZED. It can be
* called from any thread and bypasses all multithreaded queues.
*/
if (transfer->usage & PIPE_TRANSFER_THREAD_SAFE) {
assert(transfer->usage & PIPE_TRANSFER_UNSYNCHRONIZED);
assert(!(transfer->usage & (PIPE_TRANSFER_FLUSH_EXPLICIT |
PIPE_TRANSFER_DISCARD_RANGE)));
if (transfer->usage & PIPE_MAP_THREAD_SAFE) {
assert(transfer->usage & PIPE_MAP_UNSYNCHRONIZED);
assert(!(transfer->usage & (PIPE_MAP_FLUSH_EXPLICIT |
PIPE_MAP_DISCARD_RANGE)));
struct pipe_context *pipe = tc->pipe;
pipe->transfer_unmap(pipe, transfer);
......@@ -1615,8 +1615,8 @@ tc_transfer_unmap(struct pipe_context *_pipe, struct pipe_transfer *transfer)
}
if (tres->b.target == PIPE_BUFFER) {