mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 18:30:09 +01:00
panfrost: Pass arch instead of dev into afbc_format
For callers that have a device object, it's easy to pass dev->arch instead of dev. But this requires callers to have a reference to the device, which is tricky for callers that only have the arch via PAN_ARCH. Pass dev->arch instead of dev to accommodate them. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16800>
This commit is contained in:
parent
2cc2f217d4
commit
87dcdbdad6
3 changed files with 6 additions and 6 deletions
|
|
@ -1201,8 +1201,8 @@ pan_legalize_afbc_format(struct panfrost_context *ctx,
|
|||
if (!drm_is_afbc(rsrc->image.layout.modifier))
|
||||
return;
|
||||
|
||||
if (panfrost_afbc_format(dev, pan_blit_format(rsrc->base.format)) ==
|
||||
panfrost_afbc_format(dev, pan_blit_format(format)))
|
||||
if (panfrost_afbc_format(dev->arch, pan_blit_format(rsrc->base.format)) ==
|
||||
panfrost_afbc_format(dev->arch, pan_blit_format(format)))
|
||||
return;
|
||||
|
||||
pan_resource_modifier_convert(ctx, rsrc,
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
* cannot be compressed. */
|
||||
|
||||
enum pipe_format
|
||||
panfrost_afbc_format(const struct panfrost_device *dev, enum pipe_format format)
|
||||
panfrost_afbc_format(unsigned arch, enum pipe_format format)
|
||||
{
|
||||
/* Don't allow swizzled formats on v7 */
|
||||
switch (format) {
|
||||
|
|
@ -84,7 +84,7 @@ panfrost_afbc_format(const struct panfrost_device *dev, enum pipe_format format)
|
|||
case PIPE_FORMAT_A8B8G8R8_UNORM:
|
||||
case PIPE_FORMAT_B8G8R8_UNORM:
|
||||
case PIPE_FORMAT_B5G6R5_UNORM:
|
||||
if (dev->arch >= 7)
|
||||
if (arch >= 7)
|
||||
return PIPE_FORMAT_NONE;
|
||||
|
||||
break;
|
||||
|
|
@ -128,7 +128,7 @@ panfrost_afbc_format(const struct panfrost_device *dev, enum pipe_format format)
|
|||
bool
|
||||
panfrost_format_supports_afbc(const struct panfrost_device *dev, enum pipe_format format)
|
||||
{
|
||||
return panfrost_afbc_format(dev, format) != PIPE_FORMAT_NONE;
|
||||
return panfrost_afbc_format(dev->arch, format) != PIPE_FORMAT_NONE;
|
||||
}
|
||||
|
||||
/* The lossless colour transform (AFBC_FORMAT_MOD_YTR) requires RGB. */
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ panfrost_format_supports_afbc(const struct panfrost_device *dev,
|
|||
enum pipe_format format);
|
||||
|
||||
enum pipe_format
|
||||
panfrost_afbc_format(const struct panfrost_device *dev, enum pipe_format format);
|
||||
panfrost_afbc_format(unsigned arch, enum pipe_format format);
|
||||
|
||||
#define AFBC_HEADER_BYTES_PER_TILE 16
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue