panfrost: Take panfrost_dev for AFBC selection

This appears to be architecture dependent.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>
This commit is contained in:
Alyssa Rosenzweig 2021-02-16 22:47:01 -05:00 committed by Marge Bot
parent 6a5052d836
commit fa251afb82
4 changed files with 6 additions and 5 deletions

View File

@ -514,7 +514,7 @@ panfrost_should_afbc(struct panfrost_device *dev, const struct panfrost_resource
return false;
/* Only a small selection of formats are AFBC'able */
if (!panfrost_format_supports_afbc(pres->internal_format))
if (!panfrost_format_supports_afbc(dev, pres->internal_format))
return false;
/* AFBC does not support layered (GLES3 style) multisampling. Use

View File

@ -534,11 +534,11 @@ panfrost_walk_dmabuf_modifiers(struct pipe_screen *screen,
int *external_only, int *out_count, uint64_t test_modifier)
{
/* Query AFBC status */
bool afbc = panfrost_format_supports_afbc(format);
struct panfrost_device *dev = pan_device(screen);
bool afbc = panfrost_format_supports_afbc(dev, format);
bool ytr = panfrost_afbc_can_ytr(format);
/* Don't advertise AFBC before T760 */
struct panfrost_device *dev = pan_device(screen);
afbc &= !(dev->quirks & MIDGARD_NO_AFBC);
/* XXX: AFBC scanout is broken on mainline RK3399 with older kernels */

View File

@ -76,7 +76,7 @@
* driver for debug/profiling, just always return false here. */
bool
panfrost_format_supports_afbc(enum pipe_format format)
panfrost_format_supports_afbc(const struct panfrost_device *dev, enum pipe_format format)
{
const struct util_format_description *desc =
util_format_description(format);

View File

@ -105,7 +105,8 @@ panfrost_compute_checksum_size(
/* AFBC */
bool
panfrost_format_supports_afbc(enum pipe_format format);
panfrost_format_supports_afbc(const struct panfrost_device *dev,
enum pipe_format format);
#define AFBC_HEADER_BYTES_PER_TILE 16