intel/tools: Print memory info in intel_dev_info
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17075>
This commit is contained in:
parent
eaf2a35a76
commit
a7127fbc4c
|
@ -48,6 +48,34 @@ error(char *fmt, ...)
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
static void
|
||||
print_regions_info(const struct intel_device_info *devinfo)
|
||||
{
|
||||
if (devinfo->mem.sram.mappable.size > 0) {
|
||||
fprintf(stdout, " sram:\n");
|
||||
if (devinfo->mem.use_class_instance) {
|
||||
fprintf(stdout, " class: %d; instance: %d\n",
|
||||
devinfo->mem.sram.mem_class, devinfo->mem.sram.mem_instance);
|
||||
}
|
||||
fprintf(stdout, " mappable: %" PRId64 "; ",
|
||||
devinfo->mem.sram.mappable.size);
|
||||
fprintf(stdout, "free: %" PRId64 "\n",
|
||||
devinfo->mem.sram.mappable.free);
|
||||
}
|
||||
|
||||
if (devinfo->mem.vram.mappable.size > 0) {
|
||||
fprintf(stdout, " vram:\n");
|
||||
if (devinfo->mem.use_class_instance) {
|
||||
fprintf(stdout, " class: %d; instance: %d\n",
|
||||
devinfo->mem.vram.mem_class, devinfo->mem.vram.mem_instance);
|
||||
}
|
||||
fprintf(stdout, " mappable: %" PRId64 "; ",
|
||||
devinfo->mem.vram.mappable.size);
|
||||
fprintf(stdout, "free: %" PRId64 "\n",
|
||||
devinfo->mem.vram.mappable.free);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
@ -131,6 +159,8 @@ main(int argc, char *argv[])
|
|||
fprintf(stdout, " max CS threads: %u\n", devinfo.max_cs_threads);
|
||||
fprintf(stdout, " timestamp frequency: %" PRIu64 " / %.4f ns\n",
|
||||
devinfo.timestamp_frequency, 1000000000.0 / devinfo.timestamp_frequency);
|
||||
|
||||
print_regions_info(&devinfo);
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
|
Loading…
Reference in New Issue