From 09a2c74cfdd0fd4795b0bdcfe62acda6336e824c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 9 Dec 2019 16:02:03 -0500 Subject: [PATCH] panfrost: Add panfrost_model_name helper This gives us a string representation of a GPU ID. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/encoder/pan_encoder.h | 2 ++ src/panfrost/encoder/pan_props.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) 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"); + } +} -- 2.30.2