vrend: simplify vrend_renderer_resource_get_map_info

VIRGL_RENDERER_MAP_CACHE_NONE is valid internally.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Isaac Bosompem <mrisaacb@google.com>
macos/master
Chia-I Wu 4 years ago
parent e1eb18ab91
commit 4215cb7aa7
  1. 8
      src/virglrenderer.c
  2. 8
      src/vrend_renderer.c
  3. 2
      src/vrend_renderer.h

@ -774,7 +774,13 @@ int virgl_renderer_resource_get_map_info(uint32_t res_handle, uint32_t *map_info
if (!res || !res->pipe_resource) if (!res || !res->pipe_resource)
return -EINVAL; return -EINVAL;
return vrend_renderer_resource_get_map_info(res->pipe_resource, map_info); uint32_t info = vrend_renderer_resource_get_map_info(res->pipe_resource);
if ((info & VIRGL_RENDERER_MAP_CACHE_MASK) ==
VIRGL_RENDERER_MAP_CACHE_NONE)
return -EINVAL;
*map_info = info;
return 0;
} }
int int

@ -10638,14 +10638,10 @@ struct pipe_resource *vrend_get_blob_pipe(struct vrend_context *ctx, uint64_t bl
return NULL; return NULL;
} }
int vrend_renderer_resource_get_map_info(struct pipe_resource *pres, uint32_t *map_info) uint32_t vrend_renderer_resource_get_map_info(struct pipe_resource *pres)
{ {
struct vrend_resource *res = (struct vrend_resource *)pres; struct vrend_resource *res = (struct vrend_resource *)pres;
if (!res->map_info) return res->map_info;
return -EINVAL;
*map_info = res->map_info;
return 0;
} }
int vrend_renderer_resource_map(struct pipe_resource *pres, void **map, uint64_t *out_size) int vrend_renderer_resource_map(struct pipe_resource *pres, void **map, uint64_t *out_size)

@ -492,7 +492,7 @@ vrend_renderer_pipe_resource_create(struct vrend_context *ctx, uint32_t blob_id,
struct pipe_resource *vrend_get_blob_pipe(struct vrend_context *ctx, uint64_t blob_id); struct pipe_resource *vrend_get_blob_pipe(struct vrend_context *ctx, uint64_t blob_id);
int vrend_renderer_resource_get_map_info(struct pipe_resource *pres, uint32_t *map_info); uint32_t vrend_renderer_resource_get_map_info(struct pipe_resource *pres);
int vrend_renderer_resource_map(struct pipe_resource *pres, void **map, uint64_t *out_size); int vrend_renderer_resource_map(struct pipe_resource *pres, void **map, uint64_t *out_size);

Loading…
Cancel
Save