From 39db0d3af0ff9f7c55cdee988733fb0b3c0023c4 Mon Sep 17 00:00:00 2001 From: Burt P Date: Fri, 9 Aug 2019 12:54:10 -0500 Subject: name cleanup for x86 model strings and intel pci device strings x86 CPU: * Remove (R), (TM), etc * AMD: remove redundant "X2 Dual Core", "X4 Quad Core", etc * Move vendor to front if not already * Remove speed, as the actual speed is usually right next to it * Remove "CPU", "APU", "Processor" to shorten * Compress space Intel GPU: * Remove (R) * Abbreviate "Generation": "Gen" * Remove "Processor", "Controller", and "Device" to shorten * Compress space Some examples: x86 CPU: 'AMD Turion(tm) 64 Mobile Technology ML-32' ---> 'AMD Turion 64 Mobile ML-32' 'Cyrix MediaGXtm MMXtm Enhanced' ---> 'Cyrix MediaGX MMX Enhanced' 'Transmeta(tm) Crusoe(tm) Processor TM5800' ---> 'Transmeta Crusoe TM5800' 'VIA Nano X2 L4350 @ 1.6+ GHz' ---> 'VIA Nano X2 L4350' 'AMD Athlon(tm) 64 X2 Dual-Core Processor TK-53' ---> 'AMD Athlon 64 X2 TK-53' 'Embedded AMD Opteron(tm) Processor 23KS EE' ---> 'AMD Embedded Opteron 23KS EE' 'Intel(R) Atom(TM) x5-Z8300 CPU @ 1.44GHz' ---> 'Intel Atom x5-Z8300' 'Intel(R) Pentium(R) III CPU - S 1400MHz' ---> 'Intel Pentium III - S' 'Dual Core AMD Opteron(tm) Processor 165' ---> 'AMD Dual Core Opteron 165' 'Genuine Intel(R) CPU T1350 @ 1.86GHz' ---> 'Intel T1350' 'AMD Phenom(tm) 9350e Quad-Core Processor' ---> 'AMD Phenom 9350e Quad-Core' Intel GPU: 'Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Integrated Graphics Controller' ---> 'Atom/Celeron/Pentium x5-E8000/J3xxx/N3xxx Integrated Graphics' '4th Generation Core Processor Family Integrated Graphics Controller' ---> '4th Gen Core Family Integrated Graphics' 'Mobile GM965/GL960 Integrated Graphics Controller (secondary)' ---> 'Mobile GM965/GL960 Integrated Graphics (secondary)' 'Mobile 915GM/GMS/910GML Express Graphics Controller' ---> 'Mobile 915GM/GMS/910GML Express Graphics' Also: Fix/replace the appf() and SEQ() that were peppered about. Signed-off-by: Burt P --- hardinfo/gpu_util.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'hardinfo/gpu_util.c') diff --git a/hardinfo/gpu_util.c b/hardinfo/gpu_util.c index 17c79a73..6bf2ac2d 100644 --- a/hardinfo/gpu_util.c +++ b/hardinfo/gpu_util.c @@ -20,7 +20,7 @@ #include "hardinfo.h" #include "gpu_util.h" - +#include "nice_name.h" #include "cpu_util.h" /* for EMPIFNULL() */ nvgpu *nvgpu_new() { @@ -229,14 +229,12 @@ static void make_nice_name(gpud *s) { /* try and a get a "short name" for the vendor */ vendor_str = vendor_get_shortest_name(vendor_str); - /* These two former special cases are currently handled by the vendor_get_shortest_name() - * function well enough, but the notes are preserved here. */ - /* nvidia PCI strings are pretty nice already, - * just shorten the company name */ - // s->nice_name = g_strdup_printf("%s %s", "nVidia", device_str); - /* Intel Graphics may have very long names, like "Intel Corporation Seventh Generation Something Core Something Something Integrated Graphics Processor Revision Ninety-four" - * but for now at least shorten "Intel Corporation" to just "Intel" */ - // s->nice_name = g_strdup_printf("%s %s", "Intel", device_str); + if (strstr(vendor_str, "Intel")) { + gchar *device_str_clean = strdup(device_str); + nice_name_intel_gpu_device(device_str_clean); + s->nice_name = g_strdup_printf("%s %s", vendor_str, device_str_clean); + g_free(device_str_clean); + } if (strstr(vendor_str, "AMD")) { /* AMD PCI strings are crazy stupid because they use the exact same -- cgit v1.2.3 From d89c22611893dcc1cde0ff36d2490f2fd6273e57 Mon Sep 17 00:00:00 2001 From: Burt P Date: Fri, 9 Aug 2019 21:23:06 -0500 Subject: gpu_util: fix intel nice name Signed-off-by: Burt P --- hardinfo/gpu_util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'hardinfo/gpu_util.c') diff --git a/hardinfo/gpu_util.c b/hardinfo/gpu_util.c index 6bf2ac2d..b203b426 100644 --- a/hardinfo/gpu_util.c +++ b/hardinfo/gpu_util.c @@ -234,9 +234,7 @@ static void make_nice_name(gpud *s) { nice_name_intel_gpu_device(device_str_clean); s->nice_name = g_strdup_printf("%s %s", vendor_str, device_str_clean); g_free(device_str_clean); - } - - if (strstr(vendor_str, "AMD")) { + } else if (strstr(vendor_str, "AMD")) { /* AMD PCI strings are crazy stupid because they use the exact same * chip and device id for a zillion "different products" */ char *full_name = strdup(device_str); -- cgit v1.2.3