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:
committed by
Marge Bot
parent
0d76cb0268
commit
a758e95077
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user