panfrost: Make pan_encoder.h panfrost_device agnostic

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26698>
This commit is contained in:
Boris Brezillon
2023-12-07 17:26:12 +01:00
committed by Marge Bot
parent 0651b8871b
commit a01be2f21f
2 changed files with 6 additions and 8 deletions

View File

@@ -3681,8 +3681,8 @@ batch_get_polygon_list(struct panfrost_batch *batch)
if (!batch->tiler_ctx.midgard.polygon_list) {
bool has_draws = batch->draw_count > 0;
unsigned size = panfrost_tiler_get_polygon_list_size(
dev, batch->key.width, batch->key.height,
batch->tiler_ctx.vertex_count);
batch->key.width, batch->key.height, batch->tiler_ctx.vertex_count,
!dev->model->quirks.no_hierarchical_tiling);
/* Create the BO as invisible if we can. If there are no draws,
* we need to write the polygon list manually because there's

View File

@@ -32,8 +32,8 @@
#include <stdbool.h>
#include "genxml/gen_macros.h"
#include "util/format/u_format.h"
#include "pan_bo.h"
#include "pan_device.h"
#include "pan_pool.h"
/* Tiler structure size computation */
@@ -48,14 +48,12 @@ unsigned panfrost_choose_hierarchy_mask(unsigned width, unsigned height,
#if defined(PAN_ARCH) && PAN_ARCH <= 5
static inline unsigned
panfrost_tiler_get_polygon_list_size(const struct panfrost_device *dev,
unsigned fb_width, unsigned fb_height,
unsigned vertex_count)
panfrost_tiler_get_polygon_list_size(unsigned fb_width, unsigned fb_height,
unsigned vertex_count, bool hierarchy)
{
if (!vertex_count)
return MALI_MIDGARD_TILER_MINIMUM_HEADER_SIZE + 4;
bool hierarchy = !dev->model->quirks.no_hierarchical_tiling;
unsigned hierarchy_mask = panfrost_choose_hierarchy_mask(
fb_width, fb_height, vertex_count, hierarchy);