panfrost: Pass size to panfrost_batch_get_scratchpad

We'll compute the size with the new scratchpad helpers.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig
2019-12-09 11:02:15 -05:00
parent bc887e8281
commit 4f7fddbd71
4 changed files with 34 additions and 17 deletions

View File

@@ -636,19 +636,21 @@ panfrost_batch_get_polygon_list(struct panfrost_batch *batch, unsigned size)
}
struct panfrost_bo *
panfrost_batch_get_scratchpad(struct panfrost_batch *batch)
panfrost_batch_get_scratchpad(struct panfrost_batch *batch,
unsigned shift,
unsigned thread_tls_alloc,
unsigned core_count)
{
if (batch->scratchpad)
return batch->scratchpad;
unsigned size = panfrost_get_total_stack_size(shift,
thread_tls_alloc,
core_count);
batch->scratchpad = panfrost_batch_create_bo(batch, 64 * 4 * 4096,
PAN_BO_INVISIBLE,
PAN_BO_ACCESS_PRIVATE |
PAN_BO_ACCESS_RW |
PAN_BO_ACCESS_VERTEX_TILER |
PAN_BO_ACCESS_FRAGMENT);
assert(batch->scratchpad);
return batch->scratchpad;
return panfrost_batch_create_bo(batch, size,
PAN_BO_INVISIBLE,
PAN_BO_ACCESS_PRIVATE |
PAN_BO_ACCESS_RW |
PAN_BO_ACCESS_VERTEX_TILER |
PAN_BO_ACCESS_FRAGMENT);
}
struct panfrost_bo *

View File

@@ -202,12 +202,12 @@ panfrost_flush_batches_accessing_bo(struct panfrost_context *ctx,
void
panfrost_batch_set_requirements(struct panfrost_batch *batch);
struct panfrost_bo *
panfrost_batch_get_scratchpad(struct panfrost_batch *batch, unsigned shift, unsigned thread_tls_alloc, unsigned core_count);
mali_ptr
panfrost_batch_get_polygon_list(struct panfrost_batch *batch, unsigned size);
struct panfrost_bo *
panfrost_batch_get_scratchpad(struct panfrost_batch *batch);
struct panfrost_bo *
panfrost_batch_get_tiler_heap(struct panfrost_batch *batch);

View File

@@ -354,9 +354,15 @@ panfrost_mfbd_upload(struct panfrost_batch *batch,
static struct bifrost_framebuffer
panfrost_emit_mfbd(struct panfrost_batch *batch, unsigned vertex_count)
{
struct panfrost_context *ctx = batch->ctx;
struct pipe_context *gallium = (struct pipe_context *) ctx;
struct panfrost_screen *screen = pan_screen(gallium->screen);
unsigned width = batch->key.width;
unsigned height = batch->key.height;
unsigned shift = panfrost_get_stack_shift(batch->stack_size);
struct bifrost_framebuffer framebuffer = {
.width1 = MALI_POSITIVE(width),
.height1 = MALI_POSITIVE(height),
@@ -371,9 +377,9 @@ panfrost_emit_mfbd(struct panfrost_batch *batch, unsigned vertex_count)
.unknown2 = 0x1f,
.tiler = panfrost_emit_midg_tiler(batch, vertex_count),
.stack_shift = 0x5,
.stack_shift = shift,
.unk0 = 0x1e,
.scratchpad = panfrost_batch_get_scratchpad(batch)->gpu
.scratchpad = panfrost_batch_get_scratchpad(batch, shift, screen->thread_tls_alloc, screen->core_count)->gpu
};
return framebuffer;

View File

@@ -198,9 +198,18 @@ panfrost_sfbd_set_zsbuf(
static struct mali_single_framebuffer
panfrost_emit_sfbd(struct panfrost_batch *batch, unsigned vertex_count)
{
struct panfrost_context *ctx = batch->ctx;
struct pipe_context *gallium = (struct pipe_context *) ctx;
struct panfrost_screen *screen = pan_screen(gallium->screen);
unsigned width = batch->key.width;
unsigned height = batch->key.height;
/* TODO: Why do we need to make the stack bigger than other platforms? */
unsigned shift = panfrost_get_stack_shift(MAX2(batch->stack_size, 512));
/* TODO: where do we specify the shift? */
struct mali_single_framebuffer framebuffer = {
.width = MALI_POSITIVE(width),
.height = MALI_POSITIVE(height),
@@ -209,7 +218,7 @@ panfrost_emit_sfbd(struct panfrost_batch *batch, unsigned vertex_count)
.unk3 = 0x3,
},
.clear_flags = 0x1000,
.scratchpad = panfrost_batch_get_scratchpad(batch)->gpu,
.scratchpad = panfrost_batch_get_scratchpad(batch, shift, screen->thread_tls_alloc, screen->core_count)->gpu,
.tiler = panfrost_emit_midg_tiler(batch, vertex_count),
};