From: Alyssa Rosenzweig Date: Mon, 9 Dec 2019 21:02:03 +0000 (-0500) Subject: panfrost: Add panfrost_model_name helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=09a2c74cfdd0fd4795b0bdcfe62acda6336e824c;p=mesa.git panfrost: Add panfrost_model_name helper This gives us a string representation of a GPU ID. Signed-off-by: Alyssa Rosenzweig --- 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"); + } +}