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@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12552>
This commit is contained in:
parent
e466e0ecd2
commit
587046ed25
|
@ -1159,7 +1159,7 @@ pan_preload_emit_midgard_tiler_job(struct pan_pool *desc_pool,
|
||||||
false, false, 0, 0, &job, true);
|
false, false, 0, 0, &job, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static struct panfrost_ptr
|
||||||
pan_blit_emit_midgard_tiler_job(struct pan_pool *desc_pool,
|
pan_blit_emit_midgard_tiler_job(struct pan_pool *desc_pool,
|
||||||
struct pan_scoreboard *scoreboard,
|
struct pan_scoreboard *scoreboard,
|
||||||
mali_ptr src_coords, mali_ptr dst_coords,
|
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,
|
panfrost_add_job(desc_pool, scoreboard, MALI_JOB_TYPE_TILER,
|
||||||
false, false, 0, 0, &job, false);
|
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,
|
pan_blit_emit_bifrost_tiler_job(struct pan_pool *desc_pool,
|
||||||
struct pan_scoreboard *scoreboard,
|
struct pan_scoreboard *scoreboard,
|
||||||
mali_ptr src_coords, mali_ptr dst_coords,
|
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,
|
panfrost_add_job(desc_pool, scoreboard, MALI_JOB_TYPE_TILER,
|
||||||
false, false, 0, 0, &job, false);
|
false, false, 0, 0, &job, false);
|
||||||
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1483,14 +1485,14 @@ pan_blit_next_surface(struct pan_blit_context *ctx)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
struct panfrost_ptr
|
||||||
pan_blit(struct pan_blit_context *ctx,
|
pan_blit(struct pan_blit_context *ctx,
|
||||||
struct pan_pool *pool,
|
struct pan_pool *pool,
|
||||||
struct pan_scoreboard *scoreboard,
|
struct pan_scoreboard *scoreboard,
|
||||||
mali_ptr tsd, mali_ptr tiler)
|
mali_ptr tsd, mali_ptr tiler)
|
||||||
{
|
{
|
||||||
if (ctx->dst.cur_layer < 0 || ctx->dst.cur_layer > ctx->dst.last_layer)
|
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;
|
int32_t layer = ctx->dst.cur_layer - ctx->dst.layer_offset;
|
||||||
float src_z;
|
float src_z;
|
||||||
|
@ -1510,17 +1512,21 @@ pan_blit(struct pan_blit_context *ctx,
|
||||||
pan_pool_upload_aligned(pool, src_rect,
|
pan_pool_upload_aligned(pool, src_rect,
|
||||||
sizeof(src_rect), 64);
|
sizeof(src_rect), 64);
|
||||||
|
|
||||||
|
struct panfrost_ptr job;
|
||||||
|
|
||||||
if (pan_is_bifrost(pool->dev)) {
|
if (pan_is_bifrost(pool->dev)) {
|
||||||
pan_blit_emit_bifrost_tiler_job(pool, scoreboard,
|
job = pan_blit_emit_bifrost_tiler_job(pool, scoreboard,
|
||||||
src_coords, ctx->position,
|
src_coords, ctx->position,
|
||||||
ctx->textures, ctx->samplers,
|
ctx->textures, ctx->samplers,
|
||||||
ctx->vpd, ctx->rsd, tsd, tiler);
|
ctx->vpd, ctx->rsd, tsd, tiler);
|
||||||
} else {
|
} else {
|
||||||
pan_blit_emit_midgard_tiler_job(pool, scoreboard,
|
job = pan_blit_emit_midgard_tiler_job(pool, scoreboard,
|
||||||
src_coords, ctx->position,
|
src_coords, ctx->position,
|
||||||
ctx->textures, ctx->samplers,
|
ctx->textures, ctx->samplers,
|
||||||
ctx->vpd, ctx->rsd, tsd);
|
ctx->vpd, ctx->rsd, tsd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t pan_blit_shader_key_hash(const void *key)
|
static uint32_t pan_blit_shader_key_hash(const void *key)
|
||||||
|
|
|
@ -102,7 +102,7 @@ pan_blit_ctx_init(struct panfrost_device *dev,
|
||||||
bool
|
bool
|
||||||
pan_blit_next_surface(struct pan_blit_context *ctx);
|
pan_blit_next_surface(struct pan_blit_context *ctx);
|
||||||
|
|
||||||
void
|
struct panfrost_ptr
|
||||||
pan_blit(struct pan_blit_context *ctx,
|
pan_blit(struct pan_blit_context *ctx,
|
||||||
struct pan_pool *pool,
|
struct pan_pool *pool,
|
||||||
struct pan_scoreboard *scoreboard,
|
struct pan_scoreboard *scoreboard,
|
||||||
|
|
Loading…
Reference in New Issue