virgl: simplify virgl_texture_transfer_unmap logic
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 4 Apr 2019 14:50:18 +0000 (16:50 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 17 Apr 2019 07:27:08 +0000 (07:27 +0000)
There's no reason to keep an extra indentation level here, let's merge
the two if-conditions.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
src/gallium/drivers/virgl/virgl_texture.c

index 4d938ca1e0d62bfe4e3d28bb5d1c60d90b0bacbb..a17c0941282b4363d75f2035ec6743ac446d279f 100644 (file)
@@ -174,19 +174,15 @@ static void virgl_texture_transfer_unmap(struct pipe_context *ctx,
    struct virgl_transfer *trans = virgl_transfer(transfer);
    struct virgl_resource *vtex = virgl_resource(transfer->resource);
 
-   if (trans->base.usage & PIPE_TRANSFER_WRITE) {
-      if (!(transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT)) {
-         struct virgl_screen *vs = virgl_screen(ctx->screen);
-
-         if (trans->resolve_tmp) {
-            vs->vws->transfer_put(vs->vws, vtex->hw_res,
-                                  &transfer->box, trans->base.stride,
-                                  trans->l_stride, trans->offset,
-                                  transfer->level);
-         } else {
-            virgl_transfer_queue_unmap(&vctx->queue, trans);
-         }
-      }
+   if (transfer->usage & PIPE_TRANSFER_WRITE &&
+       (transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT) == 0) {
+      if (trans->resolve_tmp) {
+         struct virgl_winsys *vws = virgl_screen(ctx->screen)->vws;
+         vws->transfer_put(vws, vtex->hw_res, &transfer->box,
+                           trans->base.stride, trans->l_stride,
+                           trans->offset, transfer->level);
+      } else
+         virgl_transfer_queue_unmap(&vctx->queue, trans);
    }
 
    if (trans->resolve_tmp) {