From fa251afb821f70965f16e4a983b1bd0e4a977f08 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 16 Feb 2021 22:47:01 -0500 Subject: [PATCH] panfrost: Take panfrost_dev for AFBC selection This appears to be architecture dependent. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_resource.c | 2 +- src/gallium/drivers/panfrost/pan_screen.c | 4 ++-- src/panfrost/lib/pan_afbc.c | 2 +- src/panfrost/lib/pan_texture.h | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index ec1f37a..990ed28a 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -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 diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 11ff748..366c223 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -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 */ diff --git a/src/panfrost/lib/pan_afbc.c b/src/panfrost/lib/pan_afbc.c index 576f67f..a209900 100644 --- a/src/panfrost/lib/pan_afbc.c +++ b/src/panfrost/lib/pan_afbc.c @@ -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); diff --git a/src/panfrost/lib/pan_texture.h b/src/panfrost/lib/pan_texture.h index ba7d26f93..6a56a9b 100644 --- a/src/panfrost/lib/pan_texture.h +++ b/src/panfrost/lib/pan_texture.h @@ -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 -- 2.7.4