]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu: add HDP asic callbacks for SOC15 (v2)
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Sep 2017 22:06:45 +0000 (18:06 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Feb 2018 19:17:13 +0000 (14:17 -0500)
Needed to flush and invalidate the HDP block using the CPU.

v2: use preferred register on soc15.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Samuel Li <Samuel.Li@amd.com> (v1)
drivers/gpu/drm/amd/amdgpu/soc15.c

index a04a033f57de0121e7da812f66d8c8978fc81e32..ad39ffd012bca736886e2ed2b93fad57c421af0e 100644 (file)
@@ -583,6 +583,16 @@ static uint32_t soc15_get_rev_id(struct amdgpu_device *adev)
        return adev->nbio_funcs->get_rev_id(adev);
 }
 
+static void soc15_flush_hdp(struct amdgpu_device *adev)
+{
+       adev->nbio_funcs->hdp_flush(adev);
+}
+
+static void soc15_invalidate_hdp(struct amdgpu_device *adev)
+{
+       WREG32_SOC15_NO_KIQ(NBIO, 0, mmHDP_READ_CACHE_INVALIDATE, 1);
+}
+
 static const struct amdgpu_asic_funcs soc15_asic_funcs =
 {
        .read_disabled_bios = &soc15_read_disabled_bios,
@@ -594,6 +604,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)