mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-25 05:50:25 +01:00
amd: remove radeon_info::dev_filename
Instead, we can pass the file descriptor to ac_print_gpu_info(). Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38546>
This commit is contained in:
parent
80ab1de4be
commit
8777894d3e
5 changed files with 12 additions and 11 deletions
|
|
@ -595,10 +595,6 @@ ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info,
|
|||
for (unsigned i = 0; info->name[i] && i < ARRAY_SIZE(info->lowercase_name) - 1; i++)
|
||||
info->lowercase_name[i] = tolower(info->name[i]);
|
||||
|
||||
char proc_fd[64];
|
||||
snprintf(proc_fd, sizeof(proc_fd), "/proc/self/fd/%u", fd);
|
||||
UNUSED int _result = readlink(proc_fd, info->dev_filename, sizeof(info->dev_filename));
|
||||
|
||||
#define VCN_IP_VERSION(mj, mn, rv) (((mj) << 16) | ((mn) << 8) | (rv))
|
||||
|
||||
for (unsigned i = AMD_IP_VCN_DEC; i <= AMD_IP_VCN_JPEG; ++i) {
|
||||
|
|
@ -1646,12 +1642,18 @@ void ac_compute_device_uuid(const struct radeon_info *info, char *uuid, size_t s
|
|||
uint_uuid[3] = info->pci.func;
|
||||
}
|
||||
|
||||
void ac_print_gpu_info(const struct radeon_info *info, FILE *f)
|
||||
void ac_print_gpu_info(FILE *f, const struct radeon_info *info, int fd)
|
||||
{
|
||||
fprintf(f, "Device info:\n");
|
||||
fprintf(f, " name = %s\n", info->name);
|
||||
fprintf(f, " marketing_name = %s\n", info->marketing_name);
|
||||
fprintf(f, " dev_filename = %s\n", info->dev_filename);
|
||||
|
||||
char proc_fd[32];
|
||||
char dev_filename[32];
|
||||
snprintf(proc_fd, sizeof(proc_fd), "/proc/self/fd/%u", fd);
|
||||
if (readlink(proc_fd, dev_filename, sizeof(dev_filename)) != -1)
|
||||
fprintf(f, " dev_filename = %s\n", dev_filename);
|
||||
|
||||
fprintf(f, " num_se = %i\n", info->num_se);
|
||||
fprintf(f, " num_rb = %i\n", info->num_rb);
|
||||
fprintf(f, " num_cu = %i\n", info->num_cu);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ struct radeon_info {
|
|||
const char *name;
|
||||
char lowercase_name[32];
|
||||
const char *marketing_name;
|
||||
char dev_filename[32];
|
||||
uint32_t num_se; /* only enabled SEs */
|
||||
uint32_t num_rb; /* only enabled RBs */
|
||||
uint32_t num_cu; /* only enabled CUs */
|
||||
|
|
@ -358,7 +357,7 @@ enum ac_query_gpu_info_result ac_query_gpu_info(int fd, void *dev_p, struct rade
|
|||
void ac_compute_driver_uuid(char *uuid, size_t size);
|
||||
|
||||
void ac_compute_device_uuid(const struct radeon_info *info, char *uuid, size_t size);
|
||||
void ac_print_gpu_info(const struct radeon_info *info, FILE *f);
|
||||
void ac_print_gpu_info(FILE *f, const struct radeon_info *info, int fd);
|
||||
int ac_get_gs_table_depth(enum amd_gfx_level gfx_level, enum radeon_family family);
|
||||
void ac_get_raster_config(const struct radeon_info *info, uint32_t *raster_config_p,
|
||||
uint32_t *raster_config_1_p, uint32_t *se_tile_repeat_p);
|
||||
|
|
|
|||
|
|
@ -1047,7 +1047,7 @@ radv_check_gpu_hangs(struct radv_queue *queue, const struct radv_winsys_submit_i
|
|||
break;
|
||||
case RADV_DEVICE_FAULT_CHUNK_GPU_INFO:
|
||||
radv_dump_device_name(device, f);
|
||||
ac_print_gpu_info(&pdev->info, f);
|
||||
ac_print_gpu_info(f, &pdev->info, pdev->local_fd);
|
||||
break;
|
||||
case RADV_DEVICE_FAULT_CHUNK_DMESG:
|
||||
radv_dump_dmesg(f);
|
||||
|
|
|
|||
|
|
@ -2494,7 +2494,7 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm
|
|||
radv_get_physical_device_properties(pdev);
|
||||
|
||||
if ((instance->debug_flags & RADV_DEBUG_INFO))
|
||||
ac_print_gpu_info(&pdev->info, stdout);
|
||||
ac_print_gpu_info(stdout, &pdev->info, pdev->local_fd);
|
||||
|
||||
radv_init_physical_device_decoder(pdev);
|
||||
radv_init_physical_device_encoder(pdev);
|
||||
|
|
|
|||
|
|
@ -1416,7 +1416,7 @@ static struct pipe_screen *radeonsi_screen_create_impl(struct radeon_winsys *ws,
|
|||
si_init_screen_caps(sscreen);
|
||||
|
||||
if (sscreen->debug_flags & DBG(INFO))
|
||||
ac_print_gpu_info(&sscreen->info, stdout);
|
||||
ac_print_gpu_info(stdout, &sscreen->info, ws->get_fd(ws));
|
||||
|
||||
slab_create_parent(&sscreen->pool_transfers, sizeof(struct si_transfer), 64);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue