Skip to contentSkip to conversation

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

PATCH New Alex Deucher 1 participant 1 message Apr 18, 2025

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

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

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.

---
 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(-)
drivers/gpu/drm/amd/amdgpu/nv.c +2 -1
index 50e77d9b30afa..890f846b80607 100644
@@ -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);
drivers/gpu/drm/amd/amdgpu/soc15.c +2 -1
index c457be3a3c56f..ef24201ffad52 100644
@@ -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 */
drivers/gpu/drm/amd/amdgpu/soc21.c +2 -1
index ad36c96478a82..23d4117287702 100644
@@ -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);
drivers/gpu/drm/amd/amdgpu/soc24.c +1 -1
index 972b449ab89fa..71ba1fa8a8899 100644
@@ -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)
Signature · 1 line
2.49.0