panfrost: add device querying for AFRC support

As of now, only Mali-G310 supports ARM fixed-rate compression but
it should be advertised in bit 25 of TEXTURE_FEATURES_0

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28813>
This commit is contained in:
Louis-Francis Ratté-Boulianne 2023-10-31 15:59:44 -04:00 committed by Marge Bot
parent a7b489f7be
commit fb95e8ada0
4 changed files with 14 additions and 0 deletions

View file

@ -100,6 +100,7 @@ panfrost_open_device(void *memctx, int fd, struct panfrost_device *dev)
panfrost_query_compressed_formats(&dev->kmod.props);
dev->tiler_features = panfrost_query_tiler_features(&dev->kmod.props);
dev->has_afbc = panfrost_query_afbc(&dev->kmod.props);
dev->has_afrc = panfrost_query_afrc(&dev->kmod.props);
dev->formats = panfrost_format_table(dev->arch);
dev->blendable_formats = panfrost_blendable_format_table(dev->arch);

View file

@ -111,6 +111,7 @@ struct panfrost_device {
struct panfrost_tiler_features tiler_features;
const struct panfrost_model *model;
bool has_afbc;
bool has_afrc;
/* Table of formats, indexed by a PIPE format */
const struct panfrost_format *formats;

View file

@ -178,6 +178,16 @@ panfrost_query_afbc(const struct pan_kmod_dev_props *props)
return (pan_arch(props->gpu_prod_id) >= 5) && (reg == 0);
}
/* Check for AFRC hardware support. AFRC is introduced in v10. Implementations
* may omit it, signaled in bit 25 of TEXTURE_FEATURES_0 property. */
bool
panfrost_query_afrc(const struct pan_kmod_dev_props *props)
{
return (pan_arch(props->gpu_prod_id) >= 10) &&
(props->texture_features[0] & (1 << 25));
}
/*
* To pipeline multiple tiles, a given tile may use at most half of the tile
* buffer. This function returns the optimal size (assuming pipelining).

View file

@ -94,6 +94,8 @@ unsigned panfrost_query_core_count(const struct pan_kmod_dev_props *props,
bool panfrost_query_afbc(const struct pan_kmod_dev_props *props);
bool panfrost_query_afrc(const struct pan_kmod_dev_props *props);
unsigned panfrost_query_optimal_tib_size(const struct panfrost_model *model);
uint64_t panfrost_clamp_to_usable_va_range(const struct pan_kmod_dev *dev,