mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
panvk: Support 64x64 meta tile size for v12 in cmd_preload_render_area_border
On "5th Gen", the meta tile size changed to 64x64. This adds a new helper to get the meta tile size depending on the generation. Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34032>
This commit is contained in:
parent
1c4be73222
commit
c191b36456
2 changed files with 19 additions and 8 deletions
|
|
@ -147,6 +147,15 @@ panfrost_max_effective_tile_size(unsigned arch)
|
|||
return 16 * 16;
|
||||
}
|
||||
|
||||
static inline unsigned
|
||||
panfrost_meta_tile_size(unsigned arch)
|
||||
{
|
||||
if (arch >= 12)
|
||||
return 64;
|
||||
|
||||
return 32;
|
||||
}
|
||||
|
||||
/* Returns the maximum usable color tilebuffer-size. This is *usually* twice
|
||||
* the optimal tilebuffer-size, but not always.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -533,17 +533,19 @@ void
|
|||
panvk_per_arch(cmd_preload_render_area_border)(
|
||||
struct panvk_cmd_buffer *cmdbuf, const VkRenderingInfo *render_info)
|
||||
{
|
||||
const unsigned meta_tile_size = panfrost_meta_tile_size(PAN_ARCH);
|
||||
struct panvk_cmd_graphics_state *state = &cmdbuf->state.gfx;
|
||||
struct pan_fb_info *fbinfo = &state->render.fb.info;
|
||||
bool render_area_is_32x32_aligned =
|
||||
((fbinfo->extent.minx | fbinfo->extent.miny) % 32) == 0 &&
|
||||
(fbinfo->extent.maxx + 1 == fbinfo->width ||
|
||||
(fbinfo->extent.maxx % 32) == 31) &&
|
||||
(fbinfo->extent.maxy + 1 == fbinfo->height ||
|
||||
(fbinfo->extent.maxy % 32) == 31);
|
||||
|
||||
/* If the render area is aligned on a 32x32 section, we're good. */
|
||||
if (!render_area_is_32x32_aligned)
|
||||
bool render_area_is_aligned =
|
||||
((fbinfo->extent.minx | fbinfo->extent.miny) % meta_tile_size) == 0 &&
|
||||
(fbinfo->extent.maxx + 1 == fbinfo->width ||
|
||||
(fbinfo->extent.maxx % meta_tile_size) == (meta_tile_size - 1)) &&
|
||||
(fbinfo->extent.maxy + 1 == fbinfo->height ||
|
||||
(fbinfo->extent.maxy % meta_tile_size) == (meta_tile_size - 1));
|
||||
|
||||
/* If the render area is aligned on the meta tile size, we're good. */
|
||||
if (!render_area_is_aligned)
|
||||
panvk_per_arch(cmd_force_fb_preload)(cmdbuf, render_info);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue