panfrost: Don't pass a panfrost_device to panfrost_format_supports_afbc()

Pass the arch instead.

While at it, make this helper a static inline function defined in
pan_texture.h.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26698>
This commit is contained in:
Boris Brezillon
2023-12-05 19:09:55 +01:00
committed by Marge Bot
parent 0d76cb0268
commit a758e95077
5 changed files with 12 additions and 15 deletions
+1 -1
View File
@@ -334,7 +334,7 @@ panfrost_should_afbc(struct panfrost_device *dev,
return false;
/* Only a small selection of formats are AFBC'able */
if (!panfrost_format_supports_afbc(dev, fmt))
if (!panfrost_format_supports_afbc(dev->arch, fmt))
return false;
/* AFBC does not support layered (GLES3 style) multisampling. Use
+2 -1
View File
@@ -616,7 +616,8 @@ panfrost_walk_dmabuf_modifiers(struct pipe_screen *screen,
{
/* Query AFBC status */
struct panfrost_device *dev = pan_device(screen);
bool afbc = dev->has_afbc && panfrost_format_supports_afbc(dev, format);
bool afbc =
dev->has_afbc && panfrost_format_supports_afbc(dev->arch, format);
bool ytr = panfrost_afbc_can_ytr(format);
bool tiled_afbc = panfrost_afbc_can_tile(dev);
-9
View File
@@ -163,15 +163,6 @@ panfrost_afbc_format(unsigned arch, enum pipe_format format)
/* clang-format on */
}
/* A format may be compressed as AFBC if it has an AFBC internal format */
bool
panfrost_format_supports_afbc(const struct panfrost_device *dev,
enum pipe_format format)
{
return panfrost_afbc_format(dev->arch, format) != PAN_AFBC_MODE_INVALID;
}
/* The lossless colour transform (AFBC_FORMAT_MOD_YTR) requires RGB. */
bool
+8 -3
View File
@@ -224,11 +224,16 @@ enum pan_afbc_mode {
PAN_AFBC_MODE_INVALID
};
bool panfrost_format_supports_afbc(const struct panfrost_device *dev,
enum pipe_format format);
enum pan_afbc_mode panfrost_afbc_format(unsigned arch, enum pipe_format format);
/* A format may be compressed as AFBC if it has an AFBC internal format */
static inline bool
panfrost_format_supports_afbc(unsigned arch, enum pipe_format format)
{
return panfrost_afbc_format(arch, format) != PAN_AFBC_MODE_INVALID;
}
#define AFBC_HEADER_BYTES_PER_TILE 16
bool panfrost_afbc_can_ytr(enum pipe_format format);
+1 -1
View File
@@ -166,7 +166,7 @@ panvk_image_select_mod(VkDevice _device, const VkImageCreateInfo *pCreateInfo,
return DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED;
/* Only a small selection of formats are AFBC'able */
if (!panfrost_format_supports_afbc(pdev, fmt))
if (!panfrost_format_supports_afbc(pdev->arch, fmt))
return DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED;
/* 3D AFBC is only supported on Bifrost v7+. It's supposed to