print some debug messages

This commit is contained in:
hoream
2024-08-27 23:24:50 +08:00
parent 834061428f
commit 3ff3fa69ce
2 changed files with 8 additions and 1 deletions

View File

@@ -227,7 +227,8 @@ void gpuinfo_v3d_populate_static_info(struct gpu_info *_gpu_info) {
snprintf(static_info->device_name, sizeof(static_info->device_name), "%s", dev_name);
SET_VALID(gpuinfo_device_name_valid, static_info->valid);
set_init_max_memory(gpu_info->mb);
if (gpu_info->mb >= 0)
set_init_max_memory(gpu_info->mb);
}
void gpuinfo_v3d_refresh_dynamic_info(struct gpu_info *_gpu_info) {

View File

@@ -61,8 +61,14 @@ static char bo_stats_file[50];
void set_debug_files(int card_id) {
snprintf(gpu_usage_file, sizeof(gpu_usage_file), "/sys/kernel/debug/dri/%d/gpu_usage", card_id);
if (access(gpu_usage_file, F_OK))
printf("%s is not available.\n", gpu_usage_file);
snprintf(gpu_pid_usage_file, sizeof(gpu_pid_usage_file), "/sys/kernel/debug/dri/%d/gpu_pid_usage", card_id);
if (access(gpu_pid_usage_file, F_OK))
printf("%s is not available.\n", gpu_pid_usage_file);
snprintf(bo_stats_file, sizeof(bo_stats_file), "/sys/kernel/debug/dri/%d/bo_stats", card_id);
if (access(bo_stats_file, F_OK))
printf("%s is not available.\n", bo_stats_file);
}
static int mbox_property(int mb, void *buf) {