Skip to content
Snippets Groups Projects
Commit 3e168b97 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig
Browse files

panfrost: Detect implementations support AFBC


AFBC is an optional feature on Bifrost. If it is missing, a bit will be
set in the poorly named AFBC_FEATURES register. Check this so we can act
appropriately.

Signed-off-by: default avatarAlyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <mesa/mesa!13497>
parent ebe9494b
No related branches found
No related tags found
No related merge requests found
......@@ -160,6 +160,7 @@ struct panfrost_device {
unsigned thread_tls_alloc;
struct panfrost_tiler_features tiler_features;
unsigned quirks;
bool has_afbc;
/* Table of formats, indexed by a PIPE format */
const struct panfrost_format *formats;
......
......@@ -214,6 +214,19 @@ panfrost_model_name(unsigned gpu_id)
}
}
/* Check for AFBC hardware support. AFBC is introduced in v5. Implementations
* may omit it, signaled as a nonzero value in the AFBC_FEATURES property. */
static bool
panfrost_query_afbc(int fd, unsigned arch)
{
unsigned reg = panfrost_query_raw(fd,
DRM_PANFROST_PARAM_AFBC_FEATURES,
false, 0);
return (arch >= 5) && (reg == 0);
}
void
panfrost_open_device(void *memctx, int fd, struct panfrost_device *dev)
{
......@@ -228,6 +241,7 @@ panfrost_open_device(void *memctx, int fd, struct panfrost_device *dev)
dev->quirks = panfrost_get_quirks(dev->gpu_id, revision);
dev->compressed_formats = panfrost_query_compressed_formats(fd);
dev->tiler_features = panfrost_query_tiler_features(fd);
dev->has_afbc = panfrost_query_afbc(fd, dev->arch);
if (dev->quirks & HAS_SWIZZLES)
dev->formats = panfrost_pipe_format_v6;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment