panfrost: Extract panfrost_batch_reserve_framebuffer

We need to trigger it explicitly for reloads without draws (for Z^S
reload which is an edge case).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5929>
This commit is contained in:
Alyssa Rosenzweig 2020-07-15 13:10:02 -04:00 committed by Marge Bot
parent 5d0d8faaa6
commit 34a03109b8
3 changed files with 28 additions and 17 deletions

View file

@ -71,24 +71,8 @@ static void
panfrost_vt_attach_framebuffer(struct panfrost_context *ctx,
struct mali_vertex_tiler_postfix *postfix)
{
struct panfrost_device *dev = pan_device(ctx->base.screen);
struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
/* If we haven't, reserve space for the framebuffer */
if (!batch->framebuffer.gpu) {
unsigned size = (dev->quirks & MIDGARD_SFBD) ?
sizeof(struct mali_single_framebuffer) :
sizeof(struct mali_framebuffer);
batch->framebuffer = panfrost_pool_alloc(&batch->pool, size);
/* Tag the pointer */
if (!(dev->quirks & MIDGARD_SFBD))
batch->framebuffer.gpu |= MALI_MFBD;
}
postfix->shared_memory = batch->framebuffer.gpu;
postfix->shared_memory = panfrost_batch_reserve_framebuffer(batch);
}
static void

View file

@ -770,6 +770,30 @@ panfrost_batch_get_tiler_dummy(struct panfrost_batch *batch)
return batch->tiler_dummy;
}
mali_ptr
panfrost_batch_reserve_framebuffer(struct panfrost_batch *batch)
{
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
/* If we haven't, reserve space for the framebuffer */
if (!batch->framebuffer.gpu) {
unsigned size = (dev->quirks & MIDGARD_SFBD) ?
sizeof(struct mali_single_framebuffer) :
sizeof(struct mali_framebuffer);
batch->framebuffer = panfrost_pool_alloc(&batch->pool, size);
/* Tag the pointer */
if (!(dev->quirks & MIDGARD_SFBD))
batch->framebuffer.gpu |= MALI_MFBD;
}
return batch->framebuffer.gpu;
}
static void
panfrost_batch_draw_wallpaper(struct panfrost_batch *batch)
{

View file

@ -221,4 +221,7 @@ panfrost_batch_is_scanout(struct panfrost_batch *batch);
mali_ptr
panfrost_batch_get_tiler_meta(struct panfrost_batch *batch, unsigned vertex_count);
mali_ptr
panfrost_batch_reserve_framebuffer(struct panfrost_batch *batch);
#endif