From: Ivan Lipski <[email protected]>

[Why&How]
Only DCN6 currently supports alt channel pstate switch, which requires VRAM
aperture configuration.

Return only dm_get_alt_channel_pstate_switch_aperture on other ASICs.

Cc: Sun peng Li <[email protected]>
Signed-off-by: Ivan Lipski <[email protected]>
Signed-off-by: Wayne Lin <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c
index d655ae8bbb52..ebd8130cb04d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c
@@ -168,7 +168,7 @@ EXPORT_IF_KUNIT(dm_register_dmub_notify_callback);
  *
  * Reads both apertures before populating the DMUB parameters and DML2 config.
  * Translates their base addresses into MC space for DML2. If either aperture
- * is unavailable, the feature remains disabled.
+ * is unavailable, the feature remains disabled. Only DCN 6.0 supports the 
feature.
  */
 static void
 dm_get_alt_channel_pstate_switch_aperture(struct amdgpu_device *adev,
@@ -183,6 +183,13 @@ dm_get_alt_channel_pstate_switch_aperture(struct 
amdgpu_device *adev,
        u32 i;
        int r;
 
+       switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
+       case IP_VERSION(6, 0, 0):
+               break;
+       default:
+               return;
+       }
+
        /* Region IDs 5 and 6 identify the p-state switch apertures 1 and 2.
         * Do not publish partial aperture configuration if either lookup fails.
         */
-- 
2.43.0

Reply via email to