From 8e1135cf3948f5272d77b9e8f5f866d849f1cbd7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 1 Aug 2022 18:56:49 -0400 Subject: [PATCH] pan/decode: Fix overrun decoding planes We need to calculate the # of descriptors like we do on Midgard. Fixes: ae9316f8128 ("pan/decode: Decode Valhall surface descriptor") Signed-off-by: Alyssa Rosenzweig Part-of: (cherry picked from commit 07e9543270f5d89f2767e4152ef7321ee32ca614) --- .pick_status.json | 2 +- src/panfrost/lib/genxml/decode.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index aa13bfbaa71..6aa59c644d4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3910,7 +3910,7 @@ "description": "pan/decode: Fix overrun decoding planes", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ae9316f8128bec52c3ed5f06f341103241af24e1" }, diff --git a/src/panfrost/lib/genxml/decode.c b/src/panfrost/lib/genxml/decode.c index ca1da202443..31d654f190a 100644 --- a/src/panfrost/lib/genxml/decode.c +++ b/src/panfrost/lib/genxml/decode.c @@ -712,8 +712,13 @@ pandecode_bifrost_texture( pandecode_indent++; #if PAN_ARCH >= 9 - /* TODO: count */ - for (unsigned i = 0; i < 4; ++i) + int plane_count = temp.levels * temp.array_size; + + /* Miptree for each face */ + if (temp.dimension == MALI_TEXTURE_DIMENSION_CUBE) + plane_count *= 6; + + for (unsigned i = 0; i < plane_count; ++i) DUMP_ADDR(PLANE, temp.surfaces + i * pan_size(PLANE), "Plane %u:\n", i); #else struct pandecode_mapped_memory *tmem = pandecode_find_mapped_gpu_mem_containing(temp.surfaces);