drm/amdgpu: skip gpu_info firmware if discovery info is available
Subsystems (2)
PATCH 1/6 drm/amdgpu: skip gpu_info firmware if discovery info is available
The GPU info firmware is only applicable at bring up when the IP discovery table is not present. If it's available, use that first and then fallback to parsing the gpu info firmware.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -7
@@ -1533,6 +1533,11 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev) adev->firmware.gpu_info_fw =NULL ; +if (amdgpu_discovery && adev->asic_type >=CHIP_NAVI10 ) { +amdgpu_discovery_get_gfx_info (adev); +return 0 ; + } +switch (adev->asic_type) {#ifdef CONFIG_DRM_AMDGPU_SI case CHIP_VERDE :
@@ -1617,11 +1622,6 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev) (const struct gpu_info_firmware_v1_0 *)(adev->firmware.gpu_info_fw->data +le32_to_cpu (hdr->header.ucode_array_offset_bytes)); -if (amdgpu_discovery && adev->asic_type >=CHIP_NAVI10 ) { -amdgpu_discovery_get_gfx_info (adev); - goto parse_soc_bounding_box; - } - adev->gfx.config.max_shader_engines =le32_to_cpu (gpu_info_fw->gc_num_se); adev->gfx.config.max_cu_per_sh =le32_to_cpu (gpu_info_fw->gc_num_cu_per_sh); adev->gfx.config.max_sh_per_se =le32_to_cpu (gpu_info_fw->gc_num_sh_per_se);
@@ -1650,10 +1650,9 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)le32_to_cpu (gpu_info_fw->num_packer_per_sc); } -parse_soc_bounding_box:/* * soc bounding box info is not integrated in disocovery table, -* we always need to parse it from gpu info firmware. +* we always need to parse it from gpu info firmware if needed. */ if (hdr->version_minor ==2 ) { const struct gpu_info_firmware_v1_2 *gpu_info_fw =
Signature · 6 lines
2.25.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/6 drm/amdgpu: clean up discovery testing
Rather than checking of the variable is enabled and the chip is the right family check for the presence of the discovery table.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
@@ -1533,7 +1533,7 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev) adev->firmware.gpu_info_fw =NULL ; -if (amdgpu_discovery && adev->asic_type >=CHIP_NAVI10 ) { +if (adev->discovery_bin) {amdgpu_discovery_get_gfx_info (adev);return 0 ; }
@@ -3363,7 +3363,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev)sysfs_remove_files (&adev->dev->kobj, amdgpu_dev_attributes);if (IS_ENABLED (CONFIG_PERF_EVENTS ))amdgpu_pmu_fini (adev); -if (amdgpu_discovery && adev->asic_type >=CHIP_NAVI10 ) +if (adev->discovery_bin)amdgpu_discovery_fini (adev); }
Signature · 6 lines
2.25.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/6 drm/amdgpu: use IP discovery table for renoir
In reply to Alex DeucherRather than relying on gpu info firmware.
---
Can someone test this on renoir?
drivers/gpu/drm/amd/amdgpu/soc15.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +12 -1
@@ -670,14 +670,25 @@ static uint32_t soc15_get_rev_id(struct amdgpu_device *adev)int soc15_set_ip_blocks (struct amdgpu_device *adev) { +int r; +/* Set IP register base before any HW register access */ switch (adev->asic_type) {case CHIP_VEGA10 :case CHIP_VEGA12 :case CHIP_RAVEN : -case CHIP_RENOIR :vega10_reg_base_init (adev);break ; +case CHIP_RENOIR : +if (amdgpu_discovery) { + r =amdgpu_discovery_reg_base_init (adev); +if (r) { +DRM_WARN ("failed to init reg base from ip discovery table, " +"fallback to legacy init method\n" ); +vega10_reg_base_init (adev); + } + } +break ;case CHIP_VEGA20 :vega20_reg_base_init (adev);break ;
Signature · 6 lines
2.25.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/6 drm/amdgpu/nv: allow access to SDMA status registers
In reply to Alex DeucherFor access via ioctl for tools like umr and mesa.
--- drivers/gpu/drm/amd/amdgpu/nv.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +0 -2
@@ -188,10 +188,8 @@ static struct soc15_allowed_register_entry nv_allowed_read_registers[] = { { SOC15_REG_ENTRY(GC, 0, mmGRBM_STATUS_SE1)}, { SOC15_REG_ENTRY(GC, 0, mmGRBM_STATUS_SE2)}, { SOC15_REG_ENTRY(GC, 0, mmGRBM_STATUS_SE3)}, -#if 0 /* TODO: will set it when SDMA header is available */ { SOC15_REG_ENTRY(SDMA0, 0, mmSDMA0_STATUS_REG)}, { SOC15_REG_ENTRY(SDMA1, 0, mmSDMA1_STATUS_REG)}, -#endif { SOC15_REG_ENTRY(GC, 0, mmCP_STAT)}, { SOC15_REG_ENTRY(GC, 0, mmCP_STALLED_STAT1)}, { SOC15_REG_ENTRY(GC, 0, mmCP_STALLED_STAT2)},
Signature · 6 lines
2.25.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/6 drm/amdgpu/nv: remove some dead code
In reply to Alex Deuchernavi never supported the pci config reset. Neither did vega.
--- drivers/gpu/drm/amd/amdgpu/nv.c | 34 --------------------------------- 1 file changed, 34 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +0 -34
@@ -254,31 +254,6 @@ static int nv_read_register(struct amdgpu_device *adev, u32 se_num,return -EINVAL ; } -#if 0 -static void nv_gpu_pci_config_reset (struct amdgpu_device *adev) -{ -u32 i; - -dev_info (adev->dev,"GPU pci config reset\n" ); - -/* disable BM */ -pci_clear_master (adev->pdev); -/* reset */ -amdgpu_pci_config_reset (adev); - -udelay (100 ); - -/* wait for asic to come out of reset */ -for (i =0 ; i < adev->usec_timeout; i++) { -u32 memsize =nbio_v2_3_get_memsize (adev); -if (memsize !=0xffffffff ) -break ; -udelay (1 ); - } - -} -#endif -static int nv_asic_mode1_reset (struct amdgpu_device *adev) {u32 i;
@@ -336,15 +311,6 @@ nv_asic_reset_method(struct amdgpu_device *adev)static int nv_asic_reset (struct amdgpu_device *adev) { - -/* FIXME: it doesn't work since vega10 */ -#if 0 -amdgpu_atombios_scratch_regs_engine_hung (adev, true); - -nv_gpu_pci_config_reset (adev); - -amdgpu_atombios_scratch_regs_engine_hung (adev, false); -#endif int ret =0 ;struct smu_context *smu = &adev->smu;
Signature · 6 lines
2.25.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/6 drm/amdgpu/nv: enable init reset check
In reply to Alex Deuchergpu reset is implemented for navi so we can enable this.
--- drivers/gpu/drm/amd/amdgpu/nv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +2 -3
@@ -41,6 +41,7 @@#include "hdp/hdp_5_0_0_offset.h" #include "hdp/hdp_5_0_0_sh_mask.h" #include "smuio/smuio_11_0_0_offset.h" +#include "mp/mp_11_0_offset.h" #include "soc15.h" #include "soc15_common.h"
@@ -514,7 +515,6 @@ static bool nv_need_full_reset(struct amdgpu_device *adev)static bool nv_need_reset_on_init (struct amdgpu_device *adev) { -#if 0 u32 sol_reg;if (adev->flags &AMD_IS_APU )
@@ -526,8 +526,7 @@ static bool nv_need_reset_on_init(struct amdgpu_device *adev) sol_reg =RREG32_SOC15 (MP0 ,0 , mmMP0_SMN_C2PMSG_81);if (sol_reg)return true; -#endif -/* TODO: re-enable it when mode1 reset is functional */ +return false; }
Signature · 6 lines
2.25.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 6/6] drm/amdgpu/nv: enable init reset check
[AMD Official Use Only - Internal Distribution Only]
The series is
Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Friday, May 29, 2020 05:35
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 6/6] drm/amdgpu/nv: enable init reset check
gpu reset is implemented for navi so we can enable this.
--- drivers/gpu/drm/amd/amdgpu/nv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +2 -2
@@ -41,6 +41,7 @@#include "hdp/hdp_5_0_0_offset.h" #include "hdp/hdp_5_0_0_sh_mask.h" #include "smuio/smuio_11_0_0_offset.h" +#include "mp/mp_11_0_offset.h" #include "soc15.h" #include "soc15_common.h"
@@ -514,7 +515,6 @@ static bool nv_need_full_reset(struct amdgpu_device *adev) static bool nv_need_reset_on_init(struct amdgpu_device *adev) { -#if 0u32 sol_reg;if (adev->flags &AMD_IS_APU )
@@ -526,8 +526,7 @@ static bool nv_need_reset_on_init(struct amdgpu_device *adev) sol_reg =RREG32_SOC15 (MP0 ,0 , mmMP0_SMN_C2PMSG_81);if (sol_reg)return true; -#endif -/* TODO: re-enable it when mode1 reset is functional */ +return false; }
--
2.25.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Chawking.zhang%40amd.com%7C461e9591172c445fd4b308d8034f15fc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637262985495510583&sdata=NGZFIi8Z13c8JPnescBK9zOU91Ow0o5ZgrBwSer29%2Bo%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 6/6] drm/amdgpu/nv: enable init reset check
In reply to Alex Deucher[AMD Official Use Only - Internal Distribution Only]
Patch 1-4 are acked-by: Evan Quan <[email protected]> Patch 5,6 are reviewed-by: Evan Quan <[email protected]>
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Friday, May 29, 2020 5:35 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 6/6] drm/amdgpu/nv: enable init reset check
gpu reset is implemented for navi so we can enable this.
--- drivers/gpu/drm/amd/amdgpu/nv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +2 -3
@@ -41,6 +41,7 @@#include "hdp/hdp_5_0_0_offset.h" #include "hdp/hdp_5_0_0_sh_mask.h" #include "smuio/smuio_11_0_0_offset.h" +#include "mp/mp_11_0_offset.h" #include "soc15.h" #include "soc15_common.h"
@@ -514,7 +515,6 @@ static bool nv_need_full_reset(struct amdgpu_device *adev)static bool nv_need_reset_on_init (struct amdgpu_device *adev) { -#if 0 u32 sol_reg;if (adev->flags &AMD_IS_APU )
@@ -526,8 +526,7 @@ static bool nv_need_reset_on_init(struct amdgpu_device *adev) sol_reg =RREG32_SOC15 (MP0 ,0 , mmMP0_SMN_C2PMSG_81);if (sol_reg)return true; -#endif -/* TODO: re-enable it when mode1 reset is functional */ +return false; }
--
2.25.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cevan.quan%40amd.com%7C7a7488e91f1e452df51c08d8034f1589%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637262985526500839&sdata=1GY9VAybW%2BvAU0mZme2y6jll%2FuUPllXT9YwJq54wmmU%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx