Skip to content

Commit

Permalink
Merge pull request #958 from artyom-poptsov/avp-fix-embedded-intel-gr…
Browse files Browse the repository at this point in the history
…aphics-segfault
  • Loading branch information
aristocratos authored Nov 3, 2024
2 parents 2e7208d + 0ed4e9e commit df3f052
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/linux/intel_gpu_top/intel_name_lookup_shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ char *get_intel_device_name(const char *device_id) {
char full_name[256];
const struct intel_device_info *info = intel_get_device_info(devid);
if (info) {
strcpy(dev_name, info->codename);
dev_name[0] = toupper(dev_name[0]);
if (info->codename == NULL) {
strcpy(dev_name, "(unknown)");
} else {
strcpy(dev_name, info->codename);
dev_name[0] = toupper(dev_name[0]);
}
snprintf(full_name, sizeof(full_name), "Intel %s (Gen%u)", dev_name, info->graphics_ver);
return strdup(full_name);
}
return NULL;
}
}

0 comments on commit df3f052

Please sign in to comment.