v3d: group tile spec into a struct inside the job

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32111>
This commit is contained in:
Iago Toral Quiroga
2024-10-29 08:35:37 +01:00
committed by Marge Bot
parent f0543d79aa
commit 3c0f84aa41
5 changed files with 37 additions and 33 deletions
+7 -6
View File
@@ -530,8 +530,6 @@ v3d_tlb_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
src_surf);
job->msaa = msaa;
job->double_buffer = double_buffer;
job->tile_width = tile_width;
job->tile_height = tile_height;
job->internal_bpp = max_bpp;
job->draw_min_x = info->dst.box.x;
job->draw_min_y = info->dst.box.y;
@@ -547,10 +545,13 @@ v3d_tlb_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
*/
job->draw_width = MIN2(dst_surf->width, src_surf->width);
job->draw_height = MIN2(dst_surf->height, src_surf->height);
job->draw_tiles_x = DIV_ROUND_UP(job->draw_width,
job->tile_width);
job->draw_tiles_y = DIV_ROUND_UP(job->draw_height,
job->tile_height);
job->tile_desc.width = tile_width;
job->tile_desc.height = tile_height;
job->tile_desc.draw_x = DIV_ROUND_UP(job->draw_width,
job->tile_desc.width);
job->tile_desc.draw_y = DIV_ROUND_UP(job->draw_height,
job->tile_desc.height);
job->needs_flush = true;
job->num_layers = info->dst.box.depth;
+6 -4
View File
@@ -427,11 +427,13 @@ struct v3d_job {
/** @} */
/** @{ Tile information, depending on MSAA and float color buffer. */
uint32_t draw_tiles_x; /** @< Number of tiles wide for framebuffer. */
uint32_t draw_tiles_y; /** @< Number of tiles high for framebuffer. */
struct {
uint32_t draw_x; /** @< Number of tiles wide for framebuffer. */
uint32_t draw_y; /** @< Number of tiles high for framebuffer. */
uint32_t width; /** @< Width of a tile. */
uint32_t height; /** @< Height of a tile. */
} tile_desc;
uint32_t tile_width; /** @< Width of a tile. */
uint32_t tile_height; /** @< Height of a tile. */
/** maximum internal_bpp of all color render targets. */
uint32_t internal_bpp;
+6 -6
View File
@@ -403,8 +403,8 @@ v3d_get_job_for_fbo(struct v3d_context *v3d)
v3d_get_tile_buffer_size(&v3d->screen->devinfo,
job->msaa, job->double_buffer,
job->nr_cbufs, job->cbufs, job->bbuf,
&job->tile_width,
&job->tile_height,
&job->tile_desc.width,
&job->tile_desc.height,
&job->internal_bpp);
/* The dirty flags are tracking what's been updated while v3d->job has
@@ -436,10 +436,10 @@ v3d_get_job_for_fbo(struct v3d_context *v3d)
job->clear_tlb |= PIPE_CLEAR_STENCIL;
}
job->draw_tiles_x = DIV_ROUND_UP(v3d->framebuffer.width,
job->tile_width);
job->draw_tiles_y = DIV_ROUND_UP(v3d->framebuffer.height,
job->tile_height);
job->tile_desc.draw_x = DIV_ROUND_UP(v3d->framebuffer.width,
job->tile_desc.width);
job->tile_desc.draw_y = DIV_ROUND_UP(v3d->framebuffer.height,
job->tile_desc.height);
v3d->job = job;
+6 -5
View File
@@ -58,7 +58,8 @@ v3dX(start_binning)(struct v3d_context *v3d, struct v3d_job *job)
* of tile binning.
*/
uint32_t tile_alloc_size =
MAX2(job->num_layers, 1) * job->draw_tiles_x * job->draw_tiles_y * 64;
MAX2(job->num_layers, 1) * job->tile_desc.draw_x *
job->tile_desc.draw_y * 64;
/* The PTB allocates in aligned 4k chunks after the initial setup. */
tile_alloc_size = align(tile_alloc_size, 4096);
@@ -80,8 +81,8 @@ v3dX(start_binning)(struct v3d_context *v3d, struct v3d_job *job)
uint32_t tsda_per_tile_size = 256;
job->tile_state = v3d_bo_alloc(v3d->screen,
MAX2(job->num_layers, 1) *
job->draw_tiles_y *
job->draw_tiles_x *
job->tile_desc.draw_y *
job->tile_desc.draw_x *
tsda_per_tile_size,
"TSDA");
@@ -100,8 +101,8 @@ v3dX(start_binning)(struct v3d_context *v3d, struct v3d_job *job)
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);
config.log2_tile_width = log2_tile_size(job->tile_desc.width);
config.log2_tile_height = log2_tile_size(job->tile_desc.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
+12 -12
View File
@@ -493,7 +493,7 @@ do_double_initial_tile_clear(const struct v3d_job *job)
* clear for double buffer mode is required.
*/
return job->double_buffer &&
(job->draw_tiles_x > 1 || job->draw_tiles_y > 1);
(job->tile_desc.draw_x > 1 || job->tile_desc.draw_y > 1);
}
static void
@@ -505,7 +505,7 @@ emit_render_layer(struct v3d_job *job, uint32_t layer)
* core's tile list here.
*/
uint32_t tile_alloc_offset =
layer * job->draw_tiles_x * job->draw_tiles_y * 64;
layer * job->tile_desc.draw_x * job->tile_desc.draw_y * 64;
cl_emit(&job->rcl, MULTICORE_RENDERING_TILE_LIST_SET_BASE, list) {
list.address = cl_address(job->tile_alloc, tile_alloc_offset);
}
@@ -516,9 +516,9 @@ emit_render_layer(struct v3d_job *job, uint32_t layer)
/* Size up our supertiles until we get under the limit. */
for (;;) {
frame_w_in_supertiles = DIV_ROUND_UP(job->draw_tiles_x,
frame_w_in_supertiles = DIV_ROUND_UP(job->tile_desc.draw_x,
supertile_w);
frame_h_in_supertiles = DIV_ROUND_UP(job->draw_tiles_y,
frame_h_in_supertiles = DIV_ROUND_UP(job->tile_desc.draw_y,
supertile_h);
if (frame_w_in_supertiles *
frame_h_in_supertiles < max_supertiles) {
@@ -532,8 +532,8 @@ emit_render_layer(struct v3d_job *job, uint32_t layer)
}
config.number_of_bin_tile_lists = 1;
config.total_frame_width_in_tiles = job->draw_tiles_x;
config.total_frame_height_in_tiles = job->draw_tiles_y;
config.total_frame_width_in_tiles = job->tile_desc.draw_x;
config.total_frame_height_in_tiles = job->tile_desc.draw_y;
config.supertile_width_in_tiles = supertile_w;
config.supertile_height_in_tiles = supertile_h;
@@ -589,8 +589,8 @@ emit_render_layer(struct v3d_job *job, uint32_t layer)
* improve X11 performance, but we should use Morton order
* otherwise to improve cache locality.
*/
uint32_t supertile_w_in_pixels = job->tile_width * supertile_w;
uint32_t supertile_h_in_pixels = job->tile_height * supertile_h;
uint32_t supertile_w_in_pixels = job->tile_desc.width * supertile_w;
uint32_t supertile_h_in_pixels = job->tile_desc.height * supertile_h;
uint32_t min_x_supertile = job->draw_min_x / supertile_w_in_pixels;
uint32_t min_y_supertile = job->draw_min_y / supertile_h_in_pixels;
@@ -679,8 +679,8 @@ v3dX(emit_rcl)(struct v3d_job *job)
config.maximum_bpp_of_all_render_targets = job->internal_bpp;
#endif
#if V3D_VERSION >= 71
config.log2_tile_width = log2_tile_size(job->tile_width);
config.log2_tile_height = log2_tile_size(job->tile_height);
config.log2_tile_width = log2_tile_size(job->tile_desc.width);
config.log2_tile_height = log2_tile_size(job->tile_desc.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
@@ -774,12 +774,12 @@ v3dX(emit_rcl)(struct v3d_job *job)
v3d_setup_render_target(job, i, &rt.internal_bpp,
&rt.internal_type_and_clamping);
rt.stride =
v3d_compute_rt_row_row_stride_128_bits(job->tile_width,
v3d_compute_rt_row_row_stride_128_bits(job->tile_desc.width,
v3d_internal_bpp_words(rt.internal_bpp));
rt.base_address = base_addr;
rt.render_target_number = i;
base_addr += (job->tile_height * rt.stride) / 8;
base_addr += (job->tile_desc.height * rt.stride) / 8;
}
if (surf->internal_bpp >= V3D_INTERNAL_BPP_64) {