mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 19:50:11 +01:00
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:
parent
e6152091ca
commit
b19d9c86a8
5 changed files with 12 additions and 45 deletions
|
|
@ -52,32 +52,6 @@ panfrost_bo_access_for_stage(enum pipe_shader_type stage)
|
||||||
PAN_BO_ACCESS_VERTEX_TILER;
|
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
|
/* 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
|
* 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
|
* the bounds on the index buffer for the range accessed by the draw. We do
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,6 @@ mali_ptr
|
||||||
panfrost_emit_vertex_data(struct panfrost_batch *batch,
|
panfrost_emit_vertex_data(struct panfrost_batch *batch,
|
||||||
mali_ptr *buffers);
|
mali_ptr *buffers);
|
||||||
|
|
||||||
mali_ptr
|
|
||||||
panfrost_vt_emit_shared_memory(struct panfrost_batch *batch);
|
|
||||||
|
|
||||||
mali_ptr
|
mali_ptr
|
||||||
panfrost_get_index_buffer_bounded(struct panfrost_context *ctx,
|
panfrost_get_index_buffer_bounded(struct panfrost_context *ctx,
|
||||||
const struct pipe_draw_info *info,
|
const struct pipe_draw_info *info,
|
||||||
|
|
|
||||||
|
|
@ -483,9 +483,7 @@ panfrost_draw_vbo(
|
||||||
|
|
||||||
unsigned vertex_count = ctx->vertex_count;
|
unsigned vertex_count = ctx->vertex_count;
|
||||||
|
|
||||||
mali_ptr shared_mem = is_bifrost ?
|
mali_ptr shared_mem = panfrost_batch_reserve_framebuffer(batch);
|
||||||
panfrost_vt_emit_shared_memory(batch) :
|
|
||||||
panfrost_batch_reserve_framebuffer(batch);
|
|
||||||
|
|
||||||
unsigned min_index = 0, max_index = 0;
|
unsigned min_index = 0, max_index = 0;
|
||||||
mali_ptr indices = 0;
|
mali_ptr indices = 0;
|
||||||
|
|
|
||||||
|
|
@ -727,25 +727,26 @@ panfrost_batch_reserve_framebuffer(struct panfrost_batch *batch)
|
||||||
{
|
{
|
||||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
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) {
|
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_SINGLE_TARGET_FRAMEBUFFER_LENGTH :
|
||||||
MALI_MULTI_TARGET_FRAMEBUFFER_LENGTH;
|
MALI_MULTI_TARGET_FRAMEBUFFER_LENGTH;
|
||||||
|
|
||||||
batch->framebuffer = panfrost_pool_alloc_aligned(&batch->pool, size, 64);
|
batch->framebuffer = panfrost_pool_alloc_aligned(&batch->pool, size, 64);
|
||||||
|
|
||||||
/* Tag the pointer */
|
/* Tag the pointer */
|
||||||
if (!(dev->quirks & MIDGARD_SFBD))
|
if (!(dev->quirks & (MIDGARD_SFBD | IS_BIFROST)))
|
||||||
batch->framebuffer.gpu |= MALI_FBD_TAG_IS_MFBD;
|
batch->framebuffer.gpu |= MALI_FBD_TAG_IS_MFBD;
|
||||||
}
|
}
|
||||||
|
|
||||||
return batch->framebuffer.gpu;
|
return batch->framebuffer.gpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
panfrost_load_surface(struct panfrost_batch *batch, struct pipe_surface *surf, unsigned loc)
|
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_batch_get_bifrost_tiler(batch, vertex_count);
|
||||||
panfrost_load_bifrost(&batch->pool, &batch->scoreboard,
|
panfrost_load_bifrost(&batch->pool, &batch->scoreboard,
|
||||||
blend_shader,
|
blend_shader,
|
||||||
panfrost_vt_emit_shared_memory(batch),
|
batch->framebuffer.gpu,
|
||||||
tiler,
|
tiler,
|
||||||
transfer.gpu, vertex_count,
|
transfer.gpu, vertex_count,
|
||||||
&img, loc);
|
&img, loc);
|
||||||
|
|
|
||||||
|
|
@ -556,10 +556,10 @@ panfrost_attach_mfbd(struct panfrost_batch *batch, unsigned vertex_count)
|
||||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||||
void *fb = batch->framebuffer.cpu;
|
void *fb = batch->framebuffer.cpu;
|
||||||
|
|
||||||
|
panfrost_mfbd_emit_local_storage(batch, fb);
|
||||||
|
|
||||||
if (dev->quirks & IS_BIFROST)
|
if (dev->quirks & IS_BIFROST)
|
||||||
panfrost_mfbd_emit_bifrost_parameters(batch, fb);
|
return;
|
||||||
else
|
|
||||||
panfrost_mfbd_emit_local_storage(batch, fb);
|
|
||||||
|
|
||||||
pan_section_pack(fb, MULTI_TARGET_FRAMEBUFFER, PARAMETERS, params) {
|
pan_section_pack(fb, MULTI_TARGET_FRAMEBUFFER, PARAMETERS, params) {
|
||||||
params.width = batch->key.width;
|
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);
|
params.render_target_count = MAX2(batch->key.nr_cbufs, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev->quirks & IS_BIFROST)
|
panfrost_mfbd_emit_midgard_tiler(batch, fb, vertex_count);
|
||||||
panfrost_mfbd_emit_bifrost_tiler(batch, fb, vertex_count);
|
|
||||||
else
|
|
||||||
panfrost_mfbd_emit_midgard_tiler(batch, fb, vertex_count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Creates an MFBD for the FRAGMENT section of the bound framebuffer */
|
/* Creates an MFBD for the FRAGMENT section of the bound framebuffer */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue