gallium: rename pipe_transfer_usage -> pipe_map_flags

Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5749>
This commit is contained in:
Marek Olšák 2020-07-01 08:21:38 -04:00 committed by Marge Bot
parent 22253e6b65
commit 3586068557
19 changed files with 26 additions and 26 deletions

View File

@ -1813,7 +1813,7 @@ iris_map_direct(struct iris_transfer *map)
static bool
can_promote_to_async(const struct iris_resource *res,
const struct pipe_box *box,
enum pipe_transfer_usage usage)
enum pipe_map_flags usage)
{
/* If we're writing to a section of the buffer that hasn't even been
* initialized with useful data, then we can safely promote this write
@ -1829,7 +1829,7 @@ static void *
iris_transfer_map(struct pipe_context *ctx,
struct pipe_resource *resource,
unsigned level,
enum pipe_transfer_usage usage,
enum pipe_map_flags usage,
const struct pipe_box *box,
struct pipe_transfer **ptransfer)
{

View File

@ -314,7 +314,7 @@ struct radeon_winsys {
* \return The pointer at the beginning of the buffer.
*/
void *(*buffer_map)(struct pb_buffer *buf, struct radeon_cmdbuf *cs,
enum pipe_transfer_usage usage);
enum pipe_map_flags usage);
/**
* Unmap a buffer object from the client's address space.

View File

@ -134,7 +134,7 @@ swr_transfer_map(struct pipe_context *pipe,
if (!pt)
return NULL;
pipe_resource_reference(&pt->resource, resource);
pt->usage = (pipe_transfer_usage)usage;
pt->usage = (pipe_map_flags)usage;
pt->level = level;
pt->box = *box;
pt->stride = spr->swr.pitch;

View File

@ -1558,7 +1558,7 @@ dri2_map_image(__DRIcontext *context, __DRIimage *image,
{
struct dri_context *ctx = dri_context(context);
struct pipe_context *pipe = ctx->st->pipe;
enum pipe_transfer_usage pipe_access = 0;
enum pipe_map_flags pipe_access = 0;
struct pipe_resource *resource = image->texture;
struct pipe_transfer *trans;
void *map;

View File

@ -104,7 +104,7 @@ xa_surface_dma(struct xa_context *ctx,
struct pipe_transfer *transfer;
void *map;
int w, h, i;
enum pipe_transfer_usage transfer_direction;
enum pipe_map_flags transfer_direction;
struct pipe_context *pipe = ctx->pipe;
transfer_direction = (to_surface ? PIPE_MAP_WRITE :

View File

@ -232,9 +232,9 @@ enum pipe_tex_compare {
#define PIPE_CLEAR_DEPTHSTENCIL (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)
/**
* Transfer object usage flags
* CPU access map flags
*/
enum pipe_transfer_usage
enum pipe_map_flags
{
/**
* Resource contents read back (or accessed directly) at transfer

View File

@ -586,7 +586,7 @@ struct pipe_transfer
{
struct pipe_resource *resource; /**< resource to transfer to/from */
unsigned level; /**< texture mipmap level */
enum pipe_transfer_usage usage;
enum pipe_map_flags usage;
struct pipe_box box; /**< region of the resource to access */
unsigned stride; /**< row stride in bytes */
unsigned layer_stride; /**< image/layer stride in bytes */

View File

@ -270,7 +270,7 @@ static bool amdgpu_bo_do_map(struct amdgpu_winsys_bo *bo, void **cpu)
void *amdgpu_bo_map(struct pb_buffer *buf,
struct radeon_cmdbuf *rcs,
enum pipe_transfer_usage usage)
enum pipe_map_flags usage)
{
struct amdgpu_winsys_bo *bo = (struct amdgpu_winsys_bo*)buf;
struct amdgpu_winsys_bo *real;

View File

@ -133,7 +133,7 @@ struct pb_buffer *amdgpu_bo_create(struct amdgpu_winsys *ws,
void amdgpu_bo_destroy(struct pb_buffer *_buf);
void *amdgpu_bo_map(struct pb_buffer *buf,
struct radeon_cmdbuf *rcs,
enum pipe_transfer_usage usage);
enum pipe_map_flags usage);
void amdgpu_bo_unmap(struct pb_buffer *buf);
void amdgpu_bo_init_functions(struct amdgpu_screen_winsys *ws);

View File

@ -498,7 +498,7 @@ void *radeon_bo_do_map(struct radeon_bo *bo)
static void *radeon_bo_map(struct pb_buffer *buf,
struct radeon_cmdbuf *rcs,
enum pipe_transfer_usage usage)
enum pipe_map_flags usage)
{
struct radeon_bo *bo = (struct radeon_bo*)buf;
struct radeon_drm_cs *cs = (struct radeon_drm_cs*)rcs;

View File

@ -354,7 +354,7 @@ vmw_svga_winsys_buffer_destroy(struct svga_winsys_screen *sws,
void *
vmw_svga_winsys_buffer_map(struct svga_winsys_screen *sws,
struct svga_winsys_buffer *buf,
enum pipe_transfer_usage flags)
enum pipe_map_flags flags)
{
void *map;

View File

@ -310,7 +310,7 @@ gbm_bo_import(struct gbm_device *gbm, uint32_t type,
* These flags are independent of the GBM_BO_USE_* creation flags. However,
* mapping the buffer may require copying to/from a staging buffer.
*
* See also: pipe_transfer_usage
* See also: pipe_map_flags
*/
enum gbm_bo_transfer_flags {
/**

View File

@ -453,13 +453,13 @@ st_bufferobj_invalidate(struct gl_context *ctx,
/**
* Convert GLbitfield of GL_MAP_x flags to gallium pipe_transfer_usage flags.
* Convert GLbitfield of GL_MAP_x flags to gallium pipe_map_flags flags.
* \param wholeBuffer is the whole buffer being mapped?
*/
enum pipe_transfer_usage
enum pipe_map_flags
st_access_flags_to_transfer_flags(GLbitfield access, bool wholeBuffer)
{
enum pipe_transfer_usage flags = 0;
enum pipe_map_flags flags = 0;
if (access & GL_MAP_WRITE_BIT)
flags |= PIPE_MAP_WRITE;
@ -518,7 +518,7 @@ st_bufferobj_map_range(struct gl_context *ctx,
assert(offset < obj->Size);
assert(offset + length <= obj->Size);
const enum pipe_transfer_usage transfer_flags =
const enum pipe_map_flags transfer_flags =
st_access_flags_to_transfer_flags(access,
offset == 0 && length == obj->Size);

View File

@ -55,7 +55,7 @@ st_buffer_object(struct gl_buffer_object *obj)
}
enum pipe_transfer_usage
enum pipe_map_flags
st_access_flags_to_transfer_flags(GLbitfield access, bool wholeBuffer);

View File

@ -1052,7 +1052,7 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
struct st_context *st = st_context(ctx);
struct pipe_context *pipe = st->pipe;
struct st_renderbuffer *strb;
enum pipe_transfer_usage usage;
enum pipe_map_flags usage;
struct pipe_transfer *pt;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
ubyte *stmap;
@ -1538,7 +1538,7 @@ copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
{
struct st_renderbuffer *rbDraw;
struct pipe_context *pipe = st_context(ctx)->pipe;
enum pipe_transfer_usage usage;
enum pipe_map_flags usage;
struct pipe_transfer *ptDraw;
ubyte *drawMap;
ubyte *buffer;

View File

@ -893,7 +893,7 @@ st_MapRenderbuffer(struct gl_context *ctx,
GL_MAP_WRITE_BIT |
GL_MAP_INVALIDATE_RANGE_BIT)) == 0);
const enum pipe_transfer_usage transfer_flags =
const enum pipe_map_flags transfer_flags =
st_access_flags_to_transfer_flags(mode, false);
/* Note: y=0=bottom of buffer while y2=0=top of buffer.

View File

@ -318,7 +318,7 @@ st_MapTextureImage(struct gl_context *ctx,
GL_MAP_WRITE_BIT |
GL_MAP_INVALIDATE_RANGE_BIT)) == 0);
const enum pipe_transfer_usage transfer_flags =
const enum pipe_map_flags transfer_flags =
st_access_flags_to_transfer_flags(mode, false);
map = st_texture_image_map(st, stImage, transfer_flags, x, y, slice, w, h, 1,
@ -2319,7 +2319,7 @@ fallback_copy_texsubimage(struct gl_context *ctx,
struct pipe_context *pipe = st->pipe;
struct pipe_transfer *src_trans;
GLubyte *texDest;
enum pipe_transfer_usage transfer_usage;
enum pipe_map_flags transfer_usage;
void *map;
unsigned dst_width = width;
unsigned dst_height = height;

View File

@ -247,7 +247,7 @@ st_texture_match_image(struct st_context *st,
*/
GLubyte *
st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
enum pipe_transfer_usage usage,
enum pipe_map_flags usage,
GLuint x, GLuint y, GLuint z,
GLuint w, GLuint h, GLuint d,
struct pipe_transfer **transfer)

View File

@ -294,7 +294,7 @@ st_texture_match_image(struct st_context *st,
*/
extern GLubyte *
st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
enum pipe_transfer_usage usage,
enum pipe_map_flags usage,
GLuint x, GLuint y, GLuint z,
GLuint w, GLuint h, GLuint d,
struct pipe_transfer **transfer);