panfrost: Inline add_fbo_bos

Only used once, it's just complicating the batch cache interface.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12525>
This commit is contained in:
Alyssa Rosenzweig 2021-08-16 23:55:50 +00:00
parent 4991e17297
commit 3622562e44
2 changed files with 15 additions and 24 deletions

View file

@ -46,6 +46,17 @@ panfrost_batch_idx(struct panfrost_batch *batch)
return batch - batch->ctx->batches.slots;
}
/* Adds the BO backing surface to a batch if the surface is non-null */
static void
panfrost_batch_add_surface(struct panfrost_batch *batch, struct pipe_surface *surf)
{
if (surf) {
struct panfrost_resource *rsrc = pan_resource(surf->texture);
panfrost_batch_write_rsrc(batch, rsrc, PIPE_SHADER_FRAGMENT);
}
}
static void
panfrost_batch_init(struct panfrost_context *ctx,
const struct pipe_framebuffer_state *key,
@ -79,7 +90,10 @@ panfrost_batch_init(struct panfrost_context *ctx,
panfrost_pool_init(&batch->invisible_pool, NULL, dev,
PAN_BO_INVISIBLE, 65536, "Varyings", false, true);
panfrost_batch_add_fbo_bos(batch);
for (unsigned i = 0; i < batch->key.nr_cbufs; ++i)
panfrost_batch_add_surface(batch, batch->key.cbufs[i]);
panfrost_batch_add_surface(batch, batch->key.zsbuf);
screen->vtbl.init_batch(batch);
}
@ -320,26 +334,6 @@ panfrost_batch_write_rsrc(struct panfrost_batch *batch,
panfrost_batch_update_access(batch, rsrc, true);
}
/* Adds the BO backing surface to a batch if the surface is non-null */
static void
panfrost_batch_add_surface(struct panfrost_batch *batch, struct pipe_surface *surf)
{
if (surf) {
struct panfrost_resource *rsrc = pan_resource(surf->texture);
panfrost_batch_write_rsrc(batch, rsrc, PIPE_SHADER_FRAGMENT);
}
}
void
panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
{
for (unsigned i = 0; i < batch->key.nr_cbufs; ++i)
panfrost_batch_add_surface(batch, batch->key.cbufs[i]);
panfrost_batch_add_surface(batch, batch->key.zsbuf);
}
struct panfrost_bo *
panfrost_batch_create_bo(struct panfrost_batch *batch, size_t size,
uint32_t create_flags, enum pipe_shader_type stage,

View file

@ -157,9 +157,6 @@ panfrost_batch_write_rsrc(struct panfrost_batch *batch,
struct panfrost_resource *rsrc,
enum pipe_shader_type stage);
void
panfrost_batch_add_fbo_bos(struct panfrost_batch *batch);
struct panfrost_bo *
panfrost_batch_create_bo(struct panfrost_batch *batch, size_t size,
uint32_t create_flags, uint32_t access_flags,