[v0.99] Show new Intel logo only when the CPU was released after Intel started using the new logo

This commit is contained in:
Dr-Noob
2021-08-18 12:31:59 +02:00
parent d8c69e1b9b
commit a302a4508c
3 changed files with 25 additions and 4 deletions

View File

@@ -144,6 +144,7 @@ struct ascii {
struct attribute** attributes;
uint32_t n_attributes_set;
uint32_t additional_spaces;
bool new_intel_logo;
VENDOR vendor;
STYLE style;
};
@@ -260,10 +261,18 @@ void choose_ascii_art(struct ascii* art, struct color** cs, struct terminal* ter
// 1. Choose logo
#ifdef ARCH_X86
if(art->vendor == CPU_VENDOR_INTEL) {
if(term != NULL && ascii_fits_screen(term->w, logo_intel_l, lf))
art->art = &logo_intel_l;
else
art->art = &logo_intel;
if(art->new_intel_logo) {
if(term != NULL && ascii_fits_screen(term->w, logo_intel_l_new, lf))
art->art = &logo_intel_l_new;
else
art->art = &logo_intel_new;
}
else {
if(term != NULL && ascii_fits_screen(term->w, logo_intel_l, lf))
art->art = &logo_intel_l;
else
art->art = &logo_intel;
}
}
else if(art->vendor == CPU_VENDOR_AMD) {
if(term != NULL && ascii_fits_screen(term->w, logo_amd_l, lf))
@@ -428,6 +437,7 @@ bool print_cpufetch_x86(struct cpuInfo* cpu, STYLE s, struct color** cs, struct
if(art == NULL)
return false;
art->new_intel_logo = choose_new_intel_logo(cpu);
char* uarch = get_str_uarch(cpu);
char* manufacturing_process = get_str_process(cpu);
char* sockets = get_str_sockets(cpu->topo);

View File

@@ -399,6 +399,16 @@ int get_number_of_vpus(struct cpuInfo* cpu) {
}
}
bool choose_new_intel_logo(struct cpuInfo* cpu) {
switch(cpu->arch->uarch) {
case UARCH_ROCKET_LAKE:
// TODO: case UARCH_TIGER_LAKE: missing?
return true;
default:
return false;
}
}
char* get_str_uarch(struct cpuInfo* cpu) {
return cpu->arch->uarch_str;
}

View File

@@ -11,6 +11,7 @@ struct uarch* get_uarch_from_cpuid(struct cpuInfo* cpu, uint32_t ef, uint32_t f,
bool vpus_are_AVX512(struct cpuInfo* cpu);
bool is_knights_landing(struct cpuInfo* cpu);
int get_number_of_vpus(struct cpuInfo* cpu);
bool choose_new_intel_logo(struct cpuInfo* cpu);
char* get_str_uarch(struct cpuInfo* cpu);
char* get_str_process(struct cpuInfo* cpu);
void free_uarch_struct(struct uarch* arch);