drm/amdgpu: fix one vf mode
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix one vf mode
still need to call system_enable_features for one vf mode but need to block the SMU request from SRIOV case and allows the software side change pass in "smu_v11_0_system_features_control"
by this patlch the pp_dpm_mclk/sclk now shows correct output
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 8 ++++++++ drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 13 +++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +8 -0
@@ -1183,7 +1183,15 @@ static int smu_smc_table_hw_init(struct smu_context *smu,return ret; } } + }else { +/* we need to enable some SMU features for one vf mode */ +if (amdgpu_sriov_is_pp_one_vf (adev)) { + ret =smu_system_features_control (smu, true); +if (ret) +return ret; + } } +if (adev->asic_type !=CHIP_ARCTURUS ) { ret =smu_notify_display_change (smu);if (ret)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +9 -4
@@ -764,6 +764,9 @@ int smu_v11_0_write_pptable(struct smu_context *smu)struct smu_table_context *table_context = &smu->smu_table;int ret =0 ; +if (amdgpu_sriov_vf (smu->adev)) +return 0 ; + ret =smu_update_table (smu,SMU_TABLE_PPTABLE ,0 , table_context->driver_pptable, true);
@@ -922,10 +925,12 @@ int smu_v11_0_system_features_control(struct smu_context *smu,uint32_t feature_mask[2 ];int ret =0 ; - ret =smu_send_smc_msg (smu, (en ? SMU_MSG_EnableAllSmuFeatures : - SMU_MSG_DisableAllSmuFeatures),NULL ); -if (ret) -return ret; +if (!amdgpu_sriov_vf (smu->adev)) { + ret =smu_send_smc_msg (smu, (en ? SMU_MSG_EnableAllSmuFeatures : + SMU_MSG_DisableAllSmuFeatures),NULL ); +if (ret) +return ret; + }bitmap_zero (feature->enabled, feature->feature_num);bitmap_zero (feature->supported, feature->feature_num);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
As discussed, we want to keep this patch until we finalized onevf mode support design in guest driver.
Current approach to add one_vf mode check for every smu function is not sustatinable and error prone when new asic support added in software smu
Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Monday, April 27, 2020 11:35
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu: fix one vf mode
still need to call system_enable_features for one vf mode but need to block the SMU request from SRIOV case and allows the software side change pass in "smu_v11_0_system_features_control"
by this patlch the pp_dpm_mclk/sclk now shows correct output
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 8 ++++++++ drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 13 +++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +8 -0
@@ -1183,7 +1183,15 @@ static int smu_smc_table_hw_init(struct smu_context *smu,return ret; } } + }else { +/* we need to enable some SMU features for one vf mode */ +if (amdgpu_sriov_is_pp_one_vf (adev)) { + ret =smu_system_features_control (smu, true); +if (ret) +return ret; + } } +if (adev->asic_type !=CHIP_ARCTURUS ) { ret =smu_notify_display_change (smu);if (ret)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +9 -4
@@ -764,6 +764,9 @@ int smu_v11_0_write_pptable(struct smu_context *smu)struct smu_table_context *table_context = &smu->smu_table;int ret =0 ; +if (amdgpu_sriov_vf (smu->adev)) +return 0 ; + ret =smu_update_table (smu,SMU_TABLE_PPTABLE ,0 , table_context->driver_pptable, true);
@@ -922,10 +925,12 @@ int smu_v11_0_system_features_control(struct smu_context *smu,uint32_t feature_mask[2 ];int ret =0 ; - ret =smu_send_smc_msg (smu, (en ? SMU_MSG_EnableAllSmuFeatures : - SMU_MSG_DisableAllSmuFeatures),NULL ); -if (ret) -return ret; +if (!amdgpu_sriov_vf (smu->adev)) { + ret =smu_send_smc_msg (smu, (en ? SMU_MSG_EnableAllSmuFeatures : + SMU_MSG_DisableAllSmuFeatures),NULL ); +if (ret) +return ret; + }bitmap_zero (feature->enabled, feature->feature_num);bitmap_zero (feature->supported, feature->feature_num);
--
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%7Chawking.zhang%40amd.com%7Cadd54868b3d8404af9a508d7ea5c0535%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637235553277191960&sdata=bdieikeeCvuUqIBD7LHUpoZzFxIdRxMsXmQdqZ12AD0%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
Sorry I shall say hold on this patch until we reach agreement on how to support onevf mode in current software smu design.
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, Hawking
Sent: Monday, April 27, 2020 12:25
To: Liu, Monk <[email protected]>; [email protected]
Cc: Liu, Monk <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: fix one vf mode
[AMD Official Use Only - Internal Distribution Only]
As discussed, we want to keep this patch until we finalized onevf mode support design in guest driver.
Current approach to add one_vf mode check for every smu function is not sustatinable and error prone when new asic support added in software smu
Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Monday, April 27, 2020 11:35
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu: fix one vf mode
still need to call system_enable_features for one vf mode but need to block the SMU request from SRIOV case and allows the software side change pass in "smu_v11_0_system_features_control"
by this patlch the pp_dpm_mclk/sclk now shows correct output
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 8 ++++++++ drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 13 +++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +8 -0
@@ -1183,7 +1183,15 @@ static int smu_smc_table_hw_init(struct smu_context *smu,return ret; } } + }else { +/* we need to enable some SMU features for one vf mode */ +if (amdgpu_sriov_is_pp_one_vf (adev)) { + ret =smu_system_features_control (smu, true); +if (ret) +return ret; + } } +if (adev->asic_type !=CHIP_ARCTURUS ) { ret =smu_notify_display_change (smu);if (ret)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +9 -4
@@ -764,6 +764,9 @@ int smu_v11_0_write_pptable(struct smu_context *smu)struct smu_table_context *table_context = &smu->smu_table;int ret =0 ; +if (amdgpu_sriov_vf (smu->adev)) +return 0 ; + ret =smu_update_table (smu,SMU_TABLE_PPTABLE ,0 , table_context->driver_pptable, true);
@@ -922,10 +925,12 @@ int smu_v11_0_system_features_control(struct smu_context *smu,uint32_t feature_mask[2 ];int ret =0 ; - ret =smu_send_smc_msg (smu, (en ? SMU_MSG_EnableAllSmuFeatures : - SMU_MSG_DisableAllSmuFeatures),NULL ); -if (ret) -return ret; +if (!amdgpu_sriov_vf (smu->adev)) { + ret =smu_send_smc_msg (smu, (en ? SMU_MSG_EnableAllSmuFeatures : + SMU_MSG_DisableAllSmuFeatures),NULL ); +if (ret) +return ret; + }bitmap_zero (feature->enabled, feature->feature_num);bitmap_zero (feature->supported, feature->feature_num);
--
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%7Chawking.zhang%40amd.com%7Cbdd39fed708f40f172e208d7ea62ea73%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637235582882901954&sdata=FN9JLQo8MeWUXHpRxrKRanwd7B03LjCrXMuD%2BjjjZRU%3D&reserved=0
_______________________________________________
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%7Cbdd39fed708f40f172e208d7ea62ea73%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637235582882901954&sdata=FN9JLQo8MeWUXHpRxrKRanwd7B03LjCrXMuD%2BjjjZRU%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx