Mesa (main): panfrost: Make pan_blit() return the tiler job pointer
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Aug 26 09:08:47 UTC 2021
Module: Mesa
Branch: main
Commit: 587046ed251e395d6153d13a3419615364f06029
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=587046ed251e395d6153d13a3419615364f06029
Author: Boris Brezillon <boris.brezillon at collabora.com>
Date: Fri May 7 12:33:14 2021 +0200
panfrost: Make pan_blit() return the tiler job pointer
The Vulkan driver needs to patch job headers when re-issueing a command
buffer. Return the tiler job pointer to allow that.
Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12552>
---
src/panfrost/lib/pan_blitter.c | 30 ++++++++++++++++++------------
src/panfrost/lib/pan_blitter.h | 2 +-
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/src/panfrost/lib/pan_blitter.c b/src/panfrost/lib/pan_blitter.c
index 641e2966801..8a28e64e83f 100644
--- a/src/panfrost/lib/pan_blitter.c
+++ b/src/panfrost/lib/pan_blitter.c
@@ -1159,7 +1159,7 @@ pan_preload_emit_midgard_tiler_job(struct pan_pool *desc_pool,
false, false, 0, 0, &job, true);
}
-static void
+static struct panfrost_ptr
pan_blit_emit_midgard_tiler_job(struct pan_pool *desc_pool,
struct pan_scoreboard *scoreboard,
mali_ptr src_coords, mali_ptr dst_coords,
@@ -1192,9 +1192,10 @@ pan_blit_emit_midgard_tiler_job(struct pan_pool *desc_pool,
panfrost_add_job(desc_pool, scoreboard, MALI_JOB_TYPE_TILER,
false, false, 0, 0, &job, false);
+ return job;
}
-static void
+static struct panfrost_ptr
pan_blit_emit_bifrost_tiler_job(struct pan_pool *desc_pool,
struct pan_scoreboard *scoreboard,
mali_ptr src_coords, mali_ptr dst_coords,
@@ -1233,6 +1234,7 @@ pan_blit_emit_bifrost_tiler_job(struct pan_pool *desc_pool,
panfrost_add_job(desc_pool, scoreboard, MALI_JOB_TYPE_TILER,
false, false, 0, 0, &job, false);
+ return job;
}
static void
@@ -1483,14 +1485,14 @@ pan_blit_next_surface(struct pan_blit_context *ctx)
return true;
}
-void
+struct panfrost_ptr
pan_blit(struct pan_blit_context *ctx,
struct pan_pool *pool,
struct pan_scoreboard *scoreboard,
mali_ptr tsd, mali_ptr tiler)
{
if (ctx->dst.cur_layer < 0 || ctx->dst.cur_layer > ctx->dst.last_layer)
- return;
+ return (struct panfrost_ptr){ 0 };
int32_t layer = ctx->dst.cur_layer - ctx->dst.layer_offset;
float src_z;
@@ -1510,17 +1512,21 @@ pan_blit(struct pan_blit_context *ctx,
pan_pool_upload_aligned(pool, src_rect,
sizeof(src_rect), 64);
+ struct panfrost_ptr job;
+
if (pan_is_bifrost(pool->dev)) {
- pan_blit_emit_bifrost_tiler_job(pool, scoreboard,
- src_coords, ctx->position,
- ctx->textures, ctx->samplers,
- ctx->vpd, ctx->rsd, tsd, tiler);
+ job = pan_blit_emit_bifrost_tiler_job(pool, scoreboard,
+ src_coords, ctx->position,
+ ctx->textures, ctx->samplers,
+ ctx->vpd, ctx->rsd, tsd, tiler);
} else {
- pan_blit_emit_midgard_tiler_job(pool, scoreboard,
- src_coords, ctx->position,
- ctx->textures, ctx->samplers,
- ctx->vpd, ctx->rsd, tsd);
+ job = pan_blit_emit_midgard_tiler_job(pool, scoreboard,
+ src_coords, ctx->position,
+ ctx->textures, ctx->samplers,
+ ctx->vpd, ctx->rsd, tsd);
}
+
+ return job;
}
static uint32_t pan_blit_shader_key_hash(const void *key)
diff --git a/src/panfrost/lib/pan_blitter.h b/src/panfrost/lib/pan_blitter.h
index 0f8cbb7a482..f3380ee1ea8 100644
--- a/src/panfrost/lib/pan_blitter.h
+++ b/src/panfrost/lib/pan_blitter.h
@@ -102,7 +102,7 @@ pan_blit_ctx_init(struct panfrost_device *dev,
bool
pan_blit_next_surface(struct pan_blit_context *ctx);
-void
+struct panfrost_ptr
pan_blit(struct pan_blit_context *ctx,
struct pan_pool *pool,
struct pan_scoreboard *scoreboard,
More information about the mesa-commit
mailing list