Skip to contentSkip to conversation

drm/amdgpu: convert code name to ip version for athub

PATCH In review Aaron Liu 3 participants 5 messages Jan 27, 2022

Subsystems (2)
lore
Share & tools
lore

Aaron Liu

author
#0 lore raw

PATCH 1/2 drm/amdgpu: convert code name to ip version for athub

Use IP version rather than codename for athub.

---
 drivers/gpu/drm/amd/amdgpu/athub_v1_0.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/athub_v1_0.c +7 -6
index 3ea557864320..88642e7ecdf4 100644
@@ -68,12 +68,13 @@ int athub_v1_0_set_clockgating(struct amdgpu_device *adev,
 	if (amdgpu_sriov_vf(adev))
 		return 0;
 
-	switch (adev->asic_type) {
-	case CHIP_VEGA10:
-	case CHIP_VEGA12:
-	case CHIP_VEGA20:
-	case CHIP_RAVEN:
-	case CHIP_RENOIR:
+	switch (adev->ip_versions[ATHUB_HWIP][0]) {
+	case IP_VERSION(9, 0, 0):
+	case IP_VERSION(9, 1, 0):
+	case IP_VERSION(9, 2, 0):
+	case IP_VERSION(9, 3, 0):
+	case IP_VERSION(9, 4, 0):
+	case IP_VERSION(1, 5, 0):
 		athub_update_medium_grain_clock_gating(adev,
 				state == AMD_CG_STATE_GATE);
 		athub_update_medium_grain_light_sleep(adev,
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/2 drm/amdgpu: add 1.3.1/2.4.0 athub CG support

This patch adds 1.3.1/2.4.0 athub clock gating support.

---
 drivers/gpu/drm/amd/amdgpu/athub_v2_0.c | 1 +
 drivers/gpu/drm/amd/amdgpu/athub_v2_1.c | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/athub_v2_0.c +1 -0
index ab6a07e5e8c4..a720436857b4 100644
@@ -78,6 +78,7 @@ int athub_v2_0_set_clockgating(struct amdgpu_device *adev,
 		return 0;
 
 	switch (adev->ip_versions[ATHUB_HWIP][0]) {
+	case IP_VERSION(1, 3, 1):
 	case IP_VERSION(2, 0, 0):
 	case IP_VERSION(2, 0, 2):
 		athub_v2_0_update_medium_grain_clock_gating(adev,
drivers/gpu/drm/amd/amdgpu/athub_v2_1.c +1 -0
index 2edefd10e56c..ad8e87d3d2cb 100644
@@ -74,6 +74,7 @@ int athub_v2_1_set_clockgating(struct amdgpu_device *adev,
 	case IP_VERSION(2, 1, 0):
 	case IP_VERSION(2, 1, 1):
 	case IP_VERSION(2, 1, 2):
+	case IP_VERSION(2, 4, 0):
 		athub_v2_1_update_medium_grain_clock_gating(adev, state == AMD_CG_STATE_GATE);
 		athub_v2_1_update_medium_grain_light_sleep(adev, state == AMD_CG_STATE_GATE);
 		break;
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 2/2] drm/amdgpu: add 1.3.1/2.4.0 athub CG support

Quoted 3 lines · Aaron

This patch adds 1.3.1/2.4.0 athub clock gating support.

Series are Reviewed-by: Huang Rui <[email protected]>

Quoted 32 lines
---
 drivers/gpu/drm/amd/amdgpu/athub_v2_0.c | 1 +
 drivers/gpu/drm/amd/amdgpu/athub_v2_1.c | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/athub_v2_0.c +1 -0
index ab6a07e5e8c4..a720436857b4 100644
@@ -78,6 +78,7 @@ int athub_v2_0_set_clockgating(struct amdgpu_device *adev,
 		return 0;
 
 	switch (adev->ip_versions[ATHUB_HWIP][0]) {
+	case IP_VERSION(1, 3, 1):
 	case IP_VERSION(2, 0, 0):
 	case IP_VERSION(2, 0, 2):
 		athub_v2_0_update_medium_grain_clock_gating(adev,
drivers/gpu/drm/amd/amdgpu/athub_v2_1.c +1 -0
index 2edefd10e56c..ad8e87d3d2cb 100644
@@ -74,6 +74,7 @@ int athub_v2_1_set_clockgating(struct amdgpu_device *adev,
 	case IP_VERSION(2, 1, 0):
 	case IP_VERSION(2, 1, 1):
 	case IP_VERSION(2, 1, 2):
+	case IP_VERSION(2, 4, 0):
 		athub_v2_1_update_medium_grain_clock_gating(adev, state == AMD_CG_STATE_GATE);
 		athub_v2_1_update_medium_grain_light_sleep(adev, state == AMD_CG_STATE_GATE);
 		break;
Signature · 1 line
2.25.1
Reviewed-by
#3 lore raw

Re: [PATCH 2/2] drm/amdgpu: add 1.3.1/2.4.0 athub CG support

Quoted 40 lines · Huang Rui
Quoted 3 lines · Aaron

This patch adds 1.3.1/2.4.0 athub clock gating support.

Series are Reviewed-by: Huang Rui <[email protected]>

Quoted 32 lines
---
 drivers/gpu/drm/amd/amdgpu/athub_v2_0.c | 1 +
 drivers/gpu/drm/amd/amdgpu/athub_v2_1.c | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/athub_v2_0.c +1 -0
index ab6a07e5e8c4..a720436857b4 100644
@@ -78,6 +78,7 @@ int athub_v2_0_set_clockgating(struct amdgpu_device *adev,
              return 0;
 
      switch (adev->ip_versions[ATHUB_HWIP][0]) {
+     case IP_VERSION(1, 3, 1):
      case IP_VERSION(2, 0, 0):
      case IP_VERSION(2, 0, 2):
              athub_v2_0_update_medium_grain_clock_gating(adev,
drivers/gpu/drm/amd/amdgpu/athub_v2_1.c +1 -1
index 2edefd10e56c..ad8e87d3d2cb 100644
@@ -74,6 +74,7 @@ int athub_v2_1_set_clockgating(struct amdgpu_device *adev,
      case IP_VERSION(2, 1, 0):
      case IP_VERSION(2, 1, 1):
      case IP_VERSION(2, 1, 2):
+     case IP_VERSION(2, 4, 0):
              athub_v2_1_update_medium_grain_clock_gating(adev, state == AMD_CG_STATE_GATE);
              athub_v2_1_update_medium_grain_light_sleep(adev, state == AMD_CG_STATE_GATE);
              break;
--

2.25.1

Reviewed-by on v1 1/2
#4 lore raw
In reply to Aaron Liu
Quoted 35 lines · Aaron Liu

Use IP version rather than codename for athub.

---
 drivers/gpu/drm/amd/amdgpu/athub_v1_0.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/athub_v1_0.c +7 -7
index 3ea557864320..88642e7ecdf4 100644
@@ -68,12 +68,13 @@ int athub_v1_0_set_clockgating(struct amdgpu_device *adev,
        if (amdgpu_sriov_vf(adev))
                return 0;
 
-       switch (adev->asic_type) {
-       case CHIP_VEGA10:
-       case CHIP_VEGA12:
-       case CHIP_VEGA20:
-       case CHIP_RAVEN:
-       case CHIP_RENOIR:
+       switch (adev->ip_versions[ATHUB_HWIP][0]) {
+       case IP_VERSION(9, 0, 0):
+       case IP_VERSION(9, 1, 0):
+       case IP_VERSION(9, 2, 0):
+       case IP_VERSION(9, 3, 0):
+       case IP_VERSION(9, 4, 0):
+       case IP_VERSION(1, 5, 0):
                athub_update_medium_grain_clock_gating(adev,
                                state == AMD_CG_STATE_GATE);
                athub_update_medium_grain_light_sleep(adev,
--

2.25.1