Mesa (master): freedreno/gmemtool: make GMEM alignment per-gen

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 26 19:45:23 UTC 2020


Module: Mesa
Branch: master
Commit: b20663c5ba9523d24edfb6f1ce42561e36607f4a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b20663c5ba9523d24edfb6f1ce42561e36607f4a

Author: Rob Clark <robdclark at chromium.org>
Date:   Sat May 23 11:50:14 2020 -0700

freedreno/gmemtool: make GMEM alignment per-gen

`gmem_page_align` is generation specific (with the exception of a2xx
which has a different value for fast-clear).  So we should override the
value from the captured gmem_key according to the gpu we are emulating
for the purposes of calculating gmem config.

Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5189>

---

 src/gallium/drivers/freedreno/gmemtool.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/freedreno/gmemtool.c b/src/gallium/drivers/freedreno/gmemtool.c
index 9b68b28a919..5120797bbd4 100644
--- a/src/gallium/drivers/freedreno/gmemtool.c
+++ b/src/gallium/drivers/freedreno/gmemtool.c
@@ -77,6 +77,7 @@ struct gpu_info {
 	uint32_t gmem_alignw;
 	uint32_t gmem_alignh;
 	uint32_t num_vsc_pipes;
+	uint8_t  gmem_page_align;
 	uint32_t gmemsize_bytes;
 };
 
@@ -87,10 +88,10 @@ struct gpu_info {
 
 /* keep sorted by gpu name: */
 static const struct gpu_info gpu_infos[] = {
-	{ "a306", 307, 32, 32,  8, SZ_128K },
-	{ "a530", 530, 64, 32, 16, SZ_1M   },
-	{ "a618", 618, 32, 32, 32, SZ_512K },
-	{ "a630", 630, 32, 32, 32, SZ_1M   },
+	{ "a306", 307, 32, 32,  8, 4, SZ_128K },
+	{ "a530", 530, 64, 32, 16, 4, SZ_1M   },
+	{ "a618", 618, 32, 32, 32, 1, SZ_512K },
+	{ "a630", 630, 32, 32, 32, 1, SZ_1M   },
 };
 
 int
@@ -132,8 +133,9 @@ main(int argc, char **argv)
 
 	/* And finally run thru all the GMEM keys: */
 	for (int i = 0; i < ARRAY_SIZE(keys); i++) {
-		struct fd_gmem_stateobj *gmem =
-				gmem_stateobj_init(&screen, (void *)&keys[i]);
+		struct gmem_key key = keys[i];
+		key.gmem_page_align = gpu_info->gmem_page_align;
+		struct fd_gmem_stateobj *gmem = gmem_stateobj_init(&screen, &key);
 		dump_gmem_state(gmem);
 		ralloc_free(gmem);
 	}



More information about the mesa-commit mailing list