Mesa (staging/19.2): ac: fix num_good_cu_per_sh for harvested chips

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 1 22:31:05 UTC 2019


Module: Mesa
Branch: staging/19.2
Commit: f5cccfe0e6439e44d386947450400d52d2836503
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f5cccfe0e6439e44d386947450400d52d2836503

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Thu Sep 19 22:16:51 2019 -0400

ac: fix num_good_cu_per_sh for harvested chips

Cc: 19.2 <mesa-stable at lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
(cherry picked from commit b7c2f7c5a6b21bccb7847ab03b7fba5c770e131c)

---

 src/amd/common/ac_gpu_info.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
index 4b49845360d..425330bcb28 100644
--- a/src/amd/common/ac_gpu_info.c
+++ b/src/amd/common/ac_gpu_info.c
@@ -458,6 +458,12 @@ bool ac_query_gpu_info(int fd, void *dev_p,
 	info->num_good_cu_per_sh = info->num_good_compute_units /
 				   (info->max_se * info->max_sh_per_se);
 
+	/* Round down to the nearest multiple of 2, because the hw can't
+	 * disable CUs. It can only disable whole WGPs (dual-CUs).
+	 */
+	if (info->chip_class >= GFX10)
+		info->num_good_cu_per_sh -= info->num_good_cu_per_sh % 2;
+
 	memcpy(info->si_tile_mode_array, amdinfo->gb_tile_mode,
 		sizeof(amdinfo->gb_tile_mode));
 	info->enabled_rb_mask = amdinfo->enabled_rb_pipes_mask;




More information about the mesa-commit mailing list