]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu: simplify gds_compute_max_wave_id computation
authorMarek Olšák <marek.olsak@amd.com>
Wed, 25 Sep 2019 19:50:17 +0000 (15:50 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 11 Oct 2019 00:23:35 +0000 (19:23 -0500)
Use asic constants.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

index 0fcea94f0a4bd89670ac1fb0b867957ed669029e..b2ad928f60abd353096f632a4be1f84da5def7fc 100644 (file)
@@ -5283,15 +5283,12 @@ static void gfx_v10_0_set_rlc_funcs(struct amdgpu_device *adev)
 
 static void gfx_v10_0_set_gds_init(struct amdgpu_device *adev)
 {
-       /* init asic gds info */
-       switch (adev->asic_type) {
-       case CHIP_NAVI10:
-       default:
-               adev->gds.gds_size = 0x10000;
-               adev->gds.gds_compute_max_wave_id = 0x4ff;
-               break;
-       }
+       unsigned total_cu = adev->gfx.config.max_cu_per_sh *
+                           adev->gfx.config.max_sh_per_se *
+                           adev->gfx.config.max_shader_engines;
 
+       adev->gds.gds_size = 0x10000;
+       adev->gds.gds_compute_max_wave_id = total_cu * 32 - 1;
        adev->gds.gws_size = 64;
        adev->gds.oa_size = 16;
 }