From: Jack Xiao <jack.x...@amd.com>

Add the unified mes firmware loading support.

Signed-off-by: Jack Xiao <jack.x...@amd.com>
Reviewed-by: Hawking Zhang <hawking.zh...@amd.com>
Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h     | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index f87d53e183c3d..c4355d72df02e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1046,6 +1046,7 @@ struct amdgpu_device {
        /* mes */
        bool                            enable_mes;
        bool                            enable_mes_kiq;
+       bool                            enable_uni_mes;
        struct amdgpu_mes               mes;
        struct amdgpu_mqd               mqds[AMDGPU_HW_IP_NUM];
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
index ea06f8be133e0..62edf63285667 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
@@ -1511,7 +1511,10 @@ int amdgpu_mes_init_microcode(struct amdgpu_device 
*adev, int pipe)
 
        amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix,
                                       sizeof(ucode_prefix));
-       if (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(11, 0, 0) &&
+       if (adev->enable_uni_mes && pipe == AMDGPU_MES_SCHED_PIPE) {
+               snprintf(fw_name, sizeof(fw_name),
+                        "amdgpu/%s_uni_mes.bin", ucode_prefix);
+       } else if (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(11, 0, 0) 
&&
            amdgpu_ip_version(adev, GC_HWIP, 0) < IP_VERSION(12, 0, 0)) {
                snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
                         ucode_prefix,
-- 
2.44.0

Reply via email to