panfrost: Hoist add_fbo_bo call
Move it to batch initialization, to take it out of the clear/draw path. This should make sense - as soon as the batch is created, we need to hold the refference. Functionally there shouldn't be unused batches floating around anyway. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6327>
This commit is contained in:
committed by
Marge Bot
parent
433fa39c2e
commit
a2e4159029
@@ -139,8 +139,6 @@ panfrost_clear(
|
||||
* fragment jobs.
|
||||
*/
|
||||
struct panfrost_batch *batch = panfrost_get_fresh_batch_for_fbo(ctx);
|
||||
|
||||
panfrost_batch_add_fbo_bos(batch);
|
||||
panfrost_batch_clear(batch, buffers, color, depth, stencil);
|
||||
}
|
||||
|
||||
@@ -309,12 +307,9 @@ panfrost_draw_vbo(
|
||||
return;
|
||||
}
|
||||
|
||||
/* Now that we have a guaranteed terminating path, find the job.
|
||||
* Assignment commented out to prevent unused warning */
|
||||
/* Now that we have a guaranteed terminating path, find the job. */
|
||||
|
||||
struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
|
||||
|
||||
panfrost_batch_add_fbo_bos(batch);
|
||||
panfrost_batch_set_requirements(batch);
|
||||
|
||||
/* Take into account a negative bias */
|
||||
|
||||
@@ -92,6 +92,9 @@ panfrost_batch_fence_reference(struct panfrost_batch_fence *fence)
|
||||
pipe_reference(NULL, &fence->reference);
|
||||
}
|
||||
|
||||
static void
|
||||
panfrost_batch_add_fbo_bos(struct panfrost_batch *batch);
|
||||
|
||||
static struct panfrost_batch *
|
||||
panfrost_create_batch(struct panfrost_context *ctx,
|
||||
const struct pipe_framebuffer_state *key)
|
||||
@@ -111,6 +114,8 @@ panfrost_create_batch(struct panfrost_context *ctx,
|
||||
|
||||
batch->pool = panfrost_create_pool(batch, pan_device(ctx->base.screen));
|
||||
|
||||
panfrost_batch_add_fbo_bos(batch);
|
||||
|
||||
return batch;
|
||||
}
|
||||
|
||||
@@ -559,7 +564,8 @@ panfrost_batch_add_resource_bos(struct panfrost_batch *batch,
|
||||
panfrost_batch_add_bo(batch, rsrc->separate_stencil->bo, flags);
|
||||
}
|
||||
|
||||
void panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
|
||||
static void
|
||||
panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
|
||||
{
|
||||
uint32_t flags = PAN_BO_ACCESS_SHARED | PAN_BO_ACCESS_WRITE |
|
||||
PAN_BO_ACCESS_VERTEX_TILER |
|
||||
|
||||
@@ -147,8 +147,6 @@ void
|
||||
panfrost_batch_add_bo(struct panfrost_batch *batch, struct panfrost_bo *bo,
|
||||
uint32_t flags);
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user