aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-12-09 16:02:03 -0500
committerAlyssa Rosenzweig <[email protected]>2019-12-13 10:26:35 -0500
commit09a2c74cfdd0fd4795b0bdcfe62acda6336e824c (patch)
tree57bde1c7c7f5b7c153c1495522650514e5c1746b
parenta2152891768aa5dcf7908cd80b7ab4912e7ce63e (diff)
panfrost: Add panfrost_model_name helper
This gives us a string representation of a GPU ID. Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/panfrost/encoder/pan_encoder.h2
-rw-r--r--src/panfrost/encoder/pan_props.c17
2 files changed, 19 insertions, 0 deletions
diff --git a/src/panfrost/encoder/pan_encoder.h b/src/panfrost/encoder/pan_encoder.h
index 01cec263bed..90fbb91a0c7 100644
--- a/src/panfrost/encoder/pan_encoder.h
+++ b/src/panfrost/encoder/pan_encoder.h
@@ -84,4 +84,6 @@ unsigned panfrost_query_gpu_version(int fd);
unsigned panfrost_query_core_count(int fd);
unsigned panfrost_query_thread_tls_alloc(int fd);
+const char * panfrost_model_name(unsigned gpu_id);
+
#endif
diff --git a/src/panfrost/encoder/pan_props.c b/src/panfrost/encoder/pan_props.c
index e8e8986f2f9..9ab28928756 100644
--- a/src/panfrost/encoder/pan_props.c
+++ b/src/panfrost/encoder/pan_props.c
@@ -82,4 +82,21 @@ panfrost_query_thread_tls_alloc(int fd)
DRM_PANFROST_PARAM_THREAD_TLS_ALLOC, false, 1024);
}
+/* Given a GPU ID like 0x860, return a prettified model name */
+const char *
+panfrost_model_name(unsigned gpu_id)
+{
+ switch (gpu_id) {
+ case 0x600: return "Mali T600 (Panfrost)";
+ case 0x620: return "Mali T620 (Panfrost)";
+ case 0x720: return "Mali T720 (Panfrost)";
+ case 0x820: return "Mali T820 (Panfrost)";
+ case 0x830: return "Mali T830 (Panfrost)";
+ case 0x750: return "Mali T760 (Panfrost)";
+ case 0x860: return "Mali T860 (Panfrost)";
+ case 0x880: return "Mali T880 (Panfrost)";
+ default:
+ unreachable("Invalid GPU ID");
+ }
+}