panfrost: Drop panfrost_vt_emit_shared_memory

Let's reuse the same routines across Midgard/Bifrost so we get proper
handling of spilling.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7206>
This commit is contained in:
Alyssa Rosenzweig
2020-10-14 21:27:40 -04:00
committed by Marge Bot
parent e6152091ca
commit b19d9c86a8
5 changed files with 12 additions and 45 deletions

View File

@@ -52,32 +52,6 @@ panfrost_bo_access_for_stage(enum pipe_shader_type stage)
PAN_BO_ACCESS_VERTEX_TILER;
}
mali_ptr
panfrost_vt_emit_shared_memory(struct panfrost_batch *batch)
{
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
struct panfrost_ptr t =
panfrost_pool_alloc_aligned(&batch->pool,
MALI_LOCAL_STORAGE_LENGTH,
64);
pan_pack(t.cpu, LOCAL_STORAGE, ls) {
ls.wls_instances = MALI_LOCAL_STORAGE_NO_WORKGROUP_MEM;
if (batch->stack_size) {
struct panfrost_bo *stack =
panfrost_batch_get_scratchpad(batch, batch->stack_size,
dev->thread_tls_alloc,
dev->core_count);
ls.tls_size = panfrost_get_stack_shift(batch->stack_size);
ls.tls_base_pointer = stack->ptr.gpu;
}
}
return t.gpu;
}
/* Gets a GPU address for the associated index buffer. Only gauranteed to be
* good for the duration of the draw (transient), could last longer. Also get
* the bounds on the index buffer for the range accessed by the draw. We do

View File

@@ -65,9 +65,6 @@ mali_ptr
panfrost_emit_vertex_data(struct panfrost_batch *batch,
mali_ptr *buffers);
mali_ptr
panfrost_vt_emit_shared_memory(struct panfrost_batch *batch);
mali_ptr
panfrost_get_index_buffer_bounded(struct panfrost_context *ctx,
const struct pipe_draw_info *info,

View File

@@ -483,9 +483,7 @@ panfrost_draw_vbo(
unsigned vertex_count = ctx->vertex_count;
mali_ptr shared_mem = is_bifrost ?
panfrost_vt_emit_shared_memory(batch) :
panfrost_batch_reserve_framebuffer(batch);
mali_ptr shared_mem = panfrost_batch_reserve_framebuffer(batch);
unsigned min_index = 0, max_index = 0;
mali_ptr indices = 0;

View File

@@ -727,25 +727,26 @@ 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 we haven't, reserve space for the thread storage descriptor (or a
* full framebuffer descriptor on Midgard) */
if (!batch->framebuffer.gpu) {
unsigned size = (dev->quirks & MIDGARD_SFBD) ?
unsigned size = (dev->quirks & IS_BIFROST) ?
MALI_LOCAL_STORAGE_LENGTH :
(dev->quirks & MIDGARD_SFBD) ?
MALI_SINGLE_TARGET_FRAMEBUFFER_LENGTH :
MALI_MULTI_TARGET_FRAMEBUFFER_LENGTH;
batch->framebuffer = panfrost_pool_alloc_aligned(&batch->pool, size, 64);
/* Tag the pointer */
if (!(dev->quirks & MIDGARD_SFBD))
if (!(dev->quirks & (MIDGARD_SFBD | IS_BIFROST)))
batch->framebuffer.gpu |= MALI_FBD_TAG_IS_MFBD;
}
return batch->framebuffer.gpu;
}
static void
panfrost_load_surface(struct panfrost_batch *batch, struct pipe_surface *surf, unsigned loc)
{
@@ -863,7 +864,7 @@ panfrost_load_surface(struct panfrost_batch *batch, struct pipe_surface *surf, u
panfrost_batch_get_bifrost_tiler(batch, vertex_count);
panfrost_load_bifrost(&batch->pool, &batch->scoreboard,
blend_shader,
panfrost_vt_emit_shared_memory(batch),
batch->framebuffer.gpu,
tiler,
transfer.gpu, vertex_count,
&img, loc);

View File

@@ -556,10 +556,10 @@ panfrost_attach_mfbd(struct panfrost_batch *batch, unsigned vertex_count)
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
void *fb = batch->framebuffer.cpu;
panfrost_mfbd_emit_local_storage(batch, fb);
if (dev->quirks & IS_BIFROST)
panfrost_mfbd_emit_bifrost_parameters(batch, fb);
else
panfrost_mfbd_emit_local_storage(batch, fb);
return;
pan_section_pack(fb, MULTI_TARGET_FRAMEBUFFER, PARAMETERS, params) {
params.width = batch->key.width;
@@ -572,10 +572,7 @@ panfrost_attach_mfbd(struct panfrost_batch *batch, unsigned vertex_count)
params.render_target_count = MAX2(batch->key.nr_cbufs, 1);
}
if (dev->quirks & IS_BIFROST)
panfrost_mfbd_emit_bifrost_tiler(batch, fb, vertex_count);
else
panfrost_mfbd_emit_midgard_tiler(batch, fb, vertex_count);
panfrost_mfbd_emit_midgard_tiler(batch, fb, vertex_count);
}
/* Creates an MFBD for the FRAGMENT section of the bound framebuffer */