drm/amdgpu: Remove FW_LOAD_DIRECT type support on VI
Subsystems (2)
PATCH 1/6 drm/amdgpu: Remove FW_LOAD_DIRECT type support on VI
AMDGPU_FW_LOAD_DIRECT is used for bring up. Now it don't work any more. so remove the support.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 - drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 249 ++++++------------------------ drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 57 +------ 3 files changed, 56 insertions(+), 253 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +0 -3
@@ -297,9 +297,6 @@ enum amdgpu_firmware_load_typecase CHIP_POLARIS11 :case CHIP_POLARIS12 :case CHIP_VEGAM : -if (!load_type) -return AMDGPU_FW_LOAD_DIRECT ; -else return AMDGPU_FW_LOAD_SMU ;case CHIP_VEGA10 :case CHIP_RAVEN :
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +49 -200
290 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +7 -50
75 lines not on this page · raw message
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/6 drm/amdgpu: Move gfx flag in_suspend to adev
In reply to a message not in the archiveMove in_suspend flag to adev from gfx, so
can be used in other ip blocks, also keep
consistent with gpu_in_reset flag.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 3 +-- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 13 +++---------- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 16 ++++------------ 5 files changed, 14 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +3 -0
@@ -1046,6 +1046,9 @@ struct amdgpu_device {bool has_hw_reset;u8 reset_magic[AMDGPU_RESET_MAGIC_NUM ]; +/* s3/s4 mask */ +bool in_suspend; +/* record last mm index being written through WREG32*/ unsigned long last_mm_index;bool in_gpu_reset;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
@@ -2649,6 +2649,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)if (dev->switch_power_state ==DRM_SWITCH_POWER_OFF )return 0 ; + adev->in_suspend = true;drm_kms_helper_poll_disable (dev);if (fbcon)
@@ -2834,6 +2835,8 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)#ifdef CONFIG_PM dev->dev->power.disable_depth--;#endif + adev->in_suspend = false; +return 0 ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +1 -2
@@ -297,8 +297,7 @@ struct amdgpu_gfx {/* reset mask */ uint32_t grbm_soft_reset;uint32_t srbm_soft_reset; -/* s3/s4 mask */ -bool in_suspend; +/* NGG */ struct amdgpu_ngg ngg;
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +3 -10
@@ -4732,7 +4732,7 @@ static int gfx_v8_0_kcq_init_queue(struct amdgpu_ring *ring)struct vi_mqd *mqd = ring->mqd_ptr;int mqd_idx = ring - &adev->gfx.compute_ring[0 ]; -if (!adev->in_gpu_reset && !adev->gfx.in_suspend) { +if (!adev->in_gpu_reset && !adev->in_suspend) {memset ((void *)mqd,0 ,sizeof (struct vi_mqd_allocation )); ((struct vi_mqd_allocation *)mqd)->dynamic_cu_mask =0xFFFFFFFF ; ((struct vi_mqd_allocation *)mqd)->dynamic_rb_mask =0xFFFFFFFF ;
@@ -4991,19 +4991,12 @@ static int gfx_v8_0_hw_fini(void *handle)static int gfx_v8_0_suspend (void *handle) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; - adev->gfx.in_suspend = true; -return gfx_v8_0_hw_fini (adev); +return gfx_v8_0_hw_fini (handle); }static int gfx_v8_0_resume (void *handle) { -int r; -struct amdgpu_device *adev = (struct amdgpu_device *)handle; - - r =gfx_v8_0_hw_init (adev); - adev->gfx.in_suspend = false; -return r; +return gfx_v8_0_hw_init (handle); }static bool gfx_v8_0_check_soft_reset (void *handle)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +4 -12
@@ -3198,7 +3198,7 @@ static int gfx_v9_0_kcq_init_queue(struct amdgpu_ring *ring)struct v9_mqd *mqd = ring->mqd_ptr;int mqd_idx = ring - &adev->gfx.compute_ring[0 ]; -if (!adev->in_gpu_reset && !adev->gfx.in_suspend) { +if (!adev->in_gpu_reset && !adev->in_suspend) {memset ((void *)mqd,0 ,sizeof (struct v9_mqd_allocation )); ((struct v9_mqd_allocation *)mqd)->dynamic_cu_mask =0xFFFFFFFF ; ((struct v9_mqd_allocation *)mqd)->dynamic_rb_mask =0xFFFFFFFF ;
@@ -3417,7 +3417,7 @@ static int gfx_v9_0_hw_fini(void *handle)/* Use deinitialize sequence from CAIL when unbinding device from driver, * otherwise KIQ is hanging when binding back */ -if (!adev->in_gpu_reset && !adev->gfx.in_suspend) { +if (!adev->in_gpu_reset && !adev->in_suspend) {mutex_lock (&adev->srbm_mutex); soc15_grbm_select(adev, adev->gfx.kiq.ring.me, adev->gfx.kiq.ring.pipe,
@@ -3437,20 +3437,12 @@ static int gfx_v9_0_hw_fini(void *handle)static int gfx_v9_0_suspend (void *handle) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; - - adev->gfx.in_suspend = true; -return gfx_v9_0_hw_fini (adev); +return gfx_v9_0_hw_fini (handle); }static int gfx_v9_0_resume (void *handle) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; -int r; - - r =gfx_v9_0_hw_init (adev); - adev->gfx.in_suspend = false; -return r; +return gfx_v9_0_hw_init (handle); }static bool gfx_v9_0_is_idle (void *handle)
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/6 drm/amdgpu: Fix cg/pg unexpected disabled when hw init failed
In reply to a message not in the archiveCheck the ip blocks late_initialized state before enable/disable cg/pg, so if hw init failed, cg/pg function will not be executed.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -4
@@ -1656,7 +1656,7 @@ static int amdgpu_device_set_cg_state(struct amdgpu_device *adev,for (j =0 ; j < adev->num_ip_blocks; j++) { i = state ==AMD_CG_STATE_GATE ? j : adev->num_ip_blocks - j -1 ; -if (!adev->ip_blocks[i].status.valid) +if (!adev->ip_blocks[i].status.late_initialized)continue ;/* skip CG for VCE/UVD, it's handled specially */ if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
@@ -1686,7 +1686,7 @@ static int amdgpu_device_set_pg_state(struct amdgpu_device *adev, enum amd_powerfor (j =0 ; j < adev->num_ip_blocks; j++) { i = state ==AMD_PG_STATE_GATE ? j : adev->num_ip_blocks - j -1 ; -if (!adev->ip_blocks[i].status.valid) +if (!adev->ip_blocks[i].status.late_initialized)continue ;/* skip CG for VCE/UVD, it's handled specially */ if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
@@ -1723,7 +1723,7 @@ static int amdgpu_device_ip_late_init(struct amdgpu_device *adev)int i =0 , r;for (i =0 ; i < adev->num_ip_blocks; i++) { -if (!adev->ip_blocks[i].status.valid) +if (!adev->ip_blocks[i].status.hw)continue ;if (adev->ip_blocks[i].version->funcs->late_init) { r = adev->ip_blocks[i].version->funcs->late_init ((void *)adev);
@@ -1732,8 +1732,8 @@ static int amdgpu_device_ip_late_init(struct amdgpu_device *adev) adev->ip_blocks[i].version->funcs->name, r);return r; } - adev->ip_blocks[i].status.late_initialized = true; } + adev->ip_blocks[i].status.late_initialized = true; }amdgpu_device_set_cg_state (adev,AMD_CG_STATE_GATE );
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/6 drm/amdgpu: Don't allocate memory for ucode when suspend
In reply to a message not in the archivedriver don't release the ucode memory when suspend. so don't need to allocate bo when resume back.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +1 -1
@@ -432,7 +432,7 @@ int amdgpu_ucode_init_bo(struct amdgpu_device *adev)return 0 ; } -if (!adev->in_gpu_reset) { +if (!adev->in_gpu_reset && !adev->in_suspend) { err = amdgpu_bo_create_kernel(adev, adev->firmware.fw_size, PAGE_SIZE, amdgpu_sriov_vf(adev) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT, &adev->firmware.fw_buf,
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/6 drm/amd/pp: Fix memory leak on Si/CI/AI dgpu asics
In reply to a message not in the archiveOn SI/CI/AI, driver still need to release smu's fw, it was not related to other hw ip's fw load_type.
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +4 -4
@@ -109,11 +109,11 @@ static int pp_sw_fini(void *handle)hwmgr_sw_fini (hwmgr); -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_SMU ) { -release_firmware (adev->pm.fw); - adev->pm.fw =NULL ; +if (adev->firmware.load_type ==AMDGPU_FW_LOAD_SMU )amdgpu_ucode_fini_bo (adev); - } + +release_firmware (adev->pm.fw); + adev->pm.fw =NULL ;return 0 ; }
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/6 drm/amdgpu: Drop dead define in amdgpu.h
In reply to a message not in the archivethe struct was not in use any more.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 28 ---------------------------- 1 file changed, 28 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -28
@@ -616,31 +616,6 @@ struct amdgpu_wb {*/ void amdgpu_test_moves (struct amdgpu_device *adev); - -/* -* amdgpu smumgr functions -*/ -struct amdgpu_smumgr_funcs { -int (*check_fw_load_finish)(struct amdgpu_device *adev,uint32_t fwtype); -int (*request_smu_load_fw)(struct amdgpu_device *adev); -int (*request_smu_specific_fw)(struct amdgpu_device *adev,uint32_t fwtype); -}; - -/* -* amdgpu smumgr -*/ -struct amdgpu_smumgr { -struct amdgpu_bo *toc_buf; -struct amdgpu_bo *smu_buf; -/* asic priv smu data */ -void *priv; -spinlock_t smu_lock; -/* smumgr functions */ -const struct amdgpu_smumgr_funcs *smumgr_funcs; -/* ucode loading complete flag */ -uint32_t fw_flags; -}; -/* * ASIC specific register table accessible by UMD */
@@ -979,9 +954,6 @@ struct amdgpu_device {u32 cg_flags;u32 pg_flags; -/* amdgpu smumgr */ -struct amdgpu_smumgr smu; -/* gfx */ struct amdgpu_gfx gfx;
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Instead of change the fw load type to AMDGPU_FW_LOAD_SMU silently, it's better to warn/error out if user specify FW_LOAD_DIRECT load type.
Regards,
Evan
Quoted 476 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Rex Zhu
Sent: 2018年9月30日 0:15
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH 1/6] drm/amdgpu: RemoveFW_LOAD_DIRECTtype support on VI
AMDGPU_FW_LOAD_DIRECTis used for bring up. Now it don't work any more. so remove the support.Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 - drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 249 ++++++--------------------- --- drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 57 +------ 3 files changed, 56 insertions(+), 253 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +0
-3@@ -297,9 +297,6 @@ enum amdgpu_firmware_load_typecase CHIP_POLARIS11 :case CHIP_POLARIS12 :case CHIP_VEGAM : -if (!load_type) -return AMDGPU_FW_LOAD_DIRECT ; -else return AMDGPU_FW_LOAD_SMU ;case CHIP_VEGA10 :case CHIP_RAVEN :drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +41
-25@@ -1173,64 +1173,61 @@ static int gfx_v8_0_init_microcode(struct amdgpu_device *adev) } } -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_SMU ) { - info = &adev- >firmware.ucode[AMDGPU_UCODE_ID_CP_PFP]; - info->ucode_id =AMDGPU_UCODE_ID_CP_PFP ; - info->fw = adev->gfx.pfp_fw; - header = (const struct common_firmware_header *)info- >fw->data; - adev->firmware.fw_size += -ALIGN (le32_to_cpu (header->ucode_size_bytes), PAGE_SIZE); - - info = &adev- >firmware.ucode[AMDGPU_UCODE_ID_CP_ME]; - info->ucode_id =AMDGPU_UCODE_ID_CP_ME ; - info->fw = adev->gfx.me_fw; - header = (const struct common_firmware_header *)info- >fw->data; - adev->firmware.fw_size += -ALIGN (le32_to_cpu (header->ucode_size_bytes), PAGE_SIZE); - - info = &adev- >firmware.ucode[AMDGPU_UCODE_ID_CP_CE]; - info->ucode_id =AMDGPU_UCODE_ID_CP_CE ; - info->fw = adev->gfx.ce_fw; - header = (const struct common_firmware_header *)info- >fw->data; - adev->firmware.fw_size += -ALIGN (le32_to_cpu (header->ucode_size_bytes), PAGE_SIZE); + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_PFP ]; + info->ucode_id =AMDGPU_UCODE_ID_CP_PFP ; + info->fw = adev->gfx.pfp_fw; + header = (const struct common_firmware_header *)info->fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (header->ucode_size_bytes),PAGE_SIZE ); + + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_ME ]; + info->ucode_id =AMDGPU_UCODE_ID_CP_ME ; + info->fw = adev->gfx.me_fw; + header = (const struct common_firmware_header *)info->fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (header->ucode_size_bytes),PAGE_SIZE ); + + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_CE ]; + info->ucode_id =AMDGPU_UCODE_ID_CP_CE ; + info->fw = adev->gfx.ce_fw; + header = (const struct common_firmware_header *)info->fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (header->ucode_size_bytes),PAGE_SIZE ); + + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_RLC_G ]; + info->ucode_id =AMDGPU_UCODE_ID_RLC_G ; + info->fw = adev->gfx.rlc_fw; + header = (const struct common_firmware_header *)info->fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (header->ucode_size_bytes),PAGE_SIZE ); + + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_MEC1 ]; + info->ucode_id =AMDGPU_UCODE_ID_CP_MEC1 ; + info->fw = adev->gfx.mec_fw; + header = (const struct common_firmware_header *)info->fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (header->ucode_size_bytes),PAGE_SIZE ); + +/* we need account JT in */ + cp_hdr = (const struct gfx_firmware_header_v1_0 *)adev- >gfx.mec_fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (cp_hdr->jt_size) <<2 ,PAGE_SIZE ); - info = &adev- >firmware.ucode[AMDGPU_UCODE_ID_RLC_G]; - info->ucode_id =AMDGPU_UCODE_ID_RLC_G ; - info->fw = adev->gfx.rlc_fw; - header = (const struct common_firmware_header *)info- >fw->data; +if (amdgpu_sriov_vf (adev)) { + info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_STORAGE];
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2
-1+ info->ucode_id =AMDGPU_UCODE_ID_STORAGE ; + info->fw = adev->gfx.mec_fw; adev->firmware.fw_size += - ALIGN(le32_to_cpu(header->ucode_size_bytes),
PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2
-1+ALIGN (le32_to_cpu (64 *PAGE_SIZE ),PAGE_SIZE ); + } - info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_CP_MEC1];
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2
-2- info->ucode_id =AMDGPU_UCODE_ID_CP_MEC1 ; - info->fw = adev->gfx.mec_fw; +if (adev->gfx.mec2_fw) { + info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_CP_MEC2];
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2
-0+ info->ucode_id =AMDGPU_UCODE_ID_CP_MEC2 ; + info->fw = adev->gfx.mec2_fw; header = (const struct common_firmware_header *)info-Quoted 1 line
fw->data;drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-0adev->firmware.fw_size += ALIGN(le32_to_cpu(header->ucode_size_bytes),
PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-3- -/* we need account JT in */ - cp_hdr = (const struct gfx_firmware_header_v1_0 *)adev-Quoted 1 line
gfx.mec_fw->data;drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-2- adev->firmware.fw_size += - ALIGN(le32_to_cpu(cp_hdr->jt_size) << 2,
PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-3- -if (amdgpu_sriov_vf (adev)) { - info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_STORAGE];
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-4- info->ucode_id =AMDGPU_UCODE_ID_STORAGE ; - info->fw = adev->gfx.mec_fw; - adev->firmware.fw_size += - ALIGN(le32_to_cpu(64 * PAGE_SIZE),
PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-4- } - -if (adev->gfx.mec2_fw) { - info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_CP_MEC2];
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-3- info->ucode_id =AMDGPU_UCODE_ID_CP_MEC2 ; - info->fw = adev->gfx.mec2_fw; - header = (const struct common_firmware_header*)info->fw->data;
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-2- adev->firmware.fw_size += - ALIGN(le32_to_cpu(header-Quoted 1 line
ucode_size_bytes),PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-86- } - } out:@@ -4181,45 +4178,11 @@ static void gfx_v8_0_rlc_start(struct amdgpu_device *adev) udelay(50); } -static int gfx_v8_0_rlc_load_microcode(struct amdgpu_device *adev) -{ -const struct rlc_firmware_header_v2_0 *hdr; -const __le32 *fw_data; -unsigned i, fw_size; - -if (!adev->gfx.rlc_fw) -return -EINVAL ; - - hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw- >data; -amdgpu_ucode_print_rlc_hdr (&hdr->header); - - fw_data = (const __le32 *)(adev->gfx.rlc_fw->data + -le32_to_cpu (hdr- >header.ucode_array_offset_bytes)); - fw_size =le32_to_cpu (hdr->header.ucode_size_bytes) /4 ; - -WREG32 (mmRLC_GPM_UCODE_ADDR,0 ); -for (i =0 ; i < fw_size; i++) -WREG32 (mmRLC_GPM_UCODE_DATA, le32_to_cpup(fw_data++)); -WREG32 (mmRLC_GPM_UCODE_ADDR, adev->gfx.rlc_fw_version); - -return 0 ; -} -static int gfx_v8_0_rlc_resume (struct amdgpu_device *adev) { -int r; -gfx_v8_0_rlc_stop (adev);gfx_v8_0_rlc_reset (adev);gfx_v8_0_init_pg (adev); - -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_DIRECT ) { -/* legacy rlc firmware loading */ - r =gfx_v8_0_rlc_load_microcode (adev); -if (r) -return r; - } -gfx_v8_0_rlc_start (adev);return 0 ;@@ -4245,63 +4208,6 @@ static void gfx_v8_0_cp_gfx_enable(struct amdgpu_device *adev, bool enable) udelay(50); } -static int gfx_v8_0_cp_gfx_load_microcode(struct amdgpu_device *adev) -{ -const struct gfx_firmware_header_v1_0 *pfp_hdr; -const struct gfx_firmware_header_v1_0 *ce_hdr; -const struct gfx_firmware_header_v1_0 *me_hdr; -const __le32 *fw_data; -unsigned i, fw_size; - -if (!adev->gfx.me_fw || !adev->gfx.pfp_fw || !adev->gfx.ce_fw) -return -EINVAL ; - - pfp_hdr = (const struct gfx_firmware_header_v1_0 *) - adev->gfx.pfp_fw->data; - ce_hdr = (const struct gfx_firmware_header_v1_0 *) - adev->gfx.ce_fw->data; - me_hdr = (const struct gfx_firmware_header_v1_0 *) - adev->gfx.me_fw->data; - -amdgpu_ucode_print_gfx_hdr (&pfp_hdr->header); -amdgpu_ucode_print_gfx_hdr (&ce_hdr->header); -amdgpu_ucode_print_gfx_hdr (&me_hdr->header); - -gfx_v8_0_cp_gfx_enable (adev, false); - -/* PFP */ - fw_data = (const __le32 *) - (adev->gfx.pfp_fw->data + -le32_to_cpu (pfp_hdr->header.ucode_array_offset_bytes)); - fw_size =le32_to_cpu (pfp_hdr->header.ucode_size_bytes) /4 ; -WREG32 (mmCP_PFP_UCODE_ADDR,0 ); -for (i =0 ; i < fw_size; i++) -WREG32 (mmCP_PFP_UCODE_DATA, le32_to_cpup(fw_data++)); -WREG32 (mmCP_PFP_UCODE_ADDR, adev->gfx.pfp_fw_version); - -/* CE */ - fw_data = (const __le32 *) - (adev->gfx.ce_fw->data + -le32_to_cpu (ce_hdr->header.ucode_array_offset_bytes)); - fw_size =le32_to_cpu (ce_hdr->header.ucode_size_bytes) /4 ; -WREG32 (mmCP_CE_UCODE_ADDR,0 ); -for (i =0 ; i < fw_size; i++) -WREG32 (mmCP_CE_UCODE_DATA, le32_to_cpup(fw_data++)); -WREG32 (mmCP_CE_UCODE_ADDR, adev->gfx.ce_fw_version); - -/* ME */ - fw_data = (const __le32 *) - (adev->gfx.me_fw->data + -le32_to_cpu (me_hdr->header.ucode_array_offset_bytes)); - fw_size =le32_to_cpu (me_hdr->header.ucode_size_bytes) /4 ; -WREG32 (mmCP_ME_RAM_WADDR,0 ); -for (i =0 ; i < fw_size; i++) - WREG32(mmCP_ME_RAM_DATA,
le32_to_cpup(fw_data++));drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-27-WREG32 (mmCP_ME_RAM_WADDR, adev->gfx.me_fw_version); - -return 0 ; -} -static u32 gfx_v8_0_get_csb_size (struct amdgpu_device *adev) {u32 count =0 ;@@ -4501,52 +4407,6 @@ static void gfx_v8_0_cp_compute_enable(struct amdgpu_device *adev, bool enable) udelay(50); } -static int gfx_v8_0_cp_compute_load_microcode (struct amdgpu_device *adev) -{ -const struct gfx_firmware_header_v1_0 *mec_hdr; -const __le32 *fw_data; -unsigned i, fw_size; - -if (!adev->gfx.mec_fw) -return -EINVAL ; - -gfx_v8_0_cp_compute_enable (adev, false); - - mec_hdr = (const struct gfx_firmware_header_v1_0 *)adev- >gfx.mec_fw->data; -amdgpu_ucode_print_gfx_hdr (&mec_hdr->header); - - fw_data = (const __le32 *) - (adev->gfx.mec_fw->data + -le32_to_cpu (mec_hdr->header.ucode_array_offset_bytes)); - fw_size =le32_to_cpu (mec_hdr->header.ucode_size_bytes) /4 ; - -/* MEC1 */ -WREG32 (mmCP_MEC_ME1_UCODE_ADDR,0 ); -for (i =0 ; i < fw_size; i++) - WREG32(mmCP_MEC_ME1_UCODE_DATA,
le32_to_cpup(fw_data+i));drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-1- WREG32(mmCP_MEC_ME1_UCODE_ADDR, adev-Quoted 1 line
gfx.mec_fw_version);
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-2- -/* Loading MEC2 firmware is only necessary if MEC2 should run different microcode than MEC1. */
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-4-if (adev->gfx.mec2_fw) { -const struct gfx_firmware_header_v1_0 *mec2_hdr; - - mec2_hdr = (const struct gfx_firmware_header_v1_0*)adev->gfx.mec2_fw->data;
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-5-amdgpu_ucode_print_gfx_hdr (&mec2_hdr->header); - - fw_data = (const __le32 *) - (adev->gfx.mec2_fw->data + - le32_to_cpu(mec2_hdr-Quoted 1 line
header.ucode_array_offset_bytes));
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-1- fw_size = le32_to_cpu(mec2_hdr-Quoted 1 line
header.ucode_size_bytes) / 4;
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-4- -WREG32 (mmCP_MEC_ME2_UCODE_ADDR,0 ); -for (i =0 ; i < fw_size; i++) - WREG32(mmCP_MEC_ME2_UCODE_DATA,
le32_to_cpup(fw_data+i));drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-1- WREG32(mmCP_MEC_ME2_UCODE_ADDR, adev-Quoted 1 line
gfx.mec2_fw_version);
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1
-16- } - -return 0 ; -} -/* KIQ functions */ static void gfx_v8_0_kiq_setting(struct amdgpu_ring *ring) { @@ -4980,17 +4840,6 @@ static int gfx_v8_0_cp_resume(struct amdgpu_device *adev) if (!(adev->flags & AMD_IS_APU)) gfx_v8_0_enable_gui_idle_interrupt(adev, false); -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_DIRECT ) { -/* legacy firmware loading */ - r =gfx_v8_0_cp_gfx_load_microcode (adev); -if (r) -return r; - - r =gfx_v8_0_cp_compute_load_microcode (adev); -if (r) -return r; - } - r =gfx_v8_0_kiq_resume (adev);if (r)return r;drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +0
-7@@ -318,14 +318,13 @@ static int sdma_v3_0_init_microcode(struct amdgpu_device *adev)if (adev->sdma.instance[i].feature_version >=20 ) adev->sdma.instance[i].burst_nop = true; -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_SMU ) { - info = &adev- >firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i]; - info->ucode_id =AMDGPU_UCODE_ID_SDMA0 + i; - info->fw = adev->sdma.instance[i].fw; - header = (const struct common_firmware_header *)info->fw->data; - adev->firmware.fw_size += - ALIGN(le32_to_cpu(header-Quoted 1 line
ucode_size_bytes),PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +1
-1- } + info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i];
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +3
-0+ info->ucode_id =AMDGPU_UCODE_ID_SDMA0 + i; + info->fw = adev->sdma.instance[i].fw; + header = (const struct common_firmware_header *)info-Quoted 1 line
fw->data;drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +2
-0+ adev->firmware.fw_size += + ALIGN(le32_to_cpu(header->ucode_size_bytes),
PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +1
-29+ } out:if (err) {@@ -778,42 +777,6 @@ static int sdma_v3_0_rlc_resume(struct amdgpu_device *adev) }/** -* sdma_v3_0_load_microcode - load the sDMA ME ucode -* -* @adev: amdgpu_device pointer -* -* Loads the sDMA0/1 ucode. -* Returns 0 for success, -EINVAL if the ucode is not available. -*/ -static int sdma_v3_0_load_microcode(struct amdgpu_device *adev) -{ -const struct sdma_firmware_header_v1_0 *hdr; -const __le32 *fw_data; -u32 fw_size; -int i, j; - -/* halt the MEs */ -sdma_v3_0_enable (adev, false); - -for (i =0 ; i < adev->sdma.num_instances; i++) { -if (!adev->sdma.instance[i].fw) -return -EINVAL ; - hdr = (const struct sdma_firmware_header_v1_0 *)adev->sdma.instance[i].fw->data; -amdgpu_ucode_print_sdma_hdr (&hdr->header); - fw_size =le32_to_cpu (hdr->header.ucode_size_bytes) /4 ; - fw_data = (const __le32 *) - (adev->sdma.instance[i].fw->data + -le32_to_cpu (hdr->header.ucode_array_offset_bytes)); -WREG32 (mmSDMA0_UCODE_ADDR + sdma_offsets[i],0 ); -for (j =0 ; j < fw_size; j++) -WREG32 (mmSDMA0_UCODE_DATA +sdma_offsets[i], le32_to_cpup(fw_data++)); - WREG32(mmSDMA0_UCODE_ADDR + sdma_offsets[i], adev-Quoted 1 line
sdma.instance[i].fw_version);
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +0
-13- } - -return 0 ; -} - -/** * sdma_v3_0_start - setup and start the async dma engines * * @adev: amdgpu_device pointer @@ -825,12 +788,6 @@ static int sdma_v3_0_start(struct amdgpu_device *adev) {int r; -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_DIRECT ) { - r =sdma_v3_0_load_microcode (adev); -if (r) -return r; - } -/* disable sdma engine before programing it */ sdma_v3_0_ctx_switch_enable (adev, false);sdma_v3_0_enable (adev, false); --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quan, Evan
Reviewed-by Evan QuanRE: [PATCH 2/6] drm/amdgpu: Move gfx flag in_suspend to adev
In reply to a message not in the archiveQuoted 162 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Rex Zhu
Sent: 2018年9月30日 0:15
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH 2/6] drm/amdgpu: Move gfx flagin_suspendto adevMove
in_suspendflag to adev from gfx, so can be used in other ip blocks, also keep consistent withgpu_in_resetflag.Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 3 +-- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 13 +++---------- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 16 ++++------------ 5 files changed, 14 insertions(+), 24 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +3
-0@@ -1046,6 +1046,9 @@ struct amdgpu_device {bool has_hw_reset;u8 reset_magic[AMDGPU_RESET_MAGIC_NUM ]; +/* s3/s4 mask */ +bool in_suspend; +/* record last mm index being written through WREG32*/ unsigned long last_mm_index;drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0bool in_gpu_reset;drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-0@@ -2649,6 +2649,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)if (dev->switch_power_state ==DRM_SWITCH_POWER_OFF )return 0 ; + adev->in_suspend = true;drm_kms_helper_poll_disable (dev);drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2
-0if (fbcon)@@ -2834,6 +2835,8 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) #ifdef CONFIG_PM dev->dev->power.disable_depth--;#endif + adev->in_suspend = false; + return 0; }drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +1
-2@@ -297,8 +297,7 @@ struct amdgpu_gfx {/* reset mask */ uint32_t grbm_soft_reset;uint32_t srbm_soft_reset; -/* s3/s4 mask */ -bool in_suspend; +/* NGG */ struct amdgpu_ngg ngg;drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1
-1@@ -4732,7 +4732,7 @@ static int gfx_v8_0_kcq_init_queue(struct amdgpu_ring *ring)struct vi_mqd *mqd = ring->mqd_ptr;int mqd_idx = ring - &adev->gfx.compute_ring[0 ]; -if (!adev->in_gpu_reset && !adev->gfx.in_suspend) { +if (!adev->in_gpu_reset && !adev->in_suspend) {memset ((void *)mqd,0 ,sizeof (struct vi_mqd_allocation )); ((struct vi_mqd_allocation *)mqd)->dynamic_cu_mask =
0xFFFFFFFF;
((structvi_mqd_allocation*)mqd)->dynamic_rb_mask =0xFFFFFFFF; @@ -4991,19 +4991,12 @@ static intgfx_v8_0_hw_fini(void *handle)static int
gfx_v8_0_suspend(void *handle){drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2
-9-struct amdgpu_device *adev = (struct amdgpu_device *)handle; - adev->gfx.in_suspend = true; -return gfx_v8_0_hw_fini (adev); +return gfx_v8_0_hw_fini (handle); }static int gfx_v8_0_resume (void *handle) { -int r; -struct amdgpu_device *adev = (struct amdgpu_device *)handle; - - r =gfx_v8_0_hw_init (adev); - adev->gfx.in_suspend = false; -return r; +return gfx_v8_0_hw_init (handle); } static bool gfx_v8_0_check_soft_reset(void *handle) diff --git
a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.cb/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 7a6a814..4b020cc 100644drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1@@ -3198,7 +3198,7 @@ static int gfx_v9_0_kcq_init_queue(struct amdgpu_ring *ring)struct v9_mqd *mqd = ring->mqd_ptr;int mqd_idx = ring - &adev->gfx.compute_ring[0 ]; -if (!adev->in_gpu_reset && !adev->gfx.in_suspend) { +if (!adev->in_gpu_reset && !adev->in_suspend) {memset ((void *)mqd,0 ,sizeof (struct v9_mqd_allocation )); ((struct v9_mqd_allocation *)mqd)->dynamic_cu_mask =
0xFFFFFFFF;
((structv9_mqd_allocation*)mqd)->dynamic_rb_mask =0xFFFFFFFF; @@ -3417,7 +3417,7 @@ static intgfx_v9_0_hw_fini(void *handle)
/* Use deinitialize sequence from CAIL when unbinding device from
driver,drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3
-12* otherwise KIQ is hanging when binding back */ -if (!adev->in_gpu_reset && !adev->gfx.in_suspend) { +if (!adev->in_gpu_reset && !adev->in_suspend) {mutex_lock (&adev->srbm_mutex); soc15_grbm_select(adev, adev->gfx.kiq.ring.me, adev->gfx.kiq.ring.pipe,@@ -3437,20 +3437,12 @@ static int gfx_v9_0_hw_fini(void *handle)static int gfx_v9_0_suspend (void *handle) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; - - adev->gfx.in_suspend = true; -return gfx_v9_0_hw_fini (adev); +return gfx_v9_0_hw_fini (handle); }static int gfx_v9_0_resume (void *handle) { -struct amdgpu_device *adev = (struct amdgpu_device *)handle; -int r; - - r =gfx_v9_0_hw_init (adev); - adev->gfx.in_suspend = false; -return r; +return gfx_v9_0_hw_init (handle); }static bool gfx_v9_0_is_idle (void *handle) --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 3/6] drm/amdgpu: Fix cg/pg unexpected disabled when hw init failed
In reply to a message not in the archiveComment inline
Quoted 47 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Rex Zhu
Sent: 2018年9月30日 0:15
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH 3/6] drm/amdgpu: Fix cg/pg unexpected disabled when hw init failedCheck the ip blocks
late_initializedstate before enable/disable cg/pg, so if hw init failed, cg/pg function will not be executed.Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -1656,7 +1656,7 @@ static int amdgpu_device_set_cg_state(struct amdgpu_device *adev, for (j = 0; j < adev->num_ip_blocks; j++) { i = state ==AMD_CG_STATE_GATE ? j : adev- >num_ip_blocks - j - 1; -if (!adev->ip_blocks[i].status.valid) +if (!adev->ip_blocks[i].status.late_initialized)continue ;drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0/* skip CG for VCE/UVD, it's handled specially */ if (adev->ip_blocks[i].version->type !=
AMD_IP_BLOCK_TYPE_UVD&& @@ -1686,7 +1686,7 @@ static int amdgpu_device_set_pg_state(structamdgpu_device*adev, enumamd_powerdrivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0for (j =0 ; j < adev->num_ip_blocks; j++) { i = state == AMD_PG_STATE_GATE ? j : adev-Quoted 1 line
num_ip_blocks- j - 1;drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1-if (!adev->ip_blocks[i].status.valid) +if (!adev->ip_blocks[i].status.late_initialized)continue ;/* skip CG for VCE/UVD, it's handled specially */ if (adev->ip_blocks[i].version->type !=
AMD_IP_BLOCK_TYPE_UVD&& @@ -1723,7 +1723,7 @@ static intamdgpu_device_ip_late_init(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_late_init(struct amdgpu_device *adev) · line 1726
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1int i =0 , r;for (i =0 ; i < adev->num_ip_blocks; i++) { -if (!adev->ip_blocks[i].status.valid) +if (!adev->ip_blocks[i].status.hw)
[Quan, Evan] typo?
Quoted 18 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0continue ;if (adev->ip_blocks[i].version->funcs->late_init) { r = adev->ip_blocks[i].version->funcs->late_init((void*)adev); @@ -1732,8 +1732,8 @@ static int
amdgpu_device_ip_late_init(struct amdgpu_device *adev)
adev->ip_blocks[i].version->funcs-Quoted 1 line
name, r);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-2return r; } - adev->ip_blocks[i].status.late_initialized = true; } + adev->ip_blocks[i].status.late_initialized = true; }amdgpu_device_set_cg_state (adev,AMD_CG_STATE_GATE ); --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 4/6] drm/amdgpu: Don't allocate memory for ucode when suspend
In reply to a message not in the archiveThe patch is fine. But i can not see where amdgpu_ucode_init_bo is called on resume.
Regards,
Evan
Quoted 37 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Rex Zhu
Sent: 2018年9月30日 0:15
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH 4/6] drm/amdgpu: Don't allocate memory for ucode when suspenddriver don't release the ucode memory when suspend. so don't need to allocate bo when resume back.
Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +1
-1@@ -432,7 +432,7 @@ int amdgpu_ucode_init_bo(struct amdgpu_device *adev)return 0 ; } -if (!adev->in_gpu_reset) { +if (!adev->in_gpu_reset && !adev->in_suspend) { err = amdgpu_bo_create_kernel(adev, adev- >firmware.fw_size, PAGE_SIZE,
amdgpu_sriov_vf(adev)?AMDGPU_GEM_DOMAIN_VRAM:AMDGPU_GEM_DOMAIN_GTT,
&adev->firmware.fw_buf,
--
1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quan, Evan
Reviewed-by Evan QuanRE: [PATCH 5/6] drm/amd/pp: Fix memory leak on Si/CI/AI dgpu asics
In reply to a message not in the archiveQuoted 40 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Rex Zhu
Sent: 2018年9月30日 0:15
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH 5/6] drm/amd/pp: Fix memory leak on Si/CI/AI dgpu asicsOn SI/CI/AI, driver still need to release smu's fw, it was not related to other hw ip's fw
load_type.Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/powerplay/amd_powerplay.c +4
-5@@ -109,11 +109,11 @@ static int pp_sw_fini(void *handle)hwmgr_sw_fini (hwmgr); -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_SMU ) { -release_firmware (adev->pm.fw); - adev->pm.fw =NULL ; +if (adev->firmware.load_type ==AMDGPU_FW_LOAD_SMU )amdgpu_ucode_fini_bo (adev); - } + +release_firmware (adev->pm.fw); + adev->pm.fw =NULL ;return 0 ; } --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quan, Evan
Reviewed-by Evan QuanRE: [PATCH 6/6] drm/amdgpu: Drop dead define in amdgpu.h
In reply to a message not in the archiveQuoted 67 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Rex Zhu
Sent: 2018年9月30日 0:15
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH 6/6] drm/amdgpu: Drop dead define inamdgpu.hthe struct was not in use any more.
Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 28 ---------------------------- 1 file changed, 28 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-25@@ -616,31 +616,6 @@ struct amdgpu_wb {*/ void amdgpu_test_moves (struct amdgpu_device *adev); - -/* -* amdgpu smumgr functions -*/ -struct amdgpu_smumgr_funcs { -int (*check_fw_load_finish)(struct amdgpu_device *adev,uint32_t fwtype); -int (*request_smu_load_fw)(struct amdgpu_device *adev); -int (*request_smu_specific_fw)(struct amdgpu_device *adev, uint32_t fwtype); -}; - -/* -* amdgpu smumgr -*/ -struct amdgpu_smumgr { -struct amdgpu_bo *toc_buf; -struct amdgpu_bo *smu_buf; -/* asic priv smu data */ -void *priv; -spinlock_t smu_lock; -/* smumgr functions */ -const struct amdgpu_smumgr_funcs *smumgr_funcs; -/* ucode loading complete flag */ -uint32_t fw_flags; -}; -/* * ASIC specific register table accessible by UMD */
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-4@@ -979,9 +954,6 @@ struct amdgpu_device {u32 cg_flags;u32 pg_flags; -/* amdgpu smumgr */ -struct amdgpu_smumgr smu; -/* gfx */ struct amdgpu_gfx gfx; --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 3/6] drm/amdgpu: Fix cg/pg unexpected disabled when hw init failed
In reply to a message not in the archiveQuoted 58 lines
-----Original Message-----
From: Quan, Evan
Sent: Sunday, September 30, 2018 11:03 AM
To: Zhu, Rex <[email protected]>; [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: RE: [PATCH 3/6] drm/amdgpu: Fix cg/pg unexpected disabled when hw init failedComment inline
Quoted 31 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Rex Zhu
Sent: 2018年9月30日 0:15
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH 3/6] drm/amdgpu: Fix cg/pg unexpected disabled when hw init failedCheck the ip blocks
late_initializedstate before enable/disable cg/pg, so if hw init failed, cg/pg function will not be executed.Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -1656,7 +1656,7 @@ static int amdgpu_device_set_cg_state(struct amdgpu_device *adev, for (j = 0; j < adev->num_ip_blocks; j++) { i = state ==AMD_CG_STATE_GATE ? j : adev- >num_ip_blocks - j - 1; -if (!adev->ip_blocks[i].status.valid) +if (!adev->ip_blocks[i].status.late_initialized)continue ;drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0/* skip CG for VCE/UVD, it's handled specially */ if (adev->ip_blocks[i].version->type !=
AMD_IP_BLOCK_TYPE_UVD&& @@drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_set_cg_state(struct amdgpu_device *adev,
Quoted 11 lines
-1686,7 +1686,7 @@ static int amdgpu_device_set_pg_state(struct
amdgpu_device*adev, enumamd_powerdrivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0for (j =0 ; j < adev->num_ip_blocks; j++) { i = state == AMD_PG_STATE_GATE ? j : adev-Quoted 1 line
num_ip_blocks- j - 1;drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1-if (!adev->ip_blocks[i].status.valid) +if (!adev->ip_blocks[i].status.late_initialized)continue ;/* skip CG for VCE/UVD, it's handled specially */ if (adev->ip_blocks[i].version->type !=
AMD_IP_BLOCK_TYPE_UVD&& @@
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_late_init(struct amdgpu_device *adev) · line 1726
Quoted 7 lines
-1723,7 +1723,7 @@ static int
amdgpu_device_ip_late_init(struct amdgpu_device *adev)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1int i =0 , r;for (i =0 ; i < adev->num_ip_blocks; i++) { -if (!adev->ip_blocks[i].status.valid) +if (!adev->ip_blocks[i].status.hw)[Quan, Evan] typo?
No, In late_init, we check the hw_init status.
Rex
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0continue ;if (adev->ip_blocks[i].version->funcs->late_init) { r = adev->ip_blocks[i].version->funcs->late_init((void*)adev); @@ -1732,8 +1732,8 @@ static int
amdgpu_device_ip_late_init(struct amdgpu_device *adev)
adev->ip_blocks[i].version->funcs-Quoted 1 line
name, r);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1return r; } - adev->ip_blocks[i].status.late_initialized = true; } + adev->ip_blocks[i].status.late_initialized = true; }
Quoted 8 lines
Quoted 8 lines
amdgpu_device_set_cg_state(adev, AMD_CG_STATE_GATE);
--
1.9.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
I will add some warnings in dmesg.
Thanks
Best Regards
Rex
Quoted 492 lines
-----Original Message-----
From: Quan, Evan
Sent: Sunday, September 30, 2018 10:30 AM
To: Zhu, Rex <[email protected]>; [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: RE: [PATCH 1/6] drm/amdgpu: RemoveFW_LOAD_DIRECTtype support on VIInstead of change the fw load type to
AMDGPU_FW_LOAD_SMUsilently, it's better to warn/error out if user specifyFW_LOAD_DIRECTload type.Regards,
EvanQuoted 7 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Rex Zhu
Sent: 2018年9月30日 0:15
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH 1/6] drm/amdgpu: RemoveFW_LOAD_DIRECTtypesupport on
Quoted 227 lines
VI
AMDGPU_FW_LOAD_DIRECTis used for bring up. Now it don't work any more. so remove the support.Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 - drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 249 ++++++--------------------- --- drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 57 +------ 3 files changed, 56 insertions(+), 253 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +0
-3@@ -297,9 +297,6 @@ enum amdgpu_firmware_load_typecase CHIP_POLARIS11 :case CHIP_POLARIS12 :case CHIP_VEGAM : -if (!load_type) -return AMDGPU_FW_LOAD_DIRECT ; -else return AMDGPU_FW_LOAD_SMU ;case CHIP_VEGA10 :case CHIP_RAVEN :drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +41
-25@@ -1173,64 +1173,61 @@ static int gfx_v8_0_init_microcode(struct amdgpu_device *adev) } } -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_SMU ) { - info = &adev- >firmware.ucode[AMDGPU_UCODE_ID_CP_PFP]; - info->ucode_id =AMDGPU_UCODE_ID_CP_PFP ; - info->fw = adev->gfx.pfp_fw; - header = (const struct common_firmware_header *)info- >fw->data; - adev->firmware.fw_size += -ALIGN (le32_to_cpu (header->ucode_size_bytes), PAGE_SIZE); - - info = &adev- >firmware.ucode[AMDGPU_UCODE_ID_CP_ME]; - info->ucode_id =AMDGPU_UCODE_ID_CP_ME ; - info->fw = adev->gfx.me_fw; - header = (const struct common_firmware_header *)info- >fw->data; - adev->firmware.fw_size += -ALIGN (le32_to_cpu (header->ucode_size_bytes), PAGE_SIZE); - - info = &adev- >firmware.ucode[AMDGPU_UCODE_ID_CP_CE]; - info->ucode_id =AMDGPU_UCODE_ID_CP_CE ; - info->fw = adev->gfx.ce_fw; - header = (const struct common_firmware_header *)info- >fw->data; - adev->firmware.fw_size += -ALIGN (le32_to_cpu (header->ucode_size_bytes), PAGE_SIZE); + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_PFP ]; + info->ucode_id =AMDGPU_UCODE_ID_CP_PFP ; + info->fw = adev->gfx.pfp_fw; + header = (const struct common_firmware_header *)info->fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (header->ucode_size_bytes),PAGE_SIZE ); + + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_ME ]; + info->ucode_id =AMDGPU_UCODE_ID_CP_ME ; + info->fw = adev->gfx.me_fw; + header = (const struct common_firmware_header *)info->fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (header->ucode_size_bytes),PAGE_SIZE ); + + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_CE ]; + info->ucode_id =AMDGPU_UCODE_ID_CP_CE ; + info->fw = adev->gfx.ce_fw; + header = (const struct common_firmware_header *)info->fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (header->ucode_size_bytes),PAGE_SIZE ); + + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_RLC_G ]; + info->ucode_id =AMDGPU_UCODE_ID_RLC_G ; + info->fw = adev->gfx.rlc_fw; + header = (const struct common_firmware_header *)info->fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (header->ucode_size_bytes),PAGE_SIZE ); + + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_MEC1 ]; + info->ucode_id =AMDGPU_UCODE_ID_CP_MEC1 ; + info->fw = adev->gfx.mec_fw; + header = (const struct common_firmware_header *)info->fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (header->ucode_size_bytes),PAGE_SIZE ); + +/* we need account JT in */ + cp_hdr = (const struct gfx_firmware_header_v1_0 *)adev- >gfx.mec_fw->data; + adev->firmware.fw_size += +ALIGN (le32_to_cpu (cp_hdr->jt_size) <<2 ,PAGE_SIZE ); - info = &adev- >firmware.ucode[AMDGPU_UCODE_ID_RLC_G]; - info->ucode_id =AMDGPU_UCODE_ID_RLC_G ; - info->fw = adev->gfx.rlc_fw; - header = (const struct common_firmware_header *)info- >fw->data; +if (amdgpu_sriov_vf (adev)) { + info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_STORAGE];
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2
-1+ info->ucode_id =AMDGPU_UCODE_ID_STORAGE ; + info->fw = adev->gfx.mec_fw; adev->firmware.fw_size += - ALIGN(le32_to_cpu(header->ucode_size_bytes),
PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2
-1+ALIGN (le32_to_cpu (64 *PAGE_SIZE ),PAGE_SIZE ); + } - info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_CP_MEC1];
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2
-2- info->ucode_id =AMDGPU_UCODE_ID_CP_MEC1 ; - info->fw = adev->gfx.mec_fw; +if (adev->gfx.mec2_fw) { + info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_CP_MEC2];
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2
-0+ info->ucode_id =AMDGPU_UCODE_ID_CP_MEC2 ; + info->fw = adev->gfx.mec2_fw; header = (const struct common_firmware_header *)info-Quoted 1 line
fw->data;drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-0adev->firmware.fw_size += ALIGN(le32_to_cpu(header->ucode_size_bytes),
PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-3- -/* we need account JT in */ - cp_hdr = (const struct gfx_firmware_header_v1_0 *)adev-Quoted 1 line
gfx.mec_fw->data;drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-2- adev->firmware.fw_size += - ALIGN(le32_to_cpu(cp_hdr->jt_size) << 2,
PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-3- -if (amdgpu_sriov_vf (adev)) { - info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_STORAGE];
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-4- info->ucode_id =AMDGPU_UCODE_ID_STORAGE ; - info->fw = adev->gfx.mec_fw; - adev->firmware.fw_size += - ALIGN(le32_to_cpu(64 * PAGE_SIZE),
PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-4- } - -if (adev->gfx.mec2_fw) { - info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_CP_MEC2];
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-3- info->ucode_id =AMDGPU_UCODE_ID_CP_MEC2 ; - info->fw = adev->gfx.mec2_fw; - header = (const struct common_firmware_header*)info->fw->data;
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-2- adev->firmware.fw_size += - ALIGN(le32_to_cpu(header-Quoted 1 line
ucode_size_bytes),PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-35- } - } out:@@ -4181,45 +4178,11 @@ static void gfx_v8_0_rlc_start(struct amdgpu_device *adev) udelay(50); } -static int gfx_v8_0_rlc_load_microcode(struct amdgpu_device *adev) -{ -const struct rlc_firmware_header_v2_0 *hdr; -const __le32 *fw_data; -unsigned i, fw_size; - -if (!adev->gfx.rlc_fw) -return -EINVAL ; - - hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw- >data; -amdgpu_ucode_print_rlc_hdr (&hdr->header); - - fw_data = (const __le32 *)(adev->gfx.rlc_fw->data + -le32_to_cpu (hdr- >header.ucode_array_offset_bytes)); - fw_size =le32_to_cpu (hdr->header.ucode_size_bytes) /4 ; - -WREG32 (mmRLC_GPM_UCODE_ADDR,0 ); -for (i =0 ; i < fw_size; i++) -WREG32 (mmRLC_GPM_UCODE_DATA, le32_to_cpup(fw_data++)); -WREG32 (mmRLC_GPM_UCODE_ADDR, adev->gfx.rlc_fw_version); - -return 0 ; -} -static int gfx_v8_0_rlc_resume (struct amdgpu_device *adev) { -int r; -gfx_v8_0_rlc_stop (adev);gfx_v8_0_rlc_reset (adev);gfx_v8_0_init_pg (adev); - -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_DIRECT ) { -/* legacy rlc firmware loading */ - r =gfx_v8_0_rlc_load_microcode (adev); -if (r) -return r; - } -gfx_v8_0_rlc_start (adev);return 0 ;drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c static void gfx_v8_0_cp_gfx_enable(struct · line 4249
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-1@@ -4245,63 +4208,6 @@ static void gfx_v8_0_cp_gfx_enable(struct amdgpu_device *adev, bool enable) udelay(50); } -static int gfx_v8_0_cp_gfx_load_microcode(struct amdgpu_device *adev) -{
Quoted 238 lines
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-50-const struct gfx_firmware_header_v1_0 *pfp_hdr; -const struct gfx_firmware_header_v1_0 *ce_hdr; -const struct gfx_firmware_header_v1_0 *me_hdr; -const __le32 *fw_data; -unsigned i, fw_size; - -if (!adev->gfx.me_fw || !adev->gfx.pfp_fw || !adev->gfx.ce_fw) -return -EINVAL ; - - pfp_hdr = (const struct gfx_firmware_header_v1_0 *) - adev->gfx.pfp_fw->data; - ce_hdr = (const struct gfx_firmware_header_v1_0 *) - adev->gfx.ce_fw->data; - me_hdr = (const struct gfx_firmware_header_v1_0 *) - adev->gfx.me_fw->data; - -amdgpu_ucode_print_gfx_hdr (&pfp_hdr->header); -amdgpu_ucode_print_gfx_hdr (&ce_hdr->header); -amdgpu_ucode_print_gfx_hdr (&me_hdr->header); - -gfx_v8_0_cp_gfx_enable (adev, false); - -/* PFP */ - fw_data = (const __le32 *) - (adev->gfx.pfp_fw->data + -le32_to_cpu (pfp_hdr->header.ucode_array_offset_bytes)); - fw_size =le32_to_cpu (pfp_hdr->header.ucode_size_bytes) /4 ; -WREG32 (mmCP_PFP_UCODE_ADDR,0 ); -for (i =0 ; i < fw_size; i++) -WREG32 (mmCP_PFP_UCODE_DATA, le32_to_cpup(fw_data++)); -WREG32 (mmCP_PFP_UCODE_ADDR, adev->gfx.pfp_fw_version); - -/* CE */ - fw_data = (const __le32 *) - (adev->gfx.ce_fw->data + -le32_to_cpu (ce_hdr->header.ucode_array_offset_bytes)); - fw_size =le32_to_cpu (ce_hdr->header.ucode_size_bytes) /4 ; -WREG32 (mmCP_CE_UCODE_ADDR,0 ); -for (i =0 ; i < fw_size; i++) -WREG32 (mmCP_CE_UCODE_DATA, le32_to_cpup(fw_data++)); -WREG32 (mmCP_CE_UCODE_ADDR, adev->gfx.ce_fw_version); - -/* ME */ - fw_data = (const __le32 *) - (adev->gfx.me_fw->data + -le32_to_cpu (me_hdr->header.ucode_array_offset_bytes)); - fw_size =le32_to_cpu (me_hdr->header.ucode_size_bytes) /4 ; -WREG32 (mmCP_ME_RAM_WADDR,0 ); -for (i =0 ; i < fw_size; i++) - WREG32(mmCP_ME_RAM_DATA,
le32_to_cpup(fw_data++));drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-27-WREG32 (mmCP_ME_RAM_WADDR, adev->gfx.me_fw_version); - -return 0 ; -} -static u32 gfx_v8_0_get_csb_size (struct amdgpu_device *adev) {u32 count =0 ;@@ -4501,52 +4407,6 @@ static void gfx_v8_0_cp_compute_enable(struct amdgpu_device *adev, bool enable) udelay(50); } -static int gfx_v8_0_cp_compute_load_microcode (struct amdgpu_device *adev) -{ -const struct gfx_firmware_header_v1_0 *mec_hdr; -const __le32 *fw_data; -unsigned i, fw_size; - -if (!adev->gfx.mec_fw) -return -EINVAL ; - -gfx_v8_0_cp_compute_enable (adev, false); - - mec_hdr = (const struct gfx_firmware_header_v1_0 *)adev- >gfx.mec_fw->data; -amdgpu_ucode_print_gfx_hdr (&mec_hdr->header); - - fw_data = (const __le32 *) - (adev->gfx.mec_fw->data + -le32_to_cpu (mec_hdr->header.ucode_array_offset_bytes)); - fw_size =le32_to_cpu (mec_hdr->header.ucode_size_bytes) /4 ; - -/* MEC1 */ -WREG32 (mmCP_MEC_ME1_UCODE_ADDR,0 ); -for (i =0 ; i < fw_size; i++) - WREG32(mmCP_MEC_ME1_UCODE_DATA,
le32_to_cpup(fw_data+i));drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-1- WREG32(mmCP_MEC_ME1_UCODE_ADDR, adev-Quoted 1 line
gfx.mec_fw_version);
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-2- -/* Loading MEC2 firmware is only necessary if MEC2 should run different microcode than MEC1. */
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-4-if (adev->gfx.mec2_fw) { -const struct gfx_firmware_header_v1_0 *mec2_hdr; - - mec2_hdr = (const struct gfx_firmware_header_v1_0*)adev->gfx.mec2_fw->data;
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-5-amdgpu_ucode_print_gfx_hdr (&mec2_hdr->header); - - fw_data = (const __le32 *) - (adev->gfx.mec2_fw->data + - le32_to_cpu(mec2_hdr-Quoted 1 line
header.ucode_array_offset_bytes));
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-1- fw_size = le32_to_cpu(mec2_hdr-Quoted 1 line
header.ucode_size_bytes) / 4;
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-4- -WREG32 (mmCP_MEC_ME2_UCODE_ADDR,0 ); -for (i =0 ; i < fw_size; i++) - WREG32(mmCP_MEC_ME2_UCODE_DATA,
le32_to_cpup(fw_data+i));drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-1- WREG32(mmCP_MEC_ME2_UCODE_ADDR, adev-Quoted 1 line
gfx.mec2_fw_version);
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1
-17- } - -return 0 ; -} -/* KIQ functions */ static void gfx_v8_0_kiq_setting(struct amdgpu_ring *ring) { @@ -4980,17 +4840,6 @@ static int gfx_v8_0_cp_resume(struct amdgpu_device *adev) if (!(adev->flags & AMD_IS_APU)) gfx_v8_0_enable_gui_idle_interrupt(adev, false); -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_DIRECT ) { -/* legacy firmware loading */ - r =gfx_v8_0_cp_gfx_load_microcode (adev); -if (r) -return r; - - r =gfx_v8_0_cp_compute_load_microcode (adev); -if (r) -return r; - } - r =gfx_v8_0_kiq_resume (adev);if (r)return r;drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +0
-7@@ -318,14 +318,13 @@ static int sdma_v3_0_init_microcode(struct amdgpu_device *adev)if (adev->sdma.instance[i].feature_version >=20 ) adev->sdma.instance[i].burst_nop = true; -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_SMU ) { - info = &adev- >firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i]; - info->ucode_id =AMDGPU_UCODE_ID_SDMA0 + i; - info->fw = adev->sdma.instance[i].fw; - header = (const struct common_firmware_header *)info->fw->data; - adev->firmware.fw_size += - ALIGN(le32_to_cpu(header-Quoted 1 line
ucode_size_bytes),PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +1
-1- } + info = &adev-Quoted 1 line
firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i];
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +3
-0+ info->ucode_id =AMDGPU_UCODE_ID_SDMA0 + i; + info->fw = adev->sdma.instance[i].fw; + header = (const struct common_firmware_header *)info-Quoted 1 line
fw->data;drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +2
-0+ adev->firmware.fw_size += + ALIGN(le32_to_cpu(header->ucode_size_bytes),
PAGE_SIZE);drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +1
-29+ } out:if (err) {@@ -778,42 +777,6 @@ static int sdma_v3_0_rlc_resume(struct amdgpu_device *adev) }/** -* sdma_v3_0_load_microcode - load the sDMA ME ucode -* -* @adev: amdgpu_device pointer -* -* Loads the sDMA0/1 ucode. -* Returns 0 for success, -EINVAL if the ucode is not available. -*/ -static int sdma_v3_0_load_microcode(struct amdgpu_device *adev) -{ -const struct sdma_firmware_header_v1_0 *hdr; -const __le32 *fw_data; -u32 fw_size; -int i, j; - -/* halt the MEs */ -sdma_v3_0_enable (adev, false); - -for (i =0 ; i < adev->sdma.num_instances; i++) { -if (!adev->sdma.instance[i].fw) -return -EINVAL ; - hdr = (const struct sdma_firmware_header_v1_0 *)adev->sdma.instance[i].fw->data; -amdgpu_ucode_print_sdma_hdr (&hdr->header); - fw_size =le32_to_cpu (hdr->header.ucode_size_bytes) /4 ; - fw_data = (const __le32 *) - (adev->sdma.instance[i].fw->data + -le32_to_cpu (hdr->header.ucode_array_offset_bytes)); -WREG32 (mmSDMA0_UCODE_ADDR + sdma_offsets[i],0 ); -for (j =0 ; j < fw_size; j++) -WREG32 (mmSDMA0_UCODE_DATA +sdma_offsets[i], le32_to_cpup(fw_data++)); - WREG32(mmSDMA0_UCODE_ADDR + sdma_offsets[i], adev-Quoted 1 line
sdma.instance[i].fw_version);
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +0
-13- } - -return 0 ; -} - -/** * sdma_v3_0_start - setup and start the async dma engines * * @adev: amdgpu_device pointer @@ -825,12 +788,6 @@ static int sdma_v3_0_start(struct amdgpu_device *adev) {int r; -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_DIRECT ) { - r =sdma_v3_0_load_microcode (adev); -if (r) -return r; - } -/* disable sdma engine before programing it */ sdma_v3_0_ctx_switch_enable (adev, false);sdma_v3_0_enable (adev, false); --1.9.1
Quoted 4 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx