]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdkfd:Add kfd function to config sq perfmon
authorFeifei Xu <Feifei.Xu@amd.com>
Thu, 12 Sep 2024 10:09:11 +0000 (18:09 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 26 Sep 2024 21:06:17 +0000 (17:06 -0400)
Expose the interface for kfd to config sq perfmon.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h

index 4f08b153cb66d8f1f62787cfeae2cfffcc9b286e..b545940e512bbf9424d9a13c034f6a819dd1da55 100644 (file)
@@ -889,3 +889,18 @@ int amdgpu_amdkfd_start_sched(struct amdgpu_device *adev, uint32_t node_id)
 
        return kgd2kfd_start_sched(adev->kfd.dev, node_id);
 }
+
+/* Config CGTT_SQ_CLK_CTRL */
+int amdgpu_amdkfd_config_sq_perfmon(struct amdgpu_device *adev, uint32_t xcp_id,
+       bool core_override_enable, bool reg_override_enable, bool perfmon_override_enable)
+{
+       int r;
+
+       if (!adev->kfd.init_complete)
+               return 0;
+
+       r = psp_config_sq_perfmon(&adev->psp, xcp_id, core_override_enable,
+                                       reg_override_enable, perfmon_override_enable);
+
+       return r;
+}
index f9d1194484423a997f44e75df264f5909b4c20b5..7e0a220725369c209c3fad8535c98a9d7bdbe855 100644 (file)
@@ -266,6 +266,9 @@ int amdgpu_amdkfd_unmap_hiq(struct amdgpu_device *adev, u32 doorbell_off,
                                u32 inst);
 int amdgpu_amdkfd_start_sched(struct amdgpu_device *adev, uint32_t node_id);
 int amdgpu_amdkfd_stop_sched(struct amdgpu_device *adev, uint32_t node_id);
+int amdgpu_amdkfd_config_sq_perfmon(struct amdgpu_device *adev, uint32_t xcp_id,
+       bool core_override_enable, bool reg_override_enable, bool perfmon_override_enable);
+
 
 /* Read user wptr from a specified user address space with page fault
  * disabled. The memory must be pinned and mapped to the hardware when