From d7def3ccdf4ac7f436dcd27342851179b68bee42 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 18 Jan 2024 13:10:14 +0100 Subject: [PATCH] panfrost: add pan_force_afbc_packing driconf This is useful for forcing AFBC-P to be used in applications where it's know to work well. This can significantly reduce memory consumption and bandwidth, leading more applications working in the first place, and also better performance. Acked-by: Boris Brezillon Part-of: --- src/gallium/drivers/panfrost/driinfo_panfrost.h | 3 +++ src/gallium/drivers/panfrost/pan_screen.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/gallium/drivers/panfrost/driinfo_panfrost.h b/src/gallium/drivers/panfrost/driinfo_panfrost.h index 031726ba6b1..2c11602a95d 100644 --- a/src/gallium/drivers/panfrost/driinfo_panfrost.h +++ b/src/gallium/drivers/panfrost/driinfo_panfrost.h @@ -1 +1,4 @@ /* panfrost specific driconf options */ +DRI_CONF_SECTION_PERFORMANCE + DRI_CONF_OPT_B(pan_force_afbc_packing, false, "Use AFBC-P for textures") +DRI_CONF_SECTION_END diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index c8894dbd8f1..23bd6de2627 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -857,6 +857,9 @@ panfrost_create_screen(int fd, const struct pipe_screen_config *config, } screen->force_afbc_packing = dev->debug & PAN_DBG_FORCE_PACK; + if (!screen->force_afbc_packing) + screen->force_afbc_packing = driQueryOptionb(config->options, + "pan_force_afbc_packing"); dev->ro = ro;