panvk: Change the prototype of panvk_select_tiler_hierarchy_mask()

We're going to put the panvk_cmd_graphics_state definition to
panvk_cmd_draw.h, which involves including panvk_cmd_draw.h from
panvk_cmd_buffer.h, which in turn means we can't include
panvk_cmd_buffer.h from panvk_cmd_draw.h.

Kill the circular inclusion by changing the prototype of
panvk_select_tiler_hierarchy_mask() to take a panvk_physical_device
and a panvk_cmd_graphics_state instead of a panvk_cmd_buffer oject.

Signed-off-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/31911>
This commit is contained in:
Boris Brezillon 2024-11-07 13:57:04 +01:00 committed by Marge Bot
parent f6c3544392
commit 8a5814b456
3 changed files with 10 additions and 7 deletions

View file

@ -888,7 +888,8 @@ get_tiler_desc(struct panvk_cmd_buffer *cmdbuf)
unsigned max_levels = tiler_features.max_levels;
assert(max_levels >= 2);
cfg.hierarchy_mask = panvk_select_tiler_hierarchy_mask(cmdbuf);
cfg.hierarchy_mask =
panvk_select_tiler_hierarchy_mask(phys_dev, &cmdbuf->state.gfx);
cfg.fb_width = cmdbuf->state.gfx.render.fb.info.width;
cfg.fb_height = cmdbuf->state.gfx.render.fb.info.height;

View file

@ -225,6 +225,8 @@ panvk_per_arch(cmd_prepare_tiler_context)(struct panvk_cmd_buffer *cmdbuf,
uint32_t layer_idx)
{
struct panvk_device *dev = to_panvk_device(cmdbuf->vk.base.device);
struct panvk_physical_device *phys_dev =
to_panvk_physical_device(cmdbuf->vk.base.device->physical);
struct panvk_batch *batch = cmdbuf->cur_batch;
mali_ptr tiler_desc;
@ -253,7 +255,8 @@ panvk_per_arch(cmd_prepare_tiler_context)(struct panvk_cmd_buffer *cmdbuf,
}
pan_pack(&batch->tiler.ctx_templ, TILER_CONTEXT, cfg) {
cfg.hierarchy_mask = panvk_select_tiler_hierarchy_mask(cmdbuf);
cfg.hierarchy_mask =
panvk_select_tiler_hierarchy_mask(phys_dev, &cmdbuf->state.gfx);
cfg.fb_width = fbinfo->width;
cfg.fb_height = fbinfo->height;
cfg.heap = batch->tiler.heap_desc.gpu;

View file

@ -16,14 +16,13 @@
#include "pan_props.h"
static inline uint32_t
panvk_select_tiler_hierarchy_mask(struct panvk_cmd_buffer *cmdbuf)
panvk_select_tiler_hierarchy_mask(const struct panvk_physical_device *phys_dev,
const struct panvk_cmd_graphics_state *state)
{
struct panvk_physical_device *phys_dev =
to_panvk_physical_device(cmdbuf->vk.base.device->physical);
struct panfrost_tiler_features tiler_features =
panfrost_query_tiler_features(&phys_dev->kmod.props);
uint32_t max_fb_wh = MAX2(cmdbuf->state.gfx.render.fb.info.width,
cmdbuf->state.gfx.render.fb.info.height);
uint32_t max_fb_wh = MAX2(state->render.fb.info.width,
state->render.fb.info.height);
uint32_t last_hierarchy_bit = util_last_bit(DIV_ROUND_UP(max_fb_wh, 16));
uint32_t hierarchy_mask = BITFIELD_MASK(tiler_features.max_levels);