panfrost: Add LINEAR debug option

Useful to cross off CPU texture tiling as the source of bugs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12328>
This commit is contained in:
Alyssa Rosenzweig 2021-08-11 10:50:44 -04:00 committed by Marge Bot
parent 3958f00215
commit 3ec5e2b6a7
3 changed files with 6 additions and 0 deletions

View file

@ -407,6 +407,10 @@ panfrost_best_modifier(struct panfrost_device *dev,
const struct panfrost_resource *pres,
enum pipe_format fmt)
{
/* Force linear textures when debugging tiling/compression */
if (unlikely(dev->debug & PAN_DBG_LINEAR))
return DRM_FORMAT_MOD_LINEAR;
if (panfrost_should_afbc(dev, pres, fmt)) {
uint64_t afbc =
AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 |

View file

@ -69,6 +69,7 @@ static const struct debug_named_value panfrost_debug_options[] = {
{"nocrc", PAN_DBG_NO_CRC, "Disable transaction elimination"},
{"msaa16", PAN_DBG_MSAA16, "Enable MSAA 8x and 16x support"},
{"noindirect", PAN_DBG_NOINDIRECT, "Emulate indirect draws on the CPU"},
{"linear", PAN_DBG_LINEAR, "Force linear textures"},
DEBUG_NAMED_VALUE_END
};

View file

@ -40,6 +40,7 @@
#define PAN_DBG_NO_AFBC 0x0200
#define PAN_DBG_MSAA16 0x0400
#define PAN_DBG_NOINDIRECT 0x0800
#define PAN_DBG_LINEAR 0x1000
unsigned
panfrost_translate_swizzle_4(const unsigned char swizzle[4]);