panfrost: Prepare pan_encoder.h to per-gen XML

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12935>
This commit is contained in:
Boris Brezillon
2021-08-06 14:09:43 +02:00
parent f36fd4ac4c
commit a865a4a789
2 changed files with 27 additions and 26 deletions
+27 -7
View File
@@ -27,10 +27,14 @@
#ifndef __PAN_ENCODER_H
#define __PAN_ENCODER_H
#include "util/macros.h"
#include "panfrost-quirks.h"
#include <stdbool.h>
#include "util/format/u_format.h"
#include "pan_bo.h"
#include "gen_macros.h"
#include "pan_device.h"
/* Indices for named (non-XFB) varyings that are present. These are packed
* tightly so they correspond to a bitfield present (P) indexed by (1 <<
@@ -58,13 +62,6 @@ enum pan_special_varying {
/* Tiler structure size computation */
struct panfrost_device;
unsigned
panfrost_tiler_get_polygon_list_size(const struct panfrost_device *dev,
unsigned fb_width, unsigned fb_height,
bool has_draws);
unsigned
panfrost_tiler_header_size(unsigned width, unsigned height, unsigned mask, bool hierarchy);
@@ -76,6 +73,24 @@ panfrost_choose_hierarchy_mask(
unsigned width, unsigned height,
unsigned vertex_count, bool hierarchy);
#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,
bool has_draws)
{
if (!has_draws)
return MALI_MIDGARD_TILER_MINIMUM_HEADER_SIZE + 4;
bool hierarchy = !(dev->quirks & MIDGARD_NO_HIER_TILING);
unsigned hierarchy_mask =
panfrost_choose_hierarchy_mask(fb_width, fb_height, 1, hierarchy);
return panfrost_tiler_full_size(fb_width, fb_height, hierarchy_mask, hierarchy) +
panfrost_tiler_header_size(fb_width, fb_height, hierarchy_mask, hierarchy);
}
#endif
/* Stack sizes */
unsigned
@@ -97,8 +112,10 @@ panfrost_padded_vertex_count(unsigned vertex_count);
unsigned
panfrost_compute_magic_divisor(unsigned hw_divisor, unsigned *o_shift, unsigned *extra_flags);
#ifdef PAN_ARCH
/* Records for gl_VertexID and gl_InstanceID use special encodings on Midgard */
#if PAN_ARCH <= 5
static inline void
panfrost_vertex_id(unsigned padded_count,
struct mali_attribute_buffer_packed *attr,
@@ -137,6 +154,7 @@ panfrost_instance_id(unsigned padded_count,
}
}
}
#endif /* PAN_ARCH <= 5 */
/* Sampler comparison functions are flipped in OpenGL from the hardware, so we
* need to be able to flip accordingly */
@@ -234,4 +252,6 @@ panfrost_get_z_internal_format(enum pipe_format fmt)
}
}
#endif /* PAN_ARCH */
#endif
-19
View File
@@ -373,22 +373,3 @@ panfrost_choose_hierarchy_mask(
return 0xFF;
}
unsigned
panfrost_tiler_get_polygon_list_size(const struct panfrost_device *dev,
unsigned fb_width, unsigned fb_height,
bool has_draws)
{
if (pan_is_bifrost(dev))
return 0;
if (!has_draws)
return MALI_MIDGARD_TILER_MINIMUM_HEADER_SIZE + 4;
bool hierarchy = !(dev->quirks & MIDGARD_NO_HIER_TILING);
unsigned hierarchy_mask =
panfrost_choose_hierarchy_mask(fb_width, fb_height, 1, hierarchy);
return panfrost_tiler_full_size(fb_width, fb_height, hierarchy_mask, hierarchy) +
panfrost_tiler_header_size(fb_width, fb_height, hierarchy_mask, hierarchy);
}