Skip to contentSkip to conversation

drm/amdgpu: simplify gds_compute_max_wave_id computation

PATCH In review Marek Olšák 2 participants 3 messages Sep 25, 2019 – Oct 7, 2019 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: simplify gds_compute_max_wave_id computation

From: Marek Olšák <[email protected]>

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +5 -8
index ca01643fa0c8..73cd254449b3 100644
@@ -5275,29 +5275,26 @@ static void gfx_v10_0_set_rlc_funcs(struct amdgpu_device *adev)
 	case CHIP_NAVI12:
 		adev->gfx.rlc.funcs = &gfx_v10_0_rlc_funcs;
 		break;
 	default:
 		break;
 	}
 }
 
 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;
 }
 
 static void gfx_v10_0_set_user_wgp_inactive_bitmap_per_sh(struct amdgpu_device *adev,
 							  u32 bitmap)
 {
 	u32 data;
 
 	if (!bitmap)
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20190925203502.30996-1-maraeo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

ping

Quoted 48 lines · Marek Olšák

From: Marek Olšák <[email protected]>

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +5 -8
index ca01643fa0c8..73cd254449b3 100644
@@ -5275,29 +5275,26 @@ static void gfx_v10_0_set_rlc_funcs(struct
 amdgpu_device *adev)
        case CHIP_NAVI12:
                adev->gfx.rlc.funcs = &gfx_v10_0_rlc_funcs;
                break;
        default:
                break;
        }
 }
 
 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;
 }
 
 static void gfx_v10_0_set_user_wgp_inactive_bitmap_per_sh(struct
 amdgpu_device *adev,
                                                          u32 bitmap)
 {
        u32 data;
Quoted 5 lines

if (!bitmap)
--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CAAxE2A7rOodqyZVWCQYcbx6Xsc=XQ_EsVCF+G_tFOWcB7omMmA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

Reviewed-by
#4 lore raw
Quoted 50 lines · Marek Olšák

ping

Quoted 46 lines · Marek Olšák

From: Marek Olšák <[email protected]>

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +5 -8
index ca01643fa0c8..73cd254449b3 100644
@@ -5275,29 +5275,26 @@ static void gfx_v10_0_set_rlc_funcs(struct amdgpu_device *adev)
        case CHIP_NAVI12:
                adev->gfx.rlc.funcs = &gfx_v10_0_rlc_funcs;
                break;
        default:
                break;
        }
 }
 
 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;
 }
 
 static void gfx_v10_0_set_user_wgp_inactive_bitmap_per_sh(struct amdgpu_device *adev,
                                                          u32 bitmap)
 {
        u32 data;
 
Quoted 8 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -1
        if (!bitmap)
--

2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx