[PATCH] drm/amdgpu: don't remap HDP registers if page size is > 4K

Alex Deucher alexander.deucher at amd.com
Fri Apr 18 13:32:53 UTC 2025


We remap the HDP registers to an open part of the MMIO
aperture if page size is <= 4K, but if it's > 4k, we remap
the HDP registers back to themselves.  Rather than doing
that, just skip the remap.

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c    | 3 ++-
 drivers/gpu/drm/amd/amdgpu/soc15.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/soc21.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/soc24.c | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 50e77d9b30afa..890f846b80607 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -1002,7 +1002,8 @@ static int nv_common_hw_init(struct amdgpu_ip_block *ip_block)
 	 * for the purpose of expose those registers
 	 * to process space
 	 */
-	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev) &&
+	    (PAGE_SIZE <= 4096))
 		adev->nbio.funcs->remap_hdp_registers(adev);
 	/* enable the doorbell aperture */
 	adev->nbio.funcs->enable_doorbell_aperture(adev, true);
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index c457be3a3c56f..ef24201ffad52 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1297,7 +1297,8 @@ static int soc15_common_hw_init(struct amdgpu_ip_block *ip_block)
 	 * for the purpose of expose those registers
 	 * to process space
 	 */
-	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev) &&
+	    (PAGE_SIZE <= 4096))
 		adev->nbio.funcs->remap_hdp_registers(adev);
 
 	/* enable the doorbell aperture */
diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
index ad36c96478a82..23d4117287702 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
@@ -877,7 +877,8 @@ static int soc21_common_hw_init(struct amdgpu_ip_block *ip_block)
 	 * for the purpose of expose those registers
 	 * to process space
 	 */
-	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev) &&
+	    (PAGE_SIZE <= 4096))
 		adev->nbio.funcs->remap_hdp_registers(adev);
 	/* enable the doorbell aperture */
 	adev->nbio.funcs->enable_doorbell_aperture(adev, true);
diff --git a/drivers/gpu/drm/amd/amdgpu/soc24.c b/drivers/gpu/drm/amd/amdgpu/soc24.c
index 972b449ab89fa..71ba1fa8a8899 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc24.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc24.c
@@ -486,7 +486,7 @@ static int soc24_common_hw_init(struct amdgpu_ip_block *ip_block)
 	 * for the purpose of expose those registers
 	 * to process space
 	 */
-	if (adev->nbio.funcs->remap_hdp_registers)
+	if (adev->nbio.funcs->remap_hdp_registers && (PAGE_SIZE <= 4096))
 		adev->nbio.funcs->remap_hdp_registers(adev);
 
 	if (adev->df.funcs->hw_init)
-- 
2.49.0



More information about the amd-gfx mailing list