drm/amdgpu: ignore TA ucode for SRIOV
Subsystems (2)
PATCH 1/8 drm/amdgpu: ignore TA ucode for SRIOV
--- drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +2 -0
@@ -194,6 +194,8 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)case CHIP_NAVI10 :case CHIP_NAVI14 :case CHIP_NAVI12 : +if (amdgpu_sriov_vf (adev)) +break ;snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_ta.bin" , chip_name); err =request_firmware (&adev->psp.ta_fw, fw_name, adev->dev);if (err) {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/8 drm/amdgpu: skip cg/pg set for SRIOV
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +7 -0
@@ -7095,6 +7095,10 @@ static int gfx_v10_0_set_powergating_state(void *handle, {struct amdgpu_device *adev = (struct amdgpu_device *)handle;bool enable = (state ==AMD_PG_STATE_GATE ); + +if (amdgpu_sriov_vf (adev)) +return 0 ; +switch (adev->asic_type) {case CHIP_NAVI10 :case CHIP_NAVI14 :
@@ -7115,6 +7119,9 @@ static int gfx_v10_0_set_clockgating_state(void *handle, {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +if (amdgpu_sriov_vf (adev)) +return 0 ; +switch (adev->asic_type) {case CHIP_NAVI10 :case CHIP_NAVI14 :
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/8 drm/amdgpu: sriov is forbidden to call disable DPM
In reply to Monk Liu--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -0
@@ -1403,6 +1403,9 @@ static int smu_hw_init(void *handle)static int smu_stop_dpms (struct smu_context *smu) { +if (amdgpu_sriov_vf (smu->adev)) +return 0 ; +return smu_system_features_control (smu, false); }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/8 drm/amdgpu: provide RREG32_SOC15_NO_KIQ, will be used later
In reply to Monk Liu--- drivers/gpu/drm/amd/amdgpu/soc15_common.h | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/soc15_common.h +3 -0
@@ -35,6 +35,9 @@#define RREG32_SOC15 (ip, inst, reg) \ RREG32(adev->reg_offset[ip##_HWIP][inst][reg##_BASE_IDX] + reg) +#define RREG32_SOC15_NO_KIQ (ip, inst, reg) \ + RREG32_NO_KIQ(adev->reg_offset[ip##_HWIP][inst][reg##_BASE_IDX] + reg) +#define RREG32_SOC15_OFFSET (ip, inst, reg, offset) \ RREG32((adev->reg_offset[ip##_HWIP][inst][reg##_BASE_IDX] + reg) + offset)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 4/8] drm/amdgpu: provide RREG32_SOC15_NO_KIQ, will be used later
Am 23.04.20 um 09:01 schrieb Monk Liu:
Quoted 1 line
Signed-off-by Monk Liu <[email protected]>
Yeah, I also stumbled over that recently. Patch is Acked-by: Christian König <[email protected]>.
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/soc15_common.h | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/soc15_common.h +0
-0
drivers/gpu/drm/amd/amdgpu/soc15_common.h line 43
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/soc15_common.h +3
-0@@ -35,6 +35,9 @@#define RREG32_SOC15 (ip, inst, reg) \ RREG32(adev->reg_offset[ip##_HWIP][inst][reg##_BASE_IDX] + reg) +#define RREG32_SOC15_NO_KIQ (ip, inst, reg) \ + RREG32_NO_KIQ(adev->reg_offset[ip##_HWIP][inst][reg##_BASE_IDX] + reg) +#define RREG32_SOC15_OFFSET (ip, inst, reg, offset) \ RREG32((adev->reg_offset[ip##_HWIP][inst][reg##_BASE_IDX] + reg) + offset)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/8 drm/amdgpu: clear the messed up checking logic
In reply to Monk Liufor MI100 + ASICS, we always support SW_SMU for bare-metal and for SRIOV one_vf_mode
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -8
@@ -571,15 +571,10 @@ bool is_support_sw_smu(struct amdgpu_device *adev)if (adev->asic_type ==CHIP_VEGA20 )return (amdgpu_dpm ==2 ) ? true : false;else if (adev->asic_type >=CHIP_ARCTURUS ) { -if (amdgpu_sriov_vf (adev) && - !(adev->asic_type ==CHIP_ARCTURUS && -amdgpu_sriov_is_pp_one_vf (adev))) - -return false; -else +if (amdgpu_sriov_is_pp_one_vf (adev) || !amdgpu_sriov_vf (adev))return true; - }else -return false; + } +return false; }bool is_support_sw_smu_xgmi (struct amdgpu_device *adev)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 5/8] drm/amdgpu: clear the messed up checking logic
Please make this the last one of the series.
Other than that, this is acked-by: Evan Quan <[email protected]>
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Thursday, April 23, 2020 3:02 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH 5/8] drm/amdgpu: clear the messed up checking logic
for MI100 + ASICS, we always support SW_SMU for bare-metal and for SRIOV one_vf_mode
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -8
@@ -571,15 +571,10 @@ bool is_support_sw_smu(struct amdgpu_device *adev)if (adev->asic_type ==CHIP_VEGA20 )return (amdgpu_dpm ==2 ) ? true : false;else if (adev->asic_type >=CHIP_ARCTURUS ) { -if (amdgpu_sriov_vf (adev) && - !(adev->asic_type ==CHIP_ARCTURUS && -amdgpu_sriov_is_pp_one_vf (adev))) - -return false; -else +if (amdgpu_sriov_is_pp_one_vf (adev) || !amdgpu_sriov_vf (adev))return true; - }else -return false; + } +return false; }bool is_support_sw_smu_xgmi (struct amdgpu_device *adev)
--
2.7.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%7C88cd44199dc3451d709608d7e75438b0%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637232222119291353&sdata=rDamzIdmtaTo%2FCiEzyIo015JHJcZIV5ZyVLnkrJHcec%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/8 drm/amdgpu: enable one vf mode for nv12
In reply to Monk Liu--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 12 +++----- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 6 +++- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 49 +++++++++++++++++++++++++----- 3 files changed, 52 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +5 -7
@@ -347,13 +347,13 @@ int smu_get_dpm_freq_by_index(struct smu_context *smu, enum smu_clk_type clk_typ param = (uint32_t )(((clk_id &0xffff ) <<16 ) | (level &0xffff )); ret =smu_send_smc_msg_with_param (smu, SMU_MSG_GetDpmFreqByIndex, - param, ¶m); + param, value);if (ret)return ret;/* BIT31: 0 - Fine grained DPM, 1 - Dicrete DPM * now, we un-support it */ - *value = param &0x7fffffff ; + *value = *value &0x7fffffff ;return ret; }
@@ -535,7 +535,6 @@ int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, intint table_id =smu_table_get_index (smu, table_index);uint32_t table_size;int ret =0 ; -if (!table_data || table_id >=SMU_TABLE_COUNT || table_id <0 )return -EINVAL ;
@@ -691,7 +690,6 @@ int smu_feature_is_enabled(struct smu_context *smu, enum smu_feature_mask mask)if (smu->is_apu)return 1 ; - feature_id =smu_feature_get_index (smu, mask);if (feature_id <0 )return 0 ;
@@ -1339,6 +1337,9 @@ static int smu_hw_init(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle;struct smu_context *smu = &adev->smu; +if (amdgpu_sriov_vf (adev) && !amdgpu_sriov_is_pp_one_vf (adev)) +return 0 ; + ret =smu_start_smc_engine (smu);if (ret) {pr_err ("SMU is not ready yet!\n" );
@@ -1352,9 +1353,6 @@ static int smu_hw_init(void *handle)smu_set_gfx_cgpg (&adev->smu, true); } -if (amdgpu_sriov_vf (adev) && !amdgpu_sriov_is_pp_one_vf (adev)) -return 0 ; -if (!smu->pm_enabled)return 0 ;
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +5 -1
@@ -1817,7 +1817,8 @@ static int navi10_get_power_limit(struct smu_context *smu,int power_src;if (!smu->power_limit) { -if (smu_feature_is_enabled (smu,SMU_FEATURE_PPT_BIT )) { +if (smu_feature_is_enabled (smu,SMU_FEATURE_PPT_BIT ) && + !amdgpu_sriov_vf (smu->adev)) { power_src =smu_power_get_index (smu,SMU_POWER_SOURCE_AC );if (power_src <0 )return -EINVAL ;
@@ -1960,6 +1961,9 @@ static int navi10_set_default_od_settings(struct smu_context *smu, bool initialiOverDriveTable_t *od_table, *boot_od_table;int ret =0 ; +if (amdgpu_sriov_vf (smu->adev)) +return 0 ; + ret =smu_v11_0_set_default_od_settings (smu, initialize,sizeof (OverDriveTable_t));if (ret)return ret;
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +42 -7
141 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 6/8] drm/amdgpu: enable one vf mode for nv12
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Thursday, April 23, 2020 3:02 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH 6/8] drm/amdgpu: enable one vf mode for nv12
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 12 +++----- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 6 +++- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 49 +++++++++++++++++++++++++----- 3 files changed, 52 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +5 -7
@@ -347,13 +347,13 @@ int smu_get_dpm_freq_by_index(struct smu_context *smu, enum smu_clk_type clk_typ param = (uint32_t )(((clk_id &0xffff ) <<16 ) | (level &0xffff )); ret =smu_send_smc_msg_with_param (smu, SMU_MSG_GetDpmFreqByIndex, - param, ¶m); + param, value);if (ret)return ret;/* BIT31: 0 - Fine grained DPM, 1 - Dicrete DPM * now, we un-support it */ - *value = param &0x7fffffff ; + *value = *value &0x7fffffff ;return ret; }
@@ -535,7 +535,6 @@ int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, intint table_id =smu_table_get_index (smu, table_index);uint32_t table_size;int ret =0 ; -if (!table_data || table_id >=SMU_TABLE_COUNT || table_id <0 )return -EINVAL ;
@@ -691,7 +690,6 @@ int smu_feature_is_enabled(struct smu_context *smu, enum smu_feature_mask mask)if (smu->is_apu)return 1 ; - feature_id =smu_feature_get_index (smu, mask);if (feature_id <0 )return 0 ;
@@ -1339,6 +1337,9 @@ static int smu_hw_init(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle;struct smu_context *smu = &adev->smu; +if (amdgpu_sriov_vf (adev) && !amdgpu_sriov_is_pp_one_vf (adev)) +return 0 ; + ret =smu_start_smc_engine (smu);if (ret) {pr_err ("SMU is not ready yet!\n" );
@@ -1352,9 +1353,6 @@ static int smu_hw_init(void *handle)smu_set_gfx_cgpg (&adev->smu, true); } -if (amdgpu_sriov_vf (adev) && !amdgpu_sriov_is_pp_one_vf (adev)) -return 0 ; -if (!smu->pm_enabled)return 0 ;
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +5 -1
@@ -1817,7 +1817,8 @@ static int navi10_get_power_limit(struct smu_context *smu,int power_src;if (!smu->power_limit) { -if (smu_feature_is_enabled (smu,SMU_FEATURE_PPT_BIT )) { +if (smu_feature_is_enabled (smu,SMU_FEATURE_PPT_BIT ) && + !amdgpu_sriov_vf (smu->adev)) { power_src =smu_power_get_index (smu,SMU_POWER_SOURCE_AC );if (power_src <0 )return -EINVAL ;
@@ -1960,6 +1961,9 @@ static int navi10_set_default_od_settings(struct smu_context *smu, bool initialiOverDriveTable_t *od_table, *boot_od_table;int ret =0 ; +if (amdgpu_sriov_vf (smu->adev)) +return 0 ; + ret =smu_v11_0_set_default_od_settings (smu, initialize,sizeof (OverDriveTable_t));if (ret)return ret;
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +8 -4
@@ -57,7 +57,7 @@ static int smu_v11_0_send_msg_without_waiting(struct smu_context *smu, uint16_t msg) {struct amdgpu_device *adev = smu->adev; -WREG32_SOC15 (MP1 ,0 , mmMP1_SMN_C2PMSG_66, msg); +WREG32_SOC15_NO_KIQ (MP1 ,0 , mmMP1_SMN_C2PMSG_66, msg);return 0 ; }
@@ -65,7 +65,7 @@ static int smu_v11_0_read_arg(struct smu_context *smu, uint32_t *arg) {struct amdgpu_device *adev = smu->adev; - *arg =RREG32_SOC15 (MP1 ,0 , mmMP1_SMN_C2PMSG_82); + *arg =RREG32_SOC15_NO_KIQ (MP1 ,0 , mmMP1_SMN_C2PMSG_82);return 0 ; }
@@ -75,7 +75,7 @@ static int smu_v11_0_wait_for_response(struct smu_context *smu)uint32_t cur_value, i, timeout = adev->usec_timeout *10 ;for (i =0 ; i < timeout; i++) { - cur_value =RREG32_SOC15 (MP1 ,0 , mmMP1_SMN_C2PMSG_90); + cur_value =RREG32_SOC15_NO_KIQ (MP1 ,0 , mmMP1_SMN_C2PMSG_90);if ((cur_value &MP1_C2PMSG_90__CONTENT_MASK ) !=0 )return cur_value ==0x1 ?0 : -EIO ;
@@ -83,7 +83,10 @@ static int smu_v11_0_wait_for_response(struct smu_context *smu) }/* timeout means wrong logic */ -return -ETIME ; +if (i == timeout) +return -ETIME ; + +return RREG32_SOC15_NO_KIQ (MP1 ,0 , mmMP1_SMN_C2PMSG_90) ==0x1 ?0 : +-EIO ; }
[Evan] This is redundant. As original logics already cover this.
int
@@ -107,9 +110,9 @@ smu_v11_0_send_msg_with_param(struct smu_context *smu,
goto out;
}
- WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90, 0);
+ WREG32_SOC15_NO_KIQ(MP1, 0, mmMP1_SMN_C2PMSG_90, 0);
- WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82, param);
+ WREG32_SOC15_NO_KIQ(MP1, 0, mmMP1_SMN_C2PMSG_82, param);
smu_v11_0_send_msg_without_waiting(smu, (uint16_t)index);
@@ -119,6 +122,7 @@ smu_v11_0_send_msg_with_param(struct smu_context *smu,
smu_get_message_name(smu, msg), index, param, ret);
goto out;
}
+
if (read_arg) {
ret = smu_v11_0_read_arg(smu, read_arg);
if (ret) {
@@ -728,8 +732,9 @@ int smu_v11_0_parse_pptable(struct smu_context *smu)
struct smu_table_context *table_context = &smu->smu_table; struct smu_table *table = &table_context->tables[SMU_TABLE_PPTABLE];
+ /* during TDR we need to free and alloc the pptable */
if (table_context->driver_pptable)
- return -EINVAL;
+ kfree(table_context->driver_pptable);
table_context->driver_pptable = kzalloc(table->size, GFP_KERNEL);
@@ -769,6 +774,9 @@ int smu_v11_0_set_deep_sleep_dcefclk(struct smu_context *smu, uint32_t clk) {
int ret;
+ if (amdgpu_sriov_vf(smu->adev))
+ return 0;
+
ret = smu_send_smc_msg_with_param(smu,
SMU_MSG_SetMinDeepSleepDcefclk, clk, NULL);
if (ret)
@@ -812,6 +820,9 @@ int smu_v11_0_set_tool_table_location(struct smu_context *smu)
int ret = 0;
struct smu_table *tool_table = &smu->smu_table.tables[SMU_TABLE_PMSTATUSLOG];
+ if (amdgpu_sriov_vf(smu->adev))
+ return 0;
+
if (tool_table->mc_address) {
ret = smu_send_smc_msg_with_param(smu,
SMU_MSG_SetToolsDramAddrHigh,
@@ -831,6 +842,12 @@ int smu_v11_0_init_display_count(struct smu_context *smu, uint32_t count) {
int ret = 0;
+ if (amdgpu_sriov_vf(smu->adev))
+ return 0;
+
+ if (!smu->pm_enabled)
+ return ret;
[Evan] I think this will get display count setting skipped on baremetal since pm_enabled is always false before hw_init finished. Please double confirm and make sure this does not break baremetal.
+
ret = smu_send_smc_msg_with_param(smu, SMU_MSG_NumOfDisplays, count, NULL);
return ret;
}
@@ -842,6 +859,9 @@ int smu_v11_0_set_allowed_mask(struct smu_context *smu)
int ret = 0;
uint32_t feature_mask[2];
+ if (amdgpu_sriov_vf(smu->adev))
+ return 0;
+
mutex_lock(&feature->mutex);
if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || feature->feature_num < 64)
goto failed;
@@ -870,6 +890,9 @@ int smu_v11_0_get_enabled_mask(struct smu_context *smu,
struct smu_feature *feature = &smu->smu_feature;
int ret = 0;
+ if (amdgpu_sriov_vf(smu->adev) && !amdgpu_sriov_is_pp_one_vf(smu->adev))
+ return 0;
+
if (!feature_mask || num < 2)
return -EINVAL;
@@ -925,6 +948,12 @@ int smu_v11_0_notify_display_change(struct smu_context *smu) {
int ret = 0;
+ if (amdgpu_sriov_vf(smu->adev))
+ return 0;
+
+ if (!smu->pm_enabled)
+ return ret;
[Evan] Same as smu_v11_0_init_display_count.
+
if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UCLK_BIT) &&
smu->adev->gmc.vram_type == AMDGPU_VRAM_TYPE_HBM)
ret = smu_send_smc_msg_with_param(smu, SMU_MSG_SetUclkFastSwitch, 1, NULL); @@ -1084,6 +1113,9 @@ int smu_v11_0_set_power_limit(struct smu_context *smu, uint32_t n)
int ret = 0;
uint32_t max_power_limit;
+ if (amdgpu_sriov_vf(smu->adev))
+ return 0;
+
max_power_limit = smu_v11_0_get_max_power_limit(smu);
if (n > max_power_limit) {
@@ -1809,6 +1841,9 @@ int smu_v11_0_override_pcie_parameters(struct smu_context *smu)
uint32_t pcie_gen = 0, pcie_width = 0;
int ret;
+ if (amdgpu_sriov_vf(smu->adev))
+ return 0;
+
if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN4)
pcie_gen = 3;
else if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3)
--
2.7.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%7C3241a6478c6b451e12d408d7e7543931%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637232221317924807&sdata=ANSnKbPwZeAOYdEGdHOM8ZuWhXlilA9CXjnCjhmx6wU%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/8 drm/amdgpu: skip sysfs node not belong to one vf mode
In reply to Monk Liu--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 48 ++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +28 -20
@@ -3271,26 +3271,27 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)return ret; } - - ret =device_create_file (adev->dev, &dev_attr_pp_num_states); -if (ret) { -DRM_ERROR ("failed to create device file pp_num_states\n" ); -return ret; - } - ret =device_create_file (adev->dev, &dev_attr_pp_cur_state); -if (ret) { -DRM_ERROR ("failed to create device file pp_cur_state\n" ); -return ret; - } - ret =device_create_file (adev->dev, &dev_attr_pp_force_state); -if (ret) { -DRM_ERROR ("failed to create device file pp_force_state\n" ); -return ret; - } - ret =device_create_file (adev->dev, &dev_attr_pp_table); -if (ret) { -DRM_ERROR ("failed to create device file pp_table\n" ); -return ret; +if (!amdgpu_sriov_vf (adev)) { + ret =device_create_file (adev->dev, &dev_attr_pp_num_states); +if (ret) { +DRM_ERROR ("failed to create device file pp_num_states\n" ); +return ret; + } + ret =device_create_file (adev->dev, &dev_attr_pp_cur_state); +if (ret) { +DRM_ERROR ("failed to create device file pp_cur_state\n" ); +return ret; + } + ret =device_create_file (adev->dev, &dev_attr_pp_force_state); +if (ret) { +DRM_ERROR ("failed to create device file pp_force_state\n" ); +return ret; + } + ret =device_create_file (adev->dev, &dev_attr_pp_table); +if (ret) { +DRM_ERROR ("failed to create device file pp_table\n" ); +return ret; + } } ret =device_create_file (adev->dev, &dev_attr_pp_dpm_sclk);
@@ -3337,6 +3338,13 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)return ret; } } + +/* the reset are not needed for SRIOV one vf mode */ +if (amdgpu_sriov_vf (adev)) { + adev->pm.sysfs_initialized = true; +return ret; + } +if (adev->asic_type !=CHIP_ARCTURUS ) { ret =device_create_file (adev->dev, &dev_attr_pp_dpm_pcie);if (ret) {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 7/8] drm/amdgpu: skip sysfs node not belong to one vf mode
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Thursday, April 23, 2020 3:02 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH 7/8] drm/amdgpu: skip sysfs node not belong to one vf mode
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 48 ++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +21 -20
@@ -3271,26 +3271,27 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)return ret; } - - ret =device_create_file (adev->dev, &dev_attr_pp_num_states); -if (ret) { -DRM_ERROR ("failed to create device file pp_num_states\n" ); -return ret; - } - ret =device_create_file (adev->dev, &dev_attr_pp_cur_state); -if (ret) { -DRM_ERROR ("failed to create device file pp_cur_state\n" ); -return ret; - } - ret =device_create_file (adev->dev, &dev_attr_pp_force_state); -if (ret) { -DRM_ERROR ("failed to create device file pp_force_state\n" ); -return ret; - } - ret =device_create_file (adev->dev, &dev_attr_pp_table); -if (ret) { -DRM_ERROR ("failed to create device file pp_table\n" ); -return ret; +if (!amdgpu_sriov_vf (adev)) { + ret =device_create_file (adev->dev, &dev_attr_pp_num_states); +if (ret) { +DRM_ERROR ("failed to create device file pp_num_states\n" ); +return ret; + } + ret =device_create_file (adev->dev, &dev_attr_pp_cur_state); +if (ret) { +DRM_ERROR ("failed to create device file pp_cur_state\n" ); +return ret; + } + ret =device_create_file (adev->dev, &dev_attr_pp_force_state); +if (ret) { +DRM_ERROR ("failed to create device file pp_force_state\n" ); +return ret; + } + ret =device_create_file (adev->dev, &dev_attr_pp_table); +if (ret) { +DRM_ERROR ("failed to create device file pp_table\n" ); +return ret; + } } [Evan] Please add this for amdgpu_pm_sysfs_init also. ret = device_create_file(adev->dev, &dev_attr_pp_dpm_sclk); @@ -3337,6 +3338,13 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
return ret;
}
}
+
+ /* the reset are not needed for SRIOV one vf mode */
[Evan] Typo: 'reset' should be 'rest'.
+ if (amdgpu_sriov_vf(adev)) {
+ adev->pm.sysfs_initialized = true;
+ return ret;
+ }
+
if (adev->asic_type != CHIP_ARCTURUS) {
ret = device_create_file(adev->dev, &dev_attr_pp_dpm_pcie); if (ret) {
--
2.7.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%7C2fcb995e57fb4ceeb23608d7e7543adc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637232221351766801&sdata=waHsAN5irYjlYb%2FrY8UT5h2eLu2wjaEw67DcaWJaUDs%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/8 drm/amdgpu: for nv12 always need smu ip
In reply to Monk Liubecause nv12 SRIOV support one vf mode
--- drivers/gpu/drm/amd/amdgpu/nv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +1 -2
@@ -498,8 +498,7 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)amdgpu_device_ip_block_add (adev, &gmc_v10_0_ip_block);amdgpu_device_ip_block_add (adev, &navi10_ih_ip_block);amdgpu_device_ip_block_add (adev, &psp_v11_0_ip_block); -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP && - !amdgpu_sriov_vf (adev)) +if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP )amdgpu_device_ip_block_add (adev, &smu_v11_0_ip_block);if (adev->enable_virtual_display ||amdgpu_sriov_vf (adev))amdgpu_device_ip_block_add (adev, &dce_virtual_ip_block);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 8/8] drm/amdgpu: for nv12 always need smu ip
Please check whether this is needed also for the following code:
if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
!amdgpu_sriov_vf(adev))
amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);Other than that, this one and patch1-4 are acked-by: Evan Quan <[email protected]>
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Thursday, April 23, 2020 3:02 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH 8/8] drm/amdgpu: for nv12 always need smu ip
because nv12 SRIOV support one vf mode
--- drivers/gpu/drm/amd/amdgpu/nv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +1 -2
@@ -498,8 +498,7 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)amdgpu_device_ip_block_add (adev, &gmc_v10_0_ip_block);amdgpu_device_ip_block_add (adev, &navi10_ih_ip_block);amdgpu_device_ip_block_add (adev, &psp_v11_0_ip_block); -if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP && - !amdgpu_sriov_vf (adev)) +if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP )amdgpu_device_ip_block_add (adev, &smu_v11_0_ip_block);if (adev->enable_virtual_display ||amdgpu_sriov_vf (adev))amdgpu_device_ip_block_add (adev, &dce_virtual_ip_block);
--
2.7.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%7C0776cfa8343f4992679608d7e7543a7e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637232221889995485&sdata=L4BeRmyYxVu4to1tk%2BtQANvWg3fxTtjyv0zroWUJ3jA%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Series is Acked-by: Yintian Tao <[email protected]>
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: 2020年4月23日 15:02
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH 1/8] drm/amdgpu: ignore TA ucode for SRIOV
--- drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +2 -0
@@ -194,6 +194,8 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)case CHIP_NAVI10 :case CHIP_NAVI14 :case CHIP_NAVI12 : +if (amdgpu_sriov_vf (adev)) +break ;snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_ta.bin" , chip_name); err =request_firmware (&adev->psp.ta_fw, fw_name, adev->dev);if (err) {
Signature · 10 lines
2.7.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%7Cyintian.tao%40amd.com%7C591f6154216d45f81a0c08d7e7543671%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637232221913347447&sdata=jFv%2FMqS%2B0lHnuaN0%2B1GG6iSfyyAFPZbFBxa%2BiEL2tsg%3D&reserved=0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx