diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2021-08-06 14:09:43 +0200 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@collabora.com> | 2021-09-20 15:18:50 +0200 |
commit | a865a4a789ac21ebe7fbb6cc98a7e2a519e7e8c7 (patch) | |
tree | 79ab9f0d510e23f09921ca834ba6358c07ac56cb | |
parent | f36fd4ac4c631cfac2e40566f7644a2a401f6ee5 (diff) |
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>
-rw-r--r-- | src/panfrost/lib/pan_encoder.h | 34 | ||||
-rw-r--r-- | src/panfrost/lib/pan_tiler.c | 19 |
2 files changed, 27 insertions, 26 deletions
diff --git a/src/panfrost/lib/pan_encoder.h b/src/panfrost/lib/pan_encoder.h index aa65b159e38..1b80f3fc695 100644 --- a/src/panfrost/lib/pan_encoder.h +++ b/src/panfrost/lib/pan_encoder.h @@ -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 diff --git a/src/panfrost/lib/pan_tiler.c b/src/panfrost/lib/pan_tiler.c index e45240eeac6..a4c1ef9504a 100644 --- a/src/panfrost/lib/pan_tiler.c +++ b/src/panfrost/lib/pan_tiler.c @@ -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); -} |