Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: update psp_get_fw_type() function

In psp 15.0.8, mes and sdma GFX_FW_TYPE have been changed.

Define a psp common function: psp_get_fw_type().
Hide the GFX_FW_TYPE Changes in each ip's psp->funcs_get_fw_type callback.
(like psp_v15_0_8_get_fw_type()).
If no GFX_FW_TYPE change, reuse the amdgpu_psp_get_fw_type().

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Feifei Xu and committed by
Alex Deucher
0b8c6bcd 708b8589

+10 -3
+2 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
··· 2631 2631 return 0; 2632 2632 } 2633 2633 2634 - static int psp_get_fw_type(struct amdgpu_firmware_info *ucode, 2634 + int amdgpu_psp_get_fw_type(struct amdgpu_firmware_info *ucode, 2635 2635 enum psp_gfx_fw_type *type) 2636 2636 { 2637 2637 switch (ucode->ucode_id) { ··· 2919 2919 cmd->cmd.cmd_load_ip_fw.fw_phy_addr_hi = upper_32_bits(fw_mem_mc_addr); 2920 2920 cmd->cmd.cmd_load_ip_fw.fw_size = ucode->ucode_size; 2921 2921 2922 - ret = psp_get_fw_type(ucode, &cmd->cmd.cmd_load_ip_fw.fw_type); 2922 + ret = psp_get_fw_type(psp, ucode, &cmd->cmd.cmd_load_ip_fw.fw_type); 2923 2923 if (ret) 2924 2924 dev_err(psp->adev->dev, "Unknown firmware type\n"); 2925 - 2926 2925 return ret; 2927 2926 } 2928 2927
+8
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
··· 172 172 bool (*is_reload_needed)(struct psp_context *psp); 173 173 int (*reg_program_no_ring)(struct psp_context *psp, uint32_t val, 174 174 enum psp_reg_prog_id id); 175 + int (*get_fw_type)(struct amdgpu_firmware_info *ucode, 176 + enum psp_gfx_fw_type *type); 175 177 }; 176 178 177 179 struct ta_funcs { ··· 526 524 ((psp)->funcs->reg_program_no_ring ? \ 527 525 (psp)->funcs->reg_program_no_ring((psp), val, id) : -EINVAL) 528 526 527 + #define psp_get_fw_type(psp, ucode, type) \ 528 + ((psp)->funcs->get_fw_type ? \ 529 + (psp)->funcs->get_fw_type(ucode, type):amdgpu_psp_get_fw_type(ucode, type)) 530 + 529 531 extern const struct amd_ip_funcs psp_ip_funcs; 530 532 531 533 extern const struct amdgpu_ip_block_version psp_v3_1_ip_block; ··· 627 621 int amdgpu_psp_reg_program_no_ring(struct psp_context *psp, uint32_t val, 628 622 enum psp_reg_prog_id id); 629 623 void amdgpu_psp_debugfs_init(struct amdgpu_device *adev); 624 + int amdgpu_psp_get_fw_type(struct amdgpu_firmware_info *ucode, 625 + enum psp_gfx_fw_type *type); 630 626 631 627 632 628 #endif