summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_texture.c
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2015-10-28 11:14:02 +0000
committerEmil Velikov <[email protected]>2015-10-30 17:37:09 +0000
commit7af46b9c747cbd503a2b97f00f1c603f1b75aaff (patch)
tree0970fb5071007a6b88d7448841b11a2a85450e8d /src/gallium/drivers/virgl/virgl_texture.c
parent6b123fa07ff9d73d6e67416c2372eab5c17282b6 (diff)
virgl: introduce and use virgl_transfer/texture/resource inline wrappers
The only two remaining cases of (struct virgl_resource *) require a closer look. Either the error checking is missing or the arguments provided feel wrong. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_texture.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_texture.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index 1838fdf4798..ebc4755f8b0 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -126,7 +126,7 @@ static void *virgl_texture_transfer_map(struct pipe_context *ctx,
{
struct virgl_context *vctx = virgl_context(ctx);
struct virgl_screen *vs = virgl_screen(ctx->screen);
- struct virgl_texture *vtex = (struct virgl_texture *)resource;
+ struct virgl_texture *vtex = virgl_texture(resource);
enum pipe_format format = resource->format;
struct virgl_transfer *trans;
void *ptr;
@@ -206,8 +206,8 @@ static void virgl_texture_transfer_unmap(struct pipe_context *ctx,
struct pipe_transfer *transfer)
{
struct virgl_context *vctx = virgl_context(ctx);
- struct virgl_transfer *trans = (struct virgl_transfer *)transfer;
- struct virgl_texture *vtex = (struct virgl_texture *)transfer->resource;
+ struct virgl_transfer *trans = virgl_transfer(transfer);
+ struct virgl_texture *vtex = virgl_texture(transfer->resource);
uint32_t l_stride;
if (transfer->resource->target != PIPE_TEXTURE_3D &&
@@ -281,7 +281,7 @@ static boolean virgl_texture_get_handle(struct pipe_screen *screen,
struct winsys_handle *whandle)
{
struct virgl_screen *vs = virgl_screen(screen);
- struct virgl_texture *vtex = (struct virgl_texture *)ptex;
+ struct virgl_texture *vtex = virgl_texture(ptex);
return vs->vws->resource_get_handle(vs->vws, vtex->base.hw_res, vtex->stride[0], whandle);
}
@@ -290,7 +290,7 @@ static void virgl_texture_destroy(struct pipe_screen *screen,
struct pipe_resource *res)
{
struct virgl_screen *vs = virgl_screen(screen);
- struct virgl_texture *vtex = (struct virgl_texture *)res;
+ struct virgl_texture *vtex = virgl_texture(res);
vs->vws->resource_unref(vs->vws, vtex->base.hw_res);
FREE(vtex);
}