[PATCH] drm/amdgpu: add clockgating support for NBIO v7.7.1

Zhang, Yifan Yifan1.Zhang at amd.com
Tue Oct 17 11:40:56 UTC 2023


[AMD Official Use Only - General]

Please separate feature enabling and code cleaning to two patches. With that fixed this patch is :

Reviewed-by: Yifan Zhang <yifan1.zhang at amd.com>

-----Original Message-----
From: Ma, Li <Li.Ma at amd.com>
Sent: Tuesday, October 17, 2023 6:09 PM
To: amd-gfx at lists.freedesktop.org
Cc: Zhang, Yifan <Yifan1.Zhang at amd.com>; Huang, Tim <Tim.Huang at amd.com>; Ma, Li <Li.Ma at amd.com>
Subject: [PATCH] drm/amdgpu: add clockgating support for NBIO v7.7.1

add clockgating support for NBIO ip 7.7.1 and modify if condition.

Signed-off-by: Li Ma <li.ma at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c | 4 ++--
 drivers/gpu/drm/amd/amdgpu/soc21.c     | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c
index def89379b51a..4df1055e640a 100644
--- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c
+++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c
@@ -254,7 +254,7 @@ static void nbio_v7_7_update_medium_grain_clock_gating(struct amdgpu_device *ade  {
        uint32_t def, data;

-       if (enable && !(adev->cg_flags & AMD_CG_SUPPORT_BIF_MGCG))
+       if (!(adev->cg_flags & AMD_CG_SUPPORT_BIF_MGCG))
                return;

        def = data = RREG32_SOC15(NBIO, 0, regBIF0_CPM_CONTROL); @@ -283,7 +283,7 @@ static void nbio_v7_7_update_medium_grain_light_sleep(struct amdgpu_device *adev  {
        uint32_t def, data;

-       if (enable && !(adev->cg_flags & AMD_CG_SUPPORT_BIF_LS))
+       if (!(adev->cg_flags & AMD_CG_SUPPORT_BIF_LS))
                return;

        def = data = RREG32_SOC15(NBIO, 0, regBIF0_PCIE_CNTL2); diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
index df7462cec6ab..3ab188067d84 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
@@ -863,6 +863,7 @@ static int soc21_common_set_clockgating_state(void *handle,
        case IP_VERSION(4, 3, 0):
        case IP_VERSION(4, 3, 1):
        case IP_VERSION(7, 7, 0):
+       case IP_VERSION(7, 7, 1):
                adev->nbio.funcs->update_medium_grain_clock_gating(adev,
                                state == AMD_CG_STATE_GATE);
                adev->nbio.funcs->update_medium_grain_light_sleep(adev,
--
2.25.1



More information about the amd-gfx mailing list