From da11be4bdf21d276a82aff68234fa68dededd31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Wed, 20 Oct 2021 14:31:10 +0200 Subject: [PATCH] v3d: emit TILE_BINNING_MODE_CFG and TILE_RENDERING_MODE_CFG_COMMON for v71 Reviewed-by: Iago Toral Quiroga Part-of: --- src/gallium/drivers/v3d/v3dx_draw.c | 16 +++++++++++++++- src/gallium/drivers/v3d/v3dx_rcl.c | 13 +++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index b63ac8313fa..c90fa5acd4b 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -96,7 +96,21 @@ v3dX(start_binning)(struct v3d_context *v3d, struct v3d_job *job) assert(!job->msaa || !job->double_buffer); #if V3D_VERSION >= 71 - unreachable("HW generation 71 not supported yet."); + cl_emit(&job->bcl, TILE_BINNING_MODE_CFG, config) { + config.width_in_pixels = job->draw_width; + config.height_in_pixels = job->draw_height; + + config.log2_tile_width = log2_tile_size(job->tile_width); + config.log2_tile_height = log2_tile_size(job->tile_height); + + /* FIXME: ideallly we would like next assert on the packet header (as is + * general, so also applies to GL). We would need to expand + * gen_pack_header for that. + */ + assert(config.log2_tile_width == config.log2_tile_height || + config.log2_tile_width == config.log2_tile_height + 1); + } + #endif #if V3D_VERSION >= 40 && V3D_VERSION <= 42 diff --git a/src/gallium/drivers/v3d/v3dx_rcl.c b/src/gallium/drivers/v3d/v3dx_rcl.c index 88a453ae312..fbec1a04c6c 100644 --- a/src/gallium/drivers/v3d/v3dx_rcl.c +++ b/src/gallium/drivers/v3d/v3dx_rcl.c @@ -24,8 +24,9 @@ #include "util/format/u_format.h" #include "util/macros.h" #include "v3d_context.h" -#include "broadcom/common/v3d_tiling.h" #include "broadcom/common/v3d_macros.h" +#include "broadcom/common/v3d_tiling.h" +#include "broadcom/common/v3d_util.h" #include "broadcom/cle/v3dx_pack.h" #define PIPE_CLEAR_COLOR_BUFFERS (PIPE_CLEAR_COLOR0 | \ @@ -789,7 +790,15 @@ v3dX(emit_rcl)(struct v3d_job *job) config.maximum_bpp_of_all_render_targets = job->internal_bpp; #endif #if V3D_VERSION >= 71 - unreachable("HW generation 71 not supported yet."); + config.log2_tile_width = log2_tile_size(job->tile_width); + config.log2_tile_height = log2_tile_size(job->tile_height); + + /* FIXME: ideallly we would like next assert on the packet header (as is + * general, so also applies to GL). We would need to expand + * gen_pack_header for that. + */ + assert(config.log2_tile_width == config.log2_tile_height || + config.log2_tile_width == config.log2_tile_height + 1); #endif }