summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-01-19 17:43:11 +0100
committerMarek Olšák <marek.olsak@amd.com>2016-01-22 15:02:40 +0100
commit2b66bc87d4dc50e7b97d3f4521767927fbf355a4 (patch)
treed440a4d61cad1220d17fede5f5b8b883a8f0bdbf /src/gallium/winsys
parent0d8e4f958f83e0b67f07030c661a30b4e7c19425 (diff)
downloadexternal_mesa3d-2b66bc87d4dc50e7b97d3f4521767927fbf355a4.zip
external_mesa3d-2b66bc87d4dc50e7b97d3f4521767927fbf355a4.tar.gz
external_mesa3d-2b66bc87d4dc50e7b97d3f4521767927fbf355a4.tar.bz2
winsys/amdgpu: compute num_good_compute_units correctly
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index 9835024..69df363 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -266,17 +266,12 @@ static boolean do_winsys_init(struct amdgpu_winsys *ws)
ws->info.r600_virtual_address = TRUE;
ws->info.r600_has_dma = dma.available_rings != 0;
- /* Guess what the maximum compute unit number is by looking at the mask
- * of enabled CUs.
- */
+ /* Get the number of good compute units. */
+ ws->info.num_good_compute_units = 0;
for (i = 0; i < ws->info.max_se; i++)
- for (j = 0; j < ws->info.max_sh_per_se; j++) {
- unsigned max = util_last_bit(ws->amdinfo.cu_bitmap[i][j]);
-
- if (ws->info.num_good_compute_units < max)
- ws->info.num_good_compute_units = max;
- }
- ws->info.num_good_compute_units *= ws->info.max_se * ws->info.max_sh_per_se;
+ for (j = 0; j < ws->info.max_sh_per_se; j++)
+ ws->info.num_good_compute_units +=
+ util_bitcount(ws->amdinfo.cu_bitmap[i][j]);
memcpy(ws->info.si_tile_mode_array, ws->amdinfo.gb_tile_mode,
sizeof(ws->amdinfo.gb_tile_mode));