drm/amd/pm: drop redundant and unneeded BACO APIs
Subsystems (3)
PATCH 1/2 drm/amd/pm: drop redundant and unneeded BACO APIs
Use other APIs which are with the same functionality but much more clean.
--- drivers/gpu/drm/amd/amdgpu/nv.c | 20 +---- drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 9 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 95 ----------------------- 3 files changed, 3 insertions(+), 121 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +3 -17
@@ -517,19 +517,12 @@ static int nv_asic_mode2_reset(struct amdgpu_device *adev)static bool nv_asic_supports_baco (struct amdgpu_device *adev) { -struct smu_context *smu = &adev->smu; - -if (smu_baco_is_support (smu)) -return true; -else -return false; +return amdgpu_dpm_is_baco_supported (adev); }static enum amd_reset_method nv_asic_reset_method (struct amdgpu_device *adev) { -struct smu_context *smu = &adev->smu; - if (amdgpu_reset_method == AMD_RESET_METHOD_MODE1 || amdgpu_reset_method == AMD_RESET_METHOD_MODE2 || amdgpu_reset_method == AMD_RESET_METHOD_BACO ||
@@ -548,7 +541,7 @@ nv_asic_reset_method(struct amdgpu_device *adev)case CHIP_DIMGREY_CAVEFISH :return AMD_RESET_METHOD_MODE1 ;default : -if (smu_baco_is_support (smu)) +if (amdgpu_dpm_is_baco_supported (adev))return AMD_RESET_METHOD_BACO ;else return AMD_RESET_METHOD_MODE1 ;
@@ -558,7 +551,6 @@ nv_asic_reset_method(struct amdgpu_device *adev)static int nv_asic_reset (struct amdgpu_device *adev) {int ret =0 ; -struct smu_context *smu = &adev->smu;switch (nv_asic_reset_method (adev)) {case AMD_RESET_METHOD_PCI :
@@ -567,13 +559,7 @@ static int nv_asic_reset(struct amdgpu_device *adev)break ;case AMD_RESET_METHOD_BACO :dev_info (adev->dev,"BACO reset\n" ); - - ret =smu_baco_enter (smu); -if (ret) -return ret; - ret =smu_baco_exit (smu); -if (ret) -return ret; + ret =amdgpu_dpm_baco_reset (adev);break ;case AMD_RESET_METHOD_MODE2 :dev_info (adev->dev,"MODE2 reset\n" );
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +0 -9
@@ -1285,15 +1285,6 @@ int smu_get_power_limit(struct smu_context *smu,uint32_t *limit, enum smu_ppt_limit_level limit_level); -int smu_set_azalia_d3_pme (struct smu_context *smu); - -bool smu_baco_is_support (struct smu_context *smu); - -int smu_baco_get_state (struct smu_context *smu,enum smu_baco_state *state); - -int smu_baco_enter (struct smu_context *smu); -int smu_baco_exit (struct smu_context *smu); -bool smu_mode1_reset_is_support (struct smu_context *smu);bool smu_mode2_reset_is_support (struct smu_context *smu);int smu_mode1_reset (struct smu_context *smu);
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -95
107 lines not on this page · raw message
Signature · 6 lines
2.29.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/2 drm/amdgpu: disable runpm if other reset method not runpm capable is chosen
Otherwise, the runpm will be always enabled on a BACO capable target even the reset method was forced as like mode1.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 ++ drivers/gpu/drm/amd/amdgpu/cik.c | 2 +- drivers/gpu/drm/amd/amdgpu/nv.c | 2 +- drivers/gpu/drm/amd/amdgpu/si.c | 2 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +- drivers/gpu/drm/amd/amdgpu/vi.c | 2 +- 8 files changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
@@ -589,6 +589,7 @@ struct amdgpu_allowed_register_entry { };enum amd_reset_method { +AMD_RESET_METHOD_AUTO =-1 ,AMD_RESET_METHOD_LEGACY =0 ,AMD_RESET_METHOD_MODE0 ,AMD_RESET_METHOD_MODE1 ,
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -1
@@ -168,7 +168,7 @@ int amdgpu_noretry = -1;int amdgpu_force_asic_type =-1 ;int amdgpu_tmz =-1 ;/* auto */ uint amdgpu_freesync_vid_mode; -int amdgpu_reset_method =-1 ;/* auto */ +int amdgpu_reset_method =AMD_RESET_METHOD_AUTO ;/* auto */ int amdgpu_num_kcq =-1 ;static void amdgpu_drv_delayed_reset_work_handler (struct work_struct *work);
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2 -0
@@ -168,6 +168,8 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags) adev->runpm = true;dev_info (adev->dev,"Using BOCO for runtime pm\n" ); }else if (amdgpu_device_supports_baco (dev) && + (amdgpu_reset_method ==AMD_RESET_METHOD_AUTO || + amdgpu_reset_method ==AMD_RESET_METHOD_BACO ) && (amdgpu_runtime_pm !=0 )) {switch (adev->asic_type) {case CHIP_VEGA20 :
drivers/gpu/drm/amd/amdgpu/cik.c +1 -1
@@ -1395,7 +1395,7 @@ cik_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_BACO)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/nv.c +1 -1
@@ -529,7 +529,7 @@ nv_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_PCI)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/si.c +1 -1
@@ -1420,7 +1420,7 @@ si_asic_reset_method(struct amdgpu_device *adev)if (amdgpu_reset_method ==AMD_RESET_METHOD_PCI )return amdgpu_reset_method;else if (amdgpu_reset_method !=AMD_RESET_METHOD_LEGACY && - amdgpu_reset_method !=-1 ) + amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -1
@@ -689,7 +689,7 @@ soc15_asic_reset_method(struct amdgpu_device *adev)return amdgpu_reset_method; } -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/vi.c +1 -1
@@ -895,7 +895,7 @@ vi_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_BACO)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
Signature · 6 lines
2.29.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen
[AMD Public Use]
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Friday, March 19, 2021 2:42 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen
Otherwise, the runpm will be always enabled on a BACO capable target even the reset method was forced as like mode1.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 ++ drivers/gpu/drm/amd/amdgpu/cik.c | 2 +- drivers/gpu/drm/amd/amdgpu/nv.c | 2 +- drivers/gpu/drm/amd/amdgpu/si.c | 2 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +- drivers/gpu/drm/amd/amdgpu/vi.c | 2 +- 8 files changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
@@ -589,6 +589,7 @@ struct amdgpu_allowed_register_entry { };enum amd_reset_method { +AMD_RESET_METHOD_AUTO =-1 ,AMD_RESET_METHOD_LEGACY =0 ,AMD_RESET_METHOD_MODE0 ,AMD_RESET_METHOD_MODE1 ,
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
@@ -168,7 +168,7 @@ int amdgpu_noretry = -1; int amdgpu_force_asic_type = -1; int amdgpu_tmz = -1; /* auto */ uint amdgpu_freesync_vid_mode; -int amdgpu_reset_method = -1; /* auto */ +int amdgpu_reset_method =AMD_RESET_METHOD_AUTO ;/* auto */ int amdgpu_num_kcq =-1 ; static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 8844f650b17f..49068ad698a6 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2 -0
@@ -168,6 +168,8 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags) adev->runpm = true;dev_info (adev->dev,"Using BOCO for runtime pm\n" ); } else if (amdgpu_device_supports_baco(dev) && + (amdgpu_reset_method == AMD_RESET_METHOD_AUTO || + amdgpu_reset_method == AMD_RESET_METHOD_BACO) &&
< > Why to link runpm suspend method with reset method?
Thanks,
Lijo
(amdgpu_runtime_pm != 0)) {
switch (adev->asic_type) {
case CHIP_VEGA20:
drivers/gpu/drm/amd/amdgpu/cik.c +1 -1
@@ -1395,7 +1395,7 @@ cik_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_BACO)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/nv.c +1 -1
@@ -529,7 +529,7 @@ nv_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_PCI)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/si.c +1 -1
@@ -1420,7 +1420,7 @@ si_asic_reset_method(struct amdgpu_device *adev)if (amdgpu_reset_method ==AMD_RESET_METHOD_PCI )return amdgpu_reset_method;else if (amdgpu_reset_method !=AMD_RESET_METHOD_LEGACY && - amdgpu_reset_method !=-1 ) + amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -1
@@ -689,7 +689,7 @@ soc15_asic_reset_method(struct amdgpu_device *adev)return amdgpu_reset_method; } -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/vi.c +1 -1
@@ -895,7 +895,7 @@ vi_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_BACO)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
--
2.29.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=04%7C01%7Clijo.lazar%40amd.com%7Ce8308bfec7e047a7552b08d8eab7231c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517419584010454%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=OuWg%2B92YCNnINVD%2BEtasOsEbOutT1XMFMZYsmRkh1Os%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
maintainerRe: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen
[AMD Public Use]
Yeah, the reset method is independent of whether we can use BACO for runtime PM. We can use BACO for power saving and use mode1 for reset. Is there some issue I'm missing?
Alex
________________________________
From: amd-gfx <[email protected]> on behalf of Lazar, Lijo <[email protected]>
Sent: Friday, March 19, 2021 7:27 AM
To: Quan, Evan <[email protected]>; [email protected] <[email protected]>
Cc: Quan, Evan <[email protected]>
Subject: RE: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen
[AMD Public Use]
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Friday, March 19, 2021 2:42 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen
Otherwise, the runpm will be always enabled on a BACO capable target even the reset method was forced as like mode1.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 ++ drivers/gpu/drm/amd/amdgpu/cik.c | 2 +- drivers/gpu/drm/amd/amdgpu/nv.c | 2 +- drivers/gpu/drm/amd/amdgpu/si.c | 2 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +- drivers/gpu/drm/amd/amdgpu/vi.c | 2 +- 8 files changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
@@ -589,6 +589,7 @@ struct amdgpu_allowed_register_entry { };enum amd_reset_method { +AMD_RESET_METHOD_AUTO =-1 ,AMD_RESET_METHOD_LEGACY =0 ,AMD_RESET_METHOD_MODE0 ,AMD_RESET_METHOD_MODE1 ,
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
@@ -168,7 +168,7 @@ int amdgpu_noretry = -1; int amdgpu_force_asic_type = -1; int amdgpu_tmz = -1; /* auto */ uint amdgpu_freesync_vid_mode; -int amdgpu_reset_method = -1; /* auto */ +int amdgpu_reset_method =AMD_RESET_METHOD_AUTO ;/* auto */ int amdgpu_num_kcq =-1 ; static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 8844f650b17f..49068ad698a6 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2 -0
@@ -168,6 +168,8 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags) adev->runpm = true;dev_info (adev->dev,"Using BOCO for runtime pm\n" ); } else if (amdgpu_device_supports_baco(dev) && + (amdgpu_reset_method == AMD_RESET_METHOD_AUTO || + amdgpu_reset_method == AMD_RESET_METHOD_BACO) &&
< > Why to link runpm suspend method with reset method?
Thanks,
Lijo
(amdgpu_runtime_pm != 0)) {
switch (adev->asic_type) {
case CHIP_VEGA20:drivers/gpu/drm/amd/amdgpu/cik.c +1 -1
@@ -1395,7 +1395,7 @@ cik_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_BACO)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/nv.c +1 -1
@@ -529,7 +529,7 @@ nv_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_PCI)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/si.c +1 -1
@@ -1420,7 +1420,7 @@ si_asic_reset_method(struct amdgpu_device *adev)if (amdgpu_reset_method ==AMD_RESET_METHOD_PCI )return amdgpu_reset_method;else if (amdgpu_reset_method !=AMD_RESET_METHOD_LEGACY && - amdgpu_reset_method !=-1 ) + amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -1
@@ -689,7 +689,7 @@ soc15_asic_reset_method(struct amdgpu_device *adev)return amdgpu_reset_method; } -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/vi.c +1 -1
@@ -895,7 +895,7 @@ vi_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_BACO)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
--
2.29.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=04%7C01%7Calexander.deucher%40amd.com%7C5cacb7cb280c4055647a08d8eac9edbc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517500293380275%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=93jzFipkAGazXCqwfxbKUkvTDUHmuSZT6cNAcymg%2BRQ%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=04%7C01%7Calexander.deucher%40amd.com%7C5cacb7cb280c4055647a08d8eac9edbc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517500293380275%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=93jzFipkAGazXCqwfxbKUkvTDUHmuSZT6cNAcymg%2BRQ%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen
[AMD Public Use]
Thanks Alex. Yes, you are right. BACO is used as a power saving feature for runpm. I missed that. I wrongly treated BACO as a reset method only which cannot be used with mode1 reset at the same time. Please ignore this patch.
BR
Evan
From: Deucher, Alexander <[email protected]>
Sent: Saturday, March 20, 2021 12:46 AM
To: Lazar, Lijo <[email protected]>; Quan, Evan <[email protected]>; [email protected]
Subject: Re: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen
[AMD Public Use]
Yeah, the reset method is independent of whether we can use BACO for runtime PM. We can use BACO for power saving and use mode1 for reset. Is there some issue I'm missing?
Alex
________________________________
From: amd-gfx <[email protected]<mailto:[email protected]>> on behalf of Lazar, Lijo <[email protected]<mailto:[email protected]>>
Sent: Friday, March 19, 2021 7:27 AM
To: Quan, Evan <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Cc: Quan, Evan <[email protected]<mailto:[email protected]>>
Subject: RE: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen
[AMD Public Use]
-----Original Message-----
From: amd-gfx <[email protected]<mailto:[email protected]>> On Behalf Of Evan Quan
Sent: Friday, March 19, 2021 2:42 PM
To: [email protected]<mailto:[email protected]>
Cc: Quan, Evan <[email protected]<mailto:[email protected]>>
Subject: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen
Otherwise, the runpm will be always enabled on a BACO capable target even the reset method was forced as like mode1.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 ++ drivers/gpu/drm/amd/amdgpu/cik.c | 2 +- drivers/gpu/drm/amd/amdgpu/nv.c | 2 +- drivers/gpu/drm/amd/amdgpu/si.c | 2 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +- drivers/gpu/drm/amd/amdgpu/vi.c | 2 +- 8 files changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
@@ -589,6 +589,7 @@ struct amdgpu_allowed_register_entry { };enum amd_reset_method { +AMD_RESET_METHOD_AUTO =-1 ,AMD_RESET_METHOD_LEGACY =0 ,AMD_RESET_METHOD_MODE0 ,AMD_RESET_METHOD_MODE1 ,
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
@@ -168,7 +168,7 @@ int amdgpu_noretry = -1; int amdgpu_force_asic_type = -1; int amdgpu_tmz = -1; /* auto */ uint amdgpu_freesync_vid_mode; -int amdgpu_reset_method = -1; /* auto */ +int amdgpu_reset_method =AMD_RESET_METHOD_AUTO ;/* auto */ int amdgpu_num_kcq =-1 ; static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 8844f650b17f..49068ad698a6 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2 -0
@@ -168,6 +168,8 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags) adev->runpm = true;dev_info (adev->dev,"Using BOCO for runtime pm\n" ); } else if (amdgpu_device_supports_baco(dev) && + (amdgpu_reset_method == AMD_RESET_METHOD_AUTO || + amdgpu_reset_method == AMD_RESET_METHOD_BACO) &&
< > Why to link runpm suspend method with reset method?
Thanks,
Lijo
(amdgpu_runtime_pm != 0)) {
switch (adev->asic_type) {
case CHIP_VEGA20:drivers/gpu/drm/amd/amdgpu/cik.c +1 -1
@@ -1395,7 +1395,7 @@ cik_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_BACO)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/nv.c +1 -1
@@ -529,7 +529,7 @@ nv_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_PCI)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/si.c +1 -1
@@ -1420,7 +1420,7 @@ si_asic_reset_method(struct amdgpu_device *adev)if (amdgpu_reset_method ==AMD_RESET_METHOD_PCI )return amdgpu_reset_method;else if (amdgpu_reset_method !=AMD_RESET_METHOD_LEGACY && - amdgpu_reset_method !=-1 ) + amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -1
@@ -689,7 +689,7 @@ soc15_asic_reset_method(struct amdgpu_device *adev)return amdgpu_reset_method; } -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
drivers/gpu/drm/amd/amdgpu/vi.c +1 -1
@@ -895,7 +895,7 @@ vi_asic_reset_method(struct amdgpu_device *adev) amdgpu_reset_method == AMD_RESET_METHOD_BACO)return amdgpu_reset_method; -if (amdgpu_reset_method !=-1 ) +if (amdgpu_reset_method !=AMD_RESET_METHOD_AUTO )dev_warn (adev->dev,"Specified reset method:%d isn't supported, using AUTO instead.\n" , amdgpu_reset_method);
--
2.29.0
_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C5cacb7cb280c4055647a08d8eac9edbc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517500293380275%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=93jzFipkAGazXCqwfxbKUkvTDUHmuSZT6cNAcymg%2BRQ%3D&reserved=0
_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C5cacb7cb280c4055647a08d8eac9edbc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517500293380275%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=93jzFipkAGazXCqwfxbKUkvTDUHmuSZT6cNAcymg%2BRQ%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
Hi, Evan,
It is better to replace all nv_asic_supports_baco callings with amdgpu_dpm_is_baco_supported, and remove nv_asic_supports_baco function.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
static bool
nv_asic_supports_baco(struct amdgpu_device *adev){(quoted diff) +1
-6- struct smu_context *smu = &adev->smu; - - if (smu_baco_is_support(smu)) - return true; - else - return false; + return amdgpu_dpm_is_baco_supported(adev);}
Best Regards
Dennis Li
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Friday, March 19, 2021 5:12 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 1/2] drm/amd/pm: drop redundant and unneeded BACO APIs
Use other APIs which are with the same functionality but much more clean.
--- drivers/gpu/drm/amd/amdgpu/nv.c | 20 +---- drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 9 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 95 ----------------------- 3 files changed, 3 insertions(+), 121 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +1 -8
@@ -517,19 +517,12 @@ static int nv_asic_mode2_reset(struct amdgpu_device *adev)static bool nv_asic_supports_baco (struct amdgpu_device *adev) { -struct smu_context *smu = &adev->smu; - -if (smu_baco_is_support (smu)) -return true; -else -return false; +return amdgpu_dpm_is_baco_supported (adev); }static enum amd_reset_method nv_asic_reset_method (struct amdgpu_device *adev) { -struct smu_context *smu = &adev->smu; -if (amdgpu_reset_method ==AMD_RESET_METHOD_MODE1 || amdgpu_reset_method ==AMD_RESET_METHOD_MODE2 || amdgpu_reset_method == AMD_RESET_METHOD_BACO || @@ -548,7 +541,7 @@ nv_asic_reset_method(struct amdgpu_device *adev)case CHIP_DIMGREY_CAVEFISH :return AMD_RESET_METHOD_MODE1 ;
default:
- if (smu_baco_is_support(smu))
+ if (amdgpu_dpm_is_baco_supported(adev))
return AMD_RESET_METHOD_BACO;
else
return AMD_RESET_METHOD_MODE1;
@@ -558,7 +551,6 @@ nv_asic_reset_method(struct amdgpu_device *adev) static int nv_asic_reset(struct amdgpu_device *adev) {
int ret = 0;
- struct smu_context *smu = &adev->smu;
switch (nv_asic_reset_method(adev)) {
case AMD_RESET_METHOD_PCI:
@@ -567,13 +559,7 @@ static int nv_asic_reset(struct amdgpu_device *adev)
break;
case AMD_RESET_METHOD_BACO:
dev_info(adev->dev, "BACO reset\n");
-
- ret = smu_baco_enter(smu);
- if (ret)
- return ret;
- ret = smu_baco_exit(smu);
- if (ret)
- return ret;
+ ret = amdgpu_dpm_baco_reset(adev);
break;
case AMD_RESET_METHOD_MODE2:
dev_info(adev->dev, "MODE2 reset\n"); diff --git a/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h
index 517f333fbc4b..02675155028d 100644
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +0 -8
@@ -1285,15 +1285,6 @@ int smu_get_power_limit(struct smu_context *smu,uint32_t *limit, enum smu_ppt_limit_level limit_level); -int smu_set_azalia_d3_pme (struct smu_context *smu); - -bool smu_baco_is_support (struct smu_context *smu); - -int smu_baco_get_state (struct smu_context *smu,enum smu_baco_state *state); - -int smu_baco_enter(struct smu_context *smu); -int smu_baco_exit(struct smu_context *smu); - bool smu_mode1_reset_is_support(struct smu_context *smu); bool smu_mode2_reset_is_support(struct smu_context *smu); int smu_mode1_reset(struct smu_context *smu); diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 4120d28f782b..1bb0c0966e3d 100644
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -91
101 lines not on this page · raw message
2.29.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=04%7C01%7CDennis.Li%40amd.com%7Cb00f935cbf75466856f508d8eab71ff8%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517419531562871%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=J%2FeyHZ%2FPq2ASS5faBddw7PhJh%2FA2Jep4gKnbZ1J122I%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Public Use]
Thanks Dennis. Please check V2 with that updated.
BR
Evan
-----Original Message-----
From: Li, Dennis <[email protected]>
Sent: Friday, March 19, 2021 7:24 PM
To: Quan, Evan <[email protected]>; [email protected]
Cc: Quan, Evan <[email protected]>
Subject: RE: [PATCH 1/2] drm/amd/pm: drop redundant and unneeded BACO APIs
[AMD Official Use Only - Internal Distribution Only]
Hi, Evan,
It is better to replace all nv_asic_supports_baco callings with amdgpu_dpm_is_baco_supported, and remove nv_asic_supports_baco function.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
static bool
nv_asic_supports_baco(struct amdgpu_device *adev){(quoted diff) +1
-6- struct smu_context *smu = &adev->smu; - - if (smu_baco_is_support(smu)) - return true; - else - return false; + return amdgpu_dpm_is_baco_supported(adev);}
Best Regards
Dennis Li
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Friday, March 19, 2021 5:12 PM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 1/2] drm/amd/pm: drop redundant and unneeded BACO APIs
Use other APIs which are with the same functionality but much more clean.
--- drivers/gpu/drm/amd/amdgpu/nv.c | 20 +---- drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 9 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 95 ----------------------- 3 files changed, 3 insertions(+), 121 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +1 -8
@@ -517,19 +517,12 @@ static int nv_asic_mode2_reset(struct amdgpu_device *adev)static bool nv_asic_supports_baco (struct amdgpu_device *adev) { -struct smu_context *smu = &adev->smu; - -if (smu_baco_is_support (smu)) -return true; -else -return false; +return amdgpu_dpm_is_baco_supported (adev); }static enum amd_reset_method nv_asic_reset_method (struct amdgpu_device *adev) { -struct smu_context *smu = &adev->smu; -if (amdgpu_reset_method ==AMD_RESET_METHOD_MODE1 || amdgpu_reset_method ==AMD_RESET_METHOD_MODE2 || amdgpu_reset_method == AMD_RESET_METHOD_BACO || @@ -548,7 +541,7 @@ nv_asic_reset_method(struct amdgpu_device *adev)case CHIP_DIMGREY_CAVEFISH :return AMD_RESET_METHOD_MODE1 ;
default:
- if (smu_baco_is_support(smu))
+ if (amdgpu_dpm_is_baco_supported(adev))
return AMD_RESET_METHOD_BACO;
else
return AMD_RESET_METHOD_MODE1;
@@ -558,7 +551,6 @@ nv_asic_reset_method(struct amdgpu_device *adev) static int nv_asic_reset(struct amdgpu_device *adev) {
int ret = 0;
- struct smu_context *smu = &adev->smu;
switch (nv_asic_reset_method(adev)) {
case AMD_RESET_METHOD_PCI:
@@ -567,13 +559,7 @@ static int nv_asic_reset(struct amdgpu_device *adev)
break;
case AMD_RESET_METHOD_BACO:
dev_info(adev->dev, "BACO reset\n");
-
- ret = smu_baco_enter(smu);
- if (ret)
- return ret;
- ret = smu_baco_exit(smu);
- if (ret)
- return ret;
+ ret = amdgpu_dpm_baco_reset(adev);
break;
case AMD_RESET_METHOD_MODE2:
dev_info(adev->dev, "MODE2 reset\n"); diff --git a/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h
index 517f333fbc4b..02675155028d 100644
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +0 -8
@@ -1285,15 +1285,6 @@ int smu_get_power_limit(struct smu_context *smu,uint32_t *limit, enum smu_ppt_limit_level limit_level); -int smu_set_azalia_d3_pme (struct smu_context *smu); - -bool smu_baco_is_support (struct smu_context *smu); - -int smu_baco_get_state (struct smu_context *smu,enum smu_baco_state *state); - -int smu_baco_enter(struct smu_context *smu); -int smu_baco_exit(struct smu_context *smu); - bool smu_mode1_reset_is_support(struct smu_context *smu); bool smu_mode2_reset_is_support(struct smu_context *smu); int smu_mode1_reset(struct smu_context *smu); diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 4120d28f782b..1bb0c0966e3d 100644
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -91
101 lines not on this page · raw message
2.29.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=04%7C01%7CDennis.Li%40amd.com%7Cb00f935cbf75466856f508d8eab71ff8%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517419531562871%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=J%2FeyHZ%2FPq2ASS5faBddw7PhJh%2FA2Jep4gKnbZ1J122I%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx