From: Alex Deucher <[email protected]>

Needed to flush and invalidate the HDP block using the CPU.

Signed-off-by: Alex Deucher <[email protected]>
Signed-off-by: Samuel Li <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c 
b/drivers/gpu/drm/amd/amdgpu/soc15.c
index a74d616..9dff294 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -578,6 +578,20 @@ static uint32_t soc15_get_rev_id(struct amdgpu_device 
*adev)
                return nbio_v6_1_get_rev_id(adev);
 }
 
+static void soc15_flush_hdp(struct amdgpu_device *adev)
+{
+       if (adev->flags & AMD_IS_APU)
+               nbio_v7_0_hdp_flush(adev);
+       else
+               nbio_v6_1_hdp_flush(adev);
+}
+
+static void soc15_invalidate_hdp(struct amdgpu_device *adev)
+{
+       WREG32_SOC15(HDP, 0, mmHDP_DEBUG0, 1);
+       RREG32_SOC15(HDP, 0, mmHDP_DEBUG0);
+}
+
 static const struct amdgpu_asic_funcs soc15_asic_funcs =
 {
        .read_disabled_bios = &soc15_read_disabled_bios,
@@ -589,6 +603,8 @@ static const struct amdgpu_asic_funcs soc15_asic_funcs =
        .set_uvd_clocks = &soc15_set_uvd_clocks,
        .set_vce_clocks = &soc15_set_vce_clocks,
        .get_config_memsize = &soc15_get_config_memsize,
+       .flush_hdp = &soc15_flush_hdp,
+       .invalidate_hdp = &soc15_invalidate_hdp,
 };
 
 static int soc15_common_early_init(void *handle)
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to