Mesa (master): virgl: track full virgl_resource instead of just virgl_hw_res

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 17 07:41:24 UTC 2019


Module: Mesa
Branch: master
Commit: 7dd601a39911d8c3d0b3592ce5a24a45857b9c3b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7dd601a39911d8c3d0b3592ce5a24a45857b9c3b

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Thu Apr  4 12:19:44 2019 +0200

virgl: track full virgl_resource instead of just virgl_hw_res

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh at chromium.org>

---

 src/gallium/drivers/virgl/virgl_texture.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index 8ca34537a5a..4d938ca1e0d 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -117,10 +117,10 @@ 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_resource *vtex = virgl_resource(resource);
+   struct virgl_resource *src_res;
    struct virgl_transfer *trans;
    void *ptr;
    boolean readback = TRUE;
-   struct virgl_hw_res *hw_res;
    bool flush;
 
    trans = virgl_resource_create_transfer(&vctx->transfer_pool, resource,
@@ -139,25 +139,25 @@ static void *virgl_texture_transfer_map(struct pipe_context *ctx,
       virgl_copy_region_with_blit(ctx, &trans->resolve_tmp->u.b, 0, 0, 0, 0, resource, level, box);
       ctx->flush(ctx, NULL, 0);
       /* we want to do a resolve blit into the temporary */
-      hw_res = trans->resolve_tmp->hw_res;
+      src_res = trans->resolve_tmp;
       struct virgl_resource_metadata *data = &trans->resolve_tmp->metadata;
       trans->base.stride = data->stride[level];
       trans->base.layer_stride = data->layer_stride[level];
       trans->offset = 0;
    } else {
-      hw_res = vtex->hw_res;
+      src_res = vtex;
       trans->resolve_tmp = NULL;
    }
 
    readback = virgl_res_needs_readback(vctx, vtex, usage, level);
    if (readback) {
-      vs->vws->transfer_get(vs->vws, hw_res, box, trans->base.stride,
+      vs->vws->transfer_get(vs->vws, src_res->hw_res, box, trans->base.stride,
                             trans->l_stride, trans->offset, level);
 
       vs->vws->resource_wait(vs->vws, vtex->hw_res);
    }
 
-   ptr = vs->vws->resource_map(vs->vws, hw_res);
+   ptr = vs->vws->resource_map(vs->vws, src_res->hw_res);
    if (!ptr) {
       virgl_resource_destroy_transfer(&vctx->transfer_pool, trans);
       return NULL;




More information about the mesa-commit mailing list