From: Samuel Pitoiset Date: Mon, 2 Mar 2020 10:52:28 +0000 (+0100) Subject: ac: add ac_gpu_info::cu_mask to store bitmask of compute units X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b3ece36257dce867e996e2ca1060d3fabc4ea2de;p=mesa.git ac: add ac_gpu_info::cu_mask to store bitmask of compute units Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c index 67b09ed6ae4..4f928a8b51f 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -613,10 +613,13 @@ bool ac_query_gpu_info(int fd, void *dev_p, /* Get the number of good compute units. */ info->num_good_compute_units = 0; - for (i = 0; i < info->max_se; i++) - for (j = 0; j < info->max_sh_per_se; j++) + for (i = 0; i < info->max_se; i++) { + for (j = 0; j < info->max_sh_per_se; j++) { + info->cu_mask[i][j] = amdinfo->cu_bitmap[i][j]; info->num_good_compute_units += - util_bitcount(amdinfo->cu_bitmap[i][j]); + util_bitcount(info->cu_mask[i][j]); + } + } info->num_good_cu_per_sh = info->num_good_compute_units / (info->max_se * info->max_sh_per_se); diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h index 2794119365d..93cf323372c 100644 --- a/src/amd/common/ac_gpu_info.h +++ b/src/amd/common/ac_gpu_info.h @@ -152,6 +152,7 @@ struct radeon_info { bool has_scheduled_fence_dependency; /* Shader cores. */ + uint32_t cu_mask[4][2]; uint32_t r600_max_quad_pipes; /* wave size / 16 */ uint32_t max_shader_clock; uint32_t num_good_compute_units;