drm/amdgpu: correct MES debugfs versions
Subsystems (2)
PATCH 1/2 drm/amdgpu: correct MES debugfs versions
Use mes.sched_version, mes.kiq_version for debugfs as mes.ucode_fw_version does not contain correct versioning information.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +6 -4
@@ -337,12 +337,14 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info, fw_info->feature = adev->psp.cap_feature_version;break ;case AMDGPU_INFO_FW_MES_KIQ : - fw_info->ver = adev->mes.ucode_fw_version[0 ]; - fw_info->feature =0 ; + fw_info->ver = adev->mes.kiq_version &AMDGPU_MES_VERSION_MASK ; + fw_info->feature = (adev->mes.kiq_version &AMDGPU_MES_FEAT_VERSION_MASK ) + >>AMDGPU_MES_FEAT_VERSION_SHIFT ;break ;case AMDGPU_INFO_FW_MES : - fw_info->ver = adev->mes.ucode_fw_version[1 ]; - fw_info->feature =0 ; + fw_info->ver = adev->mes.sched_version &AMDGPU_MES_VERSION_MASK ; + fw_info->feature = (adev->mes.sched_version &AMDGPU_MES_FEAT_VERSION_MASK ) + >>AMDGPU_MES_FEAT_VERSION_SHIFT ;break ;case AMDGPU_INFO_FW_IMU : fw_info->ver = adev->gfx.imu_fw_version;
Signature · 1 line
2.25.1
PATCH 2/2 drm/amdgpu: remove deprecated MES version vars
MES scheduler and kiq versions are stored in mes.sched_version and mes.kiq_version, respectively, which are read from a register after their queues are initialized. Remove mes.ucode_fw_version and mes.data_fw_version which tried to read this versioning info from the firmware headers (which don't contain this information).
--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 2 -- drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 4 ---- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 4 ---- 3 files changed, 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h +0 -2
@@ -91,14 +91,12 @@ struct amdgpu_mes {struct amdgpu_bo *ucode_fw_obj[AMDGPU_MAX_MES_PIPES ];uint64_t ucode_fw_gpu_addr[AMDGPU_MAX_MES_PIPES ];uint32_t *ucode_fw_ptr[AMDGPU_MAX_MES_PIPES ]; -uint32_t ucode_fw_version[AMDGPU_MAX_MES_PIPES ];uint64_t uc_start_addr[AMDGPU_MAX_MES_PIPES ];/* mes ucode data */ struct amdgpu_bo *data_fw_obj[AMDGPU_MAX_MES_PIPES ];uint64_t data_fw_gpu_addr[AMDGPU_MAX_MES_PIPES ];uint32_t *data_fw_ptr[AMDGPU_MAX_MES_PIPES ]; -uint32_t data_fw_version[AMDGPU_MAX_MES_PIPES ];uint64_t data_start_addr[AMDGPU_MAX_MES_PIPES ];/* eop gpu obj */
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c +0 -4
@@ -415,10 +415,6 @@ static int mes_v10_1_init_microcode(struct amdgpu_device *adev, mes_hdr = (const struct mes_firmware_header_v1_0 *) adev->mes.fw[pipe]->data; - adev->mes.ucode_fw_version[pipe] = -le32_to_cpu (mes_hdr->mes_ucode_version); - adev->mes.ucode_fw_version[pipe] = -le32_to_cpu (mes_hdr->mes_ucode_data_version); adev->mes.uc_start_addr[pipe] =le32_to_cpu (mes_hdr->mes_uc_start_addr_lo) | ((uint64_t )(le32_to_cpu (mes_hdr->mes_uc_start_addr_hi)) <<32 );
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +0 -4
@@ -480,10 +480,6 @@ static int mes_v11_0_init_microcode(struct amdgpu_device *adev, mes_hdr = (const struct mes_firmware_header_v1_0 *) adev->mes.fw[pipe]->data; - adev->mes.ucode_fw_version[pipe] = -le32_to_cpu (mes_hdr->mes_ucode_version); - adev->mes.ucode_fw_version[pipe] = -le32_to_cpu (mes_hdr->mes_ucode_data_version); adev->mes.uc_start_addr[pipe] =le32_to_cpu (mes_hdr->mes_uc_start_addr_lo) | ((uint64_t )(le32_to_cpu (mes_hdr->mes_uc_start_addr_hi)) <<32 );
Signature · 1 line
2.25.1
Re: [PATCH 2/2] drm/amdgpu: remove deprecated MES version vars
[AMD Official Use Only - General]
The series is Reviewed-by: Jack Xiao <[email protected]>
Regards,
Jack
________________________________
From: Sider, Graham <[email protected]>
Sent: Wednesday, 26 October 2022 03:20
To: [email protected] <[email protected]>
Cc: Xiao, Jack <[email protected]>; Zhang, Hawking <[email protected]>; Sider, Graham <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: remove deprecated MES version vars
MES scheduler and kiq versions are stored in mes.sched_version and mes.kiq_version, respectively, which are read from a register after their queues are initialized. Remove mes.ucode_fw_version and mes.data_fw_version which tried to read this versioning info from the firmware headers (which don't contain this information).
--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 2 -- drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 4 ---- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 4 ---- 3 files changed, 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h +0 -2
@@ -91,14 +91,12 @@ struct amdgpu_mes {struct amdgpu_bo *ucode_fw_obj[AMDGPU_MAX_MES_PIPES ];uint64_t ucode_fw_gpu_addr[AMDGPU_MAX_MES_PIPES ];uint32_t *ucode_fw_ptr[AMDGPU_MAX_MES_PIPES ]; -uint32_t ucode_fw_version[AMDGPU_MAX_MES_PIPES ];uint64_t uc_start_addr[AMDGPU_MAX_MES_PIPES ];/* mes ucode data */ struct amdgpu_bo *data_fw_obj[AMDGPU_MAX_MES_PIPES ];uint64_t data_fw_gpu_addr[AMDGPU_MAX_MES_PIPES ];uint32_t *data_fw_ptr[AMDGPU_MAX_MES_PIPES ]; -uint32_t data_fw_version[AMDGPU_MAX_MES_PIPES ];uint64_t data_start_addr[AMDGPU_MAX_MES_PIPES ];/* eop gpu obj */
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c +0 -4
@@ -415,10 +415,6 @@ static int mes_v10_1_init_microcode(struct amdgpu_device *adev, mes_hdr = (const struct mes_firmware_header_v1_0 *) adev->mes.fw[pipe]->data; - adev->mes.ucode_fw_version[pipe] = -le32_to_cpu (mes_hdr->mes_ucode_version); - adev->mes.ucode_fw_version[pipe] = -le32_to_cpu (mes_hdr->mes_ucode_data_version); adev->mes.uc_start_addr[pipe] =le32_to_cpu (mes_hdr->mes_uc_start_addr_lo) | ((uint64_t )(le32_to_cpu (mes_hdr->mes_uc_start_addr_hi)) <<32 );
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +0 -4
@@ -480,10 +480,6 @@ static int mes_v11_0_init_microcode(struct amdgpu_device *adev, mes_hdr = (const struct mes_firmware_header_v1_0 *) adev->mes.fw[pipe]->data; - adev->mes.ucode_fw_version[pipe] = -le32_to_cpu (mes_hdr->mes_ucode_version); - adev->mes.ucode_fw_version[pipe] = -le32_to_cpu (mes_hdr->mes_ucode_data_version); adev->mes.uc_start_addr[pipe] =le32_to_cpu (mes_hdr->mes_uc_start_addr_lo) | ((uint64_t )(le32_to_cpu (mes_hdr->mes_uc_start_addr_hi)) <<32 );
--
2.25.1