From a9bdf58c36e6d520b3bfccfcfa06543e932374a6 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 8 Nov 2023 10:51:26 -0800 Subject: [PATCH] freedreno/a6xx: Assume MOD_INVALID imports are linear Without !25945 we must assume imports with invalid modifier are linear. When both sides support metadata, we can promote the modifier. Fixes: 33de58154f80 ("freedreno: Handle DRM_FORMAT_MOD_QCOM_TILED3 import") Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/a6xx/fd6_resource.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_resource.cc b/src/gallium/drivers/freedreno/a6xx/fd6_resource.cc index dcb412033cd..539aa707321 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_resource.cc +++ b/src/gallium/drivers/freedreno/a6xx/fd6_resource.cc @@ -323,13 +323,17 @@ fd6_layout_resource_for_modifier(struct fd_resource *rsc, uint64_t modifier) } return 0; case DRM_FORMAT_MOD_QCOM_TILED3: + rsc->layout.tile_mode = fd6_tile_mode(&rsc->b.b); + FALLTHROUGH; case DRM_FORMAT_MOD_INVALID: + /* For now, without buffer metadata, we must assume that buffers + * imported with INVALID modifier are linear + */ if (can_do_ubwc(&rsc->b.b)) { perf_debug("%" PRSC_FMT ": not UBWC: imported with DRM_FORMAT_MOD_INVALID!", PRSC_ARGS(&rsc->b.b)); } - rsc->layout.tile_mode = fd6_tile_mode(&rsc->b.b); return 0; default: return -1;