From 93ef28a134c8d9f26ae18c3687f157798c9f7c07 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Tue, 29 Oct 2024 08:40:58 +0100 Subject: [PATCH] v3d: save a pointer to the TILE_BINNING_MODE_CFG packet in the CL We want to make the decision about double-buffer enablement much later when we have enough information to make it. That means we might need to rewrite this packet, so we need to save a pointer to its location in the CL. Reviewed-by: Jose Maria Casanova Crespo Part-of: --- src/gallium/drivers/v3d/v3d_context.h | 7 +++++++ src/gallium/drivers/v3d/v3dx_draw.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/gallium/drivers/v3d/v3d_context.h b/src/gallium/drivers/v3d/v3d_context.h index f32e5fcadcc..90ff45748f1 100644 --- a/src/gallium/drivers/v3d/v3d_context.h +++ b/src/gallium/drivers/v3d/v3d_context.h @@ -536,6 +536,13 @@ struct v3d_job { */ uint32_t tf_draw_calls_queued; + + /* A pointer to the location of the TILE_BINNING_MODE_CFG packet so we + * can rewrite it to enable double-buffer mode by the time we have + * enough info about the job to make that decision. + */ + struct v3d_cl_out *bcl_tile_binning_mode_ptr; + struct v3d_job_key key; }; diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index ecd5842d7f4..4279d9a433b 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -96,6 +96,8 @@ v3dX(start_binning)(struct v3d_context *v3d, struct v3d_job *job) } assert(!job->msaa || !job->double_buffer); + job->bcl_tile_binning_mode_ptr = cl_start(&job->bcl); + #if V3D_VERSION >= 71 cl_emit(&job->bcl, TILE_BINNING_MODE_CFG, config) { config.width_in_pixels = job->draw_width;