From 3fbfd356af209391eb72b836d189fe9ab1f215dc Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 24 May 2022 16:21:12 -0400 Subject: [PATCH] panfrost: Add helper checking tiled AFBC support Tiled AFBC support was introduced with v7. Add a helper encoding this fact. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/lib/pan_afbc.c | 10 ++++++++++ src/panfrost/lib/pan_texture.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/panfrost/lib/pan_afbc.c b/src/panfrost/lib/pan_afbc.c index bd8b3e710e6..96f2c831f10 100644 --- a/src/panfrost/lib/pan_afbc.c +++ b/src/panfrost/lib/pan_afbc.c @@ -146,3 +146,13 @@ panfrost_afbc_can_ytr(enum pipe_format format) /* The fourth channel if it exists doesn't matter */ return desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB; } + +/* + * Check if the device supports AFBC with tiled headers (and hence also solid + * colour blocks). + */ +bool +panfrost_afbc_can_tile(const struct panfrost_device *dev) +{ + return (dev->arch >= 7); +} diff --git a/src/panfrost/lib/pan_texture.h b/src/panfrost/lib/pan_texture.h index 9c9a3f21ee9..c43bd250579 100644 --- a/src/panfrost/lib/pan_texture.h +++ b/src/panfrost/lib/pan_texture.h @@ -171,6 +171,9 @@ panfrost_afbc_format(const struct panfrost_device *dev, enum pipe_format format) bool panfrost_afbc_can_ytr(enum pipe_format format); +bool +panfrost_afbc_can_tile(const struct panfrost_device *dev); + /* * Represents the block size of a single plane. For AFBC, this represents the * superblock size. For u-interleaving, this represents the tile size.