From 35dfaaf1c3625b32d491cc84893d94c3c3fa65e8 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 18 May 2021 10:26:27 -0400 Subject: [PATCH] panfrost: Pass batch to panfrost_get_index_buffer_bounded Calling batch_for_fbo outside of Gallium entrypoints is an antipattern. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 4 ++-- src/gallium/drivers/panfrost/pan_cmdstream.h | 2 +- src/gallium/drivers/panfrost/pan_context.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 76c7096bb8a..7c84ebd2806 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -81,13 +81,13 @@ panfrost_bo_access_for_stage(enum pipe_shader_type stage) * require them to be together. */ mali_ptr -panfrost_get_index_buffer_bounded(struct panfrost_context *ctx, +panfrost_get_index_buffer_bounded(struct panfrost_batch *batch, const struct pipe_draw_info *info, const struct pipe_draw_start_count_bias *draw, unsigned *min_index, unsigned *max_index) { struct panfrost_resource *rsrc = pan_resource(info->index.resource); - struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx); + struct panfrost_context *ctx = batch->ctx; off_t offset = draw->start * info->index_size; bool needs_indices = true; mali_ptr out = 0; diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.h b/src/gallium/drivers/panfrost/pan_cmdstream.h index 4fca581f823..5090ce26b9f 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.h +++ b/src/gallium/drivers/panfrost/pan_cmdstream.h @@ -71,7 +71,7 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch, mali_ptr *buffers); mali_ptr -panfrost_get_index_buffer_bounded(struct panfrost_context *ctx, +panfrost_get_index_buffer_bounded(struct panfrost_batch *batch, const struct pipe_draw_info *info, const struct pipe_draw_start_count_bias *draw, unsigned *min_index, unsigned *max_index); diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 354c48ad722..bd6898396bd 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -458,7 +458,7 @@ panfrost_direct_draw(struct panfrost_batch *batch, mali_ptr indices = 0; if (info->index_size) { - indices = panfrost_get_index_buffer_bounded(ctx, info, draw, + indices = panfrost_get_index_buffer_bounded(batch, info, draw, &min_index, &max_index);