[PATCH V5 12/16] drm/amd/pm: do not expose the smu_context structure used internally in power

2021-12-12 Thread Evan Quan
This can cover the power implementation details. And as what did for powerplay framework, we hook the smu_context to adev->powerplay.pp_handle. Signed-off-by: Evan Quan Change-Id: I3969c9f62a8b63dc6e4321a488d8f15022ffeb3d -- v1->v2: - drop smu_ppt_limit_type used internall

[PATCH V5 14/16] drm/amd/pm: drop unnecessary gfxoff controls

2021-12-12 Thread Evan Quan
Those gfxoff controls added for some specific ASICs are unnecessary. The functionalities are not affected without them. Also to align with other ASICs, they should also be dropped. Signed-off-by: Evan Quan Change-Id: Ia8475ef9e97635441aca5e0a7693e2a515498523 --- drivers/gpu/drm/amd/pm/swsmu

[PATCH V5 13/16] drm/amd/pm: relocate the power related headers

2021-12-12 Thread Evan Quan
Instead of centralizing all headers in the same folder. Separate them into different folders and place them among those source files those who really need them. Signed-off-by: Evan Quan Change-Id: Id74cb4c7006327ca7ecd22daf17321e417c4aa71 -- v1->v2: - create separate holders for driver

[PATCH V5 16/16] drm/amd/pm: unified lock protections in amdgpu_dpm.c

2021-12-12 Thread Evan Quan
As the only entry point, it's now safe and reasonable to enforce the lock protections in amdgpu_dpm.c. And with this, we can drop other internal used power locks. Signed-off-by: Evan Quan Change-Id: Iad228cad0b3d8c41927def08965a52525f3f51d3 --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c| 707

[PATCH V5 04/16] drm/amd/pm: do not expose those APIs used internally only in amdgpu_dpm.c

2021-12-12 Thread Evan Quan
Move them to amdgpu_dpm.c instead. Signed-off-by: Evan Quan Change-Id: I59fe0efcb47c18ec7254f3624db7a2eb78d91b8c --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 25 +++-- drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 23 --- 2 files changed, 23 insertions

[PATCH V5 05/16] drm/amd/pm: do not expose those APIs used internally only in si_dpm.c

2021-12-12 Thread Evan Quan
Move them to si_dpm.c instead. Signed-off-by: Evan Quan Change-Id: I288205cfd7c6ba09cfb22626ff70360d61ff0c67 -- v1->v2: - rename the API with "si_" prefix(Alex) v2->v3: - rename other data structures used only in si_dpm.c(Lijo) v3->v4: - rename Macros used only in

[PATCH V5 06/16] drm/amd/pm: do not expose the API used internally only in kv_dpm.c

2021-12-12 Thread Evan Quan
Move it to kv_dpm.c instead. Signed-off-by: Evan Quan Change-Id: I554332b386491a79b7913f72786f1e2cb1f8165b -- v1->v2: - rename the API with "kv_" prefix(Alex) --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 23 - drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h |

[PATCH V5 15/16] drm/amd/pm: revise the performance level setting APIs

2021-12-12 Thread Evan Quan
Avoid cross callings which make lock protection enforcement on amdgpu_dpm_force_performance_level() impossible. Signed-off-by: Evan Quan Change-Id: Ie658140f40ab906ce2ec47576a086062b61076a6 -- v1->v2: - drop unused enable_umd_pstate callback(Lijo) --- drivers/gpu/drm/amd/include/amd_share

[PATCH] drm/amdgpu: correct the wrong cached state for GMC on PICASSO

2021-12-13 Thread Evan Quan
Pair the operations did in GMC ->hw_init and ->hw_fini. That can help to maintain correct cached state for GMC and avoid unintention gate operation dropping due to wrong cached state. BUG: https://gitlab.freedesktop.org/drm/amd/-/issues/1828 Signed-off-by: Evan Quan Cha

[PATCH V3 14/17] drm/amd/pm: relocate the power related headers

2021-12-01 Thread Evan Quan
Instead of centralizing all headers in the same folder. Separate them into different folders and place them among those source files those who really need them. Signed-off-by: Evan Quan Change-Id: Id74cb4c7006327ca7ecd22daf17321e417c4aa71 --- drivers/gpu/drm/amd/pm/Makefile | 10

[PATCH V3 00/17] Unified entry point for other blocks to interact with power

2021-12-01 Thread Evan Quan
for unnecessary power locks possible. Evan Quan (17): drm/amd/pm: do not expose implementation details to other blocks out of power drm/amd/pm: do not expose power implementation details to amdgpu_pm.c drm/amd/pm: do not expose power implementation details to display drm/amd/pm: do

[PATCH V3 01/17] drm/amd/pm: do not expose implementation details to other blocks out of power

2021-12-01 Thread Evan Quan
Those implementation details(whether swsmu supported, some ppt_funcs supported, accessing internal statistics ...)should be kept internally. It's not a good practice and even error prone to expose implementation details. Signed-off-by: Evan Quan Change-Id

[PATCH V3 02/17] drm/amd/pm: do not expose power implementation details to amdgpu_pm.c

2021-12-01 Thread Evan Quan
amdgpu_pm.c holds all the user sysfs/hwmon interfaces. It's another client of our power APIs. It's not proper to spike into power implementation details there. Signed-off-by: Evan Quan Change-Id: I397853ddb13eacfce841366de2a623535422df9a -- v1->v2: - drop unneeded &quo

[PATCH V3 03/17] drm/amd/pm: do not expose power implementation details to display

2021-12-01 Thread Evan Quan
Display is another client of our power APIs. It's not proper to spike into power implementation details there. Signed-off-by: Evan Quan Change-Id: Ic897131e16473ed29d3d7586d822a55c64e6574a --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +- .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c

[PATCH V3 04/17] drm/amd/pm: do not expose those APIs used internally only in amdgpu_dpm.c

2021-12-01 Thread Evan Quan
Move them to amdgpu_dpm.c instead. Signed-off-by: Evan Quan Change-Id: I59fe0efcb47c18ec7254f3624db7a2eb78d91b8c --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 25 +++-- drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 23 --- 2 files changed, 23 insertions

[PATCH V3 16/17] drm/amd/pm: revise the performance level setting APIs

2021-12-01 Thread Evan Quan
Avoid cross callings which make lock protection enforcement on amdgpu_dpm_force_performance_level() impossible. Signed-off-by: Evan Quan Change-Id: Ie658140f40ab906ce2ec47576a086062b61076a6 --- drivers/gpu/drm/amd/pm/amdgpu_pm.c| 29 --- .../gpu/drm/amd/pm/legacy-dpm

[PATCH V3 07/17] drm/amd/pm: create a new holder for those APIs used only by legacy ASICs(si/kv)

2021-12-01 Thread Evan Quan
Those APIs are used only by legacy ASICs(si/kv). They cannot be shared by other ASICs. So, we create a new holder for them. Signed-off-by: Evan Quan Change-Id: I555dfa37e783a267b1d3b3a7db5c87fcc3f1556f -- v1->v2: - rename amdgpu_pm_compute_clocks as amdgpu_dpm_compute_clocks(Lijo) --- driv

[PATCH V3 09/17] drm/amd/pm: optimize the amdgpu_pm_compute_clocks() implementations

2021-12-01 Thread Evan Quan
Drop cross callings and multi-function APIs. Also avoid exposing internal implementations details. Signed-off-by: Evan Quan Change-Id: I55e5ab3da6a70482f5f5d8c256eed2f754feae20 --- .../gpu/drm/amd/include/kgd_pp_interface.h| 2 +- drivers/gpu/drm/amd/pm/Makefile | 2

[PATCH V3 17/17] drm/amd/pm: unified lock protections in amdgpu_dpm.c

2021-12-01 Thread Evan Quan
As the only entry point, it's now safe and reasonable to enforce the lock protections in amdgpu_dpm.c. And with this, we can drop other internal used power locks. Signed-off-by: Evan Quan Change-Id: Iad228cad0b3d8c41927def08965a52525f3f51d3 --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c| 719

[PATCH V3 05/17] drm/amd/pm: do not expose those APIs used internally only in si_dpm.c

2021-12-01 Thread Evan Quan
Move them to si_dpm.c instead. Signed-off-by: Evan Quan Change-Id: I288205cfd7c6ba09cfb22626ff70360d61ff0c67 -- v1->v2: - rename the API with "si_" prefix(Alex) v2->v3: - rename other data structures used only in si_dpm.c(Lijo) --- drivers/gpu/drm/amd/pm/amdgpu_d

[PATCH V3 06/17] drm/amd/pm: do not expose the API used internally only in kv_dpm.c

2021-12-01 Thread Evan Quan
Move it to kv_dpm.c instead. Signed-off-by: Evan Quan Change-Id: I554332b386491a79b7913f72786f1e2cb1f8165b -- v1->v2: - rename the API with "kv_" prefix(Alex) --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 23 - drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h |

[PATCH V3 08/17] drm/amd/pm: move pp_force_state_enabled member to amdgpu_pm structure

2021-12-01 Thread Evan Quan
As it lables an internal pm state and amdgpu_pm structure is the more proper place than amdgpu_device structure for it. Signed-off-by: Evan Quan Change-Id: I7890e8fe7af2ecd8591d30442340deb8773bacc3 --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 - drivers/gpu/drm/amd/pm/amdgpu_pm.c | 6

[PATCH V3 10/17] drm/amd/pm: move those code piece used by Stoney only to smu8_hwmgr.c

2021-12-01 Thread Evan Quan
Instead of putting them in amdgpu_dpm.c. Signed-off-by: Evan Quan Change-Id: Ieb7ed5fb6140401a7692b401c5a42dc53da92af8 --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c| 14 -- drivers/gpu/drm/amd/pm/inc/hwmgr.h | 3 --- .../gpu/drm/amd/pm/powerplay/hwmgr

[PATCH V3 12/17] drm/amd/pm: drop redundant or unused APIs and data structures

2021-12-01 Thread Evan Quan
Drop those unused APIs and data structures. Signed-off-by: Evan Quan Change-Id: I57d2a03dcda02d0b5d9c5ffbdd37bffe49945407 --- drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 49 - drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 4 ++ 2 files changed, 4 insertions(+), 49 deletions

[PATCH V3 11/17] drm/amd/pm: correct the usage for amdgpu_dpm_dispatch_task()

2021-12-01 Thread Evan Quan
We should avoid having multi-function APIs. It should be up to the caller to determine when or whether to call amdgpu_dpm_dispatch_task(). Signed-off-by: Evan Quan Change-Id: I78ec4eb8ceb6e526a4734113d213d15a5fbaa8a4 --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 18 ++ drivers/gpu

[PATCH V3 15/17] drm/amd/pm: drop unnecessary gfxoff controls

2021-12-01 Thread Evan Quan
Those gfxoff controls added for some specific ASICs are unnecessary. The functionalities are not affected without them. Also to align with other ASICs, they should also be dropped. Signed-off-by: Evan Quan Change-Id: Ia8475ef9e97635441aca5e0a7693e2a515498523 --- drivers/gpu/drm/amd/pm/swsmu

[PATCH V3 13/17] drm/amd/pm: do not expose the smu_context structure used internally in power

2021-12-01 Thread Evan Quan
This can cover the power implementation details. And as what did for powerplay framework, we hook the smu_context to adev->powerplay.pp_handle. Signed-off-by: Evan Quan Change-Id: I3969c9f62a8b63dc6e4321a488d8f15022ffeb3d -- v1->v2: - drop smu_ppt_limit_type used internall

[PATCH 1/2] drm/amd/pm: restore user customized OD settings properly for NV1x

2021-07-22 Thread Evan Quan
. - For those non-committed changes, they are restored only without feeding to SMU. Change-Id: Iea7cf7908dfcd919a4d0205e10bff91b1149a440 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 8 +++ drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 9 .../gpu/drm/amd/pm

[PATCH 2/2] drm/amd/pm: restore user customized OD settings properly for Sienna Cichlid

2021-07-22 Thread Evan Quan
Properly restore those committed and non-committed user customized OD settings. Change-Id: I25396df0b3ecdd7a0d9fc77ed220b0abf1fde020 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/inc/smu_v11_0.h | 2 ++ drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 15

[PATCH V2 2/2] drm/amd/pm: restore user customized OD settings properly for Sienna Cichlid

2021-07-23 Thread Evan Quan
Properly restore those committed and non-committed user customized OD settings. Change-Id: I25396df0b3ecdd7a0d9fc77ed220b0abf1fde020 Signed-off-by: Evan Quan --- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 37 ++- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git

[PATCH V2 1/2] drm/amd/pm: restore user customized OD settings properly for NV1x

2021-07-23 Thread Evan Quan
. - For those non-committed changes, they are restored only without feeding to SMU. Change-Id: Iea7cf7908dfcd919a4d0205e10bff91b1149a440 Signed-off-by: Evan Quan -- v1->v2 - better naming and logic revised for checking OD setting update(Lijo) --- drivers/gpu/drm/amd/pm/inc/amdgpu_sm

[PATCH 7/7] drm/amd/pm: drop unneeded hwmgr->smu_lock

2022-01-05 Thread Evan Quan
As all those related APIs are already well protected by adev->pm.mutex. Signed-off-by: Evan Quan Change-Id: I36426791d3bbc9d84a6ae437da26a892682eb0cb --- .../gpu/drm/amd/pm/powerplay/amd_powerplay.c | 282 +++--- drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h | 1 - 2 fi

[PATCH 0/7] Drop unnecessary power related lock protections

2022-01-05 Thread Evan Quan
A unified lock protection mechanism was already enforced on those APIs from amdgpu_dpm.c. Thus those extra internal lock protections will be unnecessary and can be dropped. Evan Quan (7): drm/amd/pm: drop unneeded lock protection smu->mutex drm/amd/pm: drop unneeded vcn/jpeg_gate_lock

[PATCH 2/7] drm/amd/pm: drop unneeded vcn/jpeg_gate_lock

2022-01-05 Thread Evan Quan
As those related APIs are already protected by adev->pm.mutex. Signed-off-by: Evan Quan Change-Id: I762fab96bb1c034c153b029f939ec6e498460007 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 56 +++ drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 2 - 2 files changed

[PATCH 1/7] drm/amd/pm: drop unneeded lock protection smu->mutex

2022-01-05 Thread Evan Quan
As all those APIs are already protected either by adev->pm.mutex or smu->message_lock. Signed-off-by: Evan Quan Change-Id: I1db751fba9caabc5ca1314992961d3674212f9b0 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 315 ++ drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h

[PATCH 4/7] drm/amd/pm: drop unneeded smu->sensor_lock

2022-01-05 Thread Evan Quan
As all those related APIs are already well protected by adev->pm.mutex and smu->message_lock. Signed-off-by: Evan Quan Change-Id: I20974b2ae68d63525bc7c7f406fede2971c5fecc --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu

[PATCH 3/7] drm/amd/pm: drop unneeded smu->metrics_lock

2022-01-05 Thread Evan Quan
As all those related APIs are already well protected by adev->pm.mutex and smu->message_lock. Signed-off-by: Evan Quan Change-Id: Ic75326ba7b4b67be8762d5407d02f6c514e1ad35 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .

[PATCH 6/7] drm/amd/pm: drop unneeded feature->mutex

2022-01-05 Thread Evan Quan
As all those related APIs are already well protected by adev->pm.mutex. Signed-off-by: Evan Quan Change-Id: Ia2c752ff22e8f23601484f48b66151cfda8c01b5 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/sm

[PATCH 5/7] drm/amd/pm: drop unneeded smu_baco->mutex

2022-01-05 Thread Evan Quan
As those APIs related are already well protected by adev->pm.mutex. Signed-off-by: Evan Quan Change-Id: I8a7d8da5710698a98dd0f7e70c244be57474b573 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/sm

[PATCH] drm/amd/pm: correct the checks for fan attributes support

2022-01-10 Thread Evan Quan
On functionality unsupported, -EOPNOTSUPP will be returned. And we rely on that to determine the fan attributes support. Fixes: 801771de0331 ("drm/amd/pm: do not expose power implementation details to amdgpu_pm.c") Signed-off-by: Evan Quan Change-Id: I95e7e0beebd678a446221a72234cd3

[PATCH] drm/amd/pm: correct the checks for fan attributes support

2022-01-11 Thread Evan Quan
On functionality unsupported, -EOPNOTSUPP will be returned. And we rely on that to determine the fan attributes support. Fixes: 801771de0331 ("drm/amd/pm: do not expose power implementation details to amdgpu_pm.c") Signed-off-by: Evan Quan Change-Id: I95e7e0beebd678a446221a72234cd3

[PATCH V2 5/7] drm/amd/pm: drop unneeded smu_baco->mutex

2022-01-16 Thread Evan Quan
As those APIs related are already well protected by adev->pm.mutex. Signed-off-by: Evan Quan Change-Id: I8a7d8da5710698a98dd0f7e70c244be57474b573 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/sm

[PATCH V2 6/7] drm/amd/pm: drop unneeded feature->mutex

2022-01-16 Thread Evan Quan
As all those related APIs are already well protected by adev->pm.mutex. Signed-off-by: Evan Quan Change-Id: Ia2c752ff22e8f23601484f48b66151cfda8c01b5 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/sm

[PATCH V2 7/7] drm/amd/pm: drop unneeded hwmgr->smu_lock

2022-01-16 Thread Evan Quan
As all those related APIs are already well protected by adev->pm.mutex. Signed-off-by: Evan Quan Change-Id: I36426791d3bbc9d84a6ae437da26a892682eb0cb --- .../gpu/drm/amd/pm/powerplay/amd_powerplay.c | 278 +++--- drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h | 1 - 2 fi

[PATCH V2 1/7] drm/amd/pm: drop unneeded lock protection smu->mutex

2022-01-16 Thread Evan Quan
As all those APIs are already protected either by adev->pm.mutex or smu->message_lock. Signed-off-by: Evan Quan Change-Id: I1db751fba9caabc5ca1314992961d3674212f9b0 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 315 ++ drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h

[PATCH V2 2/7] drm/amd/pm: drop unneeded vcn/jpeg_gate_lock

2022-01-16 Thread Evan Quan
As those related APIs are already protected by adev->pm.mutex. Signed-off-by: Evan Quan Change-Id: I762fab96bb1c034c153b029f939ec6e498460007 -- v1->v2: - optimize the label for error exit(Guchun) --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 63 --- drivers/gpu/d

[PATCH V2 3/7] drm/amd/pm: drop unneeded smu->metrics_lock

2022-01-16 Thread Evan Quan
As all those related APIs are already well protected by adev->pm.mutex and smu->message_lock. Signed-off-by: Evan Quan Change-Id: Ic75326ba7b4b67be8762d5407d02f6c514e1ad35 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .

[PATCH V2 4/7] drm/amd/pm: drop unneeded smu->sensor_lock

2022-01-16 Thread Evan Quan
As all those related APIs are already well protected by adev->pm.mutex and smu->message_lock. Signed-off-by: Evan Quan Change-Id: I20974b2ae68d63525bc7c7f406fede2971c5fecc --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu

[PATCH V3] drm/amdgpu: expand cg_flags from u32 to u64

2022-04-01 Thread Evan Quan
With this, we can support more CG flags. Signed-off-by: Evan Quan Acked-by: Alex Deucher Reviewed-by: Hawking Zhang Change-Id: Iccf13c2f9c570ca6a4654291fc4876556125c3b8 -- v1->v2: - amdgpu_debugfs_gca_config_read: add a new rev to support CG flag upper 32 bits(Alex) v2->v3: - use

[PATCH] drm/amdgpu: expand cg_flags from u32 to u64

2022-03-30 Thread Evan Quan
With this, we can support more CG flags. Signed-off-by: Evan Quan Acked-by: Alex Deucher Change-Id: Iccf13c2f9c570ca6a4654291fc4876556125c3b8 -- v1->v2: - amdgpu_debugfs_gca_config_read: add a new rev to support CG flag upper 32 bits(Alex) --- drivers/gpu/drm/amd/amdgpu/amdgp

[PATCH V3 4/7] drm/amd/pm: correct the usage for 'supported' member of smu_feature structure

2022-01-27 Thread Evan Quan
The supported features should be retrieved just after EnableAllDpmFeatures message complete. And the check(whether some dpm feature is supported) is only needed when we decide to enable or disable it. Signed-off-by: Evan Quan Change-Id: I07c9a5ac5290cd0d88a40ce1768d393156419b5a --- drivers

[PATCH V3 3/7] drm/amd/pm: update the data type for retrieving enabled ppfeatures

2022-01-27 Thread Evan Quan
Use uint64_t instead of an array of uint32_t. This can avoid some non-necessary intermediate uint32_t -> uint64_t conversions. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Change-Id: I4e217357203a23440f058d7e25f55eaebd15c5ef --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c |

[PATCH V3 7/7] drm/amd/pm: revise the implementation of smu_cmn_disable_all_features_with_exception

2022-01-27 Thread Evan Quan
As there is no internal cache for enabled ppfeatures now. Thus the 2nd parameter will be not needed any more. Signed-off-by: Evan Quan Change-Id: I0c1811f216c55d6ddfabdc9e099dc214c21bdf2e --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 9 ++--- drivers/gpu/drm/amd/pm/swsmu/inc

[PATCH V3 6/7] drm/amd/pm: avoid consecutive retrieving for enabled ppfeatures

2022-01-27 Thread Evan Quan
As the enabled ppfeatures are just retrieved ahead. We can use that directly instead of retrieving again and again. Signed-off-by: Evan Quan Change-Id: I08827437fcbbc52084418c8ca6a90cfa503306a9 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 10 +- 1 file changed, 9 insertions(+), 1

[PATCH V3 5/7] drm/amd/pm: drop the cache for enabled ppfeatures

2022-01-27 Thread Evan Quan
related DPM features. All those are performed without driver's notice. Also considering driver does not actually interact with PMFW such frequently, the benefit brought by such cache is very limited. Signed-off-by: Evan Quan Change-Id: I20ed58ab216e930c7a5d223be1eb99146889f2b3 --- drivers

[PATCH V3 1/7] drm/amd/pm: correct the way for retrieving enabled ppfeatures on Renoir

2022-01-27 Thread Evan Quan
As other dGPU asics, Renoir should use smu_cmn_get_enabled_mask() for that job. Signed-off-by: Evan Quan Acked-by: Alex Deucher Change-Id: I9e845ba84dd45d0826506de44ef4760fa851a516 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH V3 2/7] drm/amd/pm: unify the interface for retrieving enabled ppfeatures

2022-01-27 Thread Evan Quan
Instead of having two which do the same thing. Signed-off-by: Evan Quan Change-Id: I6302c9b5abdb999c4b7c83a0d1852181208b1c1f -- v1->v2: - use SMU IP version check rather than an asic type check(Alex) --- .../amd/pm/swsmu/smu11/cyan_skillfish_ppt.c | 2 +- .../gpu/drm/amd/pm/swsmu/sm

[PATCH 1/7] drm/amd/pm: correct UMD pstate clocks for Dimgrey Cavefish and Beige Goby

2022-02-07 Thread Evan Quan
Correct the UMD pstate profiling clocks for Dimgrey Cavefish and Beige Goby. Signed-off-by: Evan Quan Change-Id: I74fdbcf2cfa11f97ae16e4921449ab7cdb7e43c9 --- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 26 +++ .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.h | 8 ++ 2

[PATCH 2/7] drm/amd/pm: fulfill the support for DriverSmuConfig table

2022-02-07 Thread Evan Quan
Enable the support for DriverSmuConfig table on Navi1x and Sienna_Cichlid. Signed-off-by: Evan Quan Change-Id: Ie510f8b06b7a4910b1574b6e9affa875805ef868 --- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 + drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 9 + .../gpu

[PATCH 3/7] drm/amd/pm: correct the default DriverSmuConfig table settings

2022-02-07 Thread Evan Quan
For Some ASICs, with the PMFW default settings, we may see the power consumption reported via metrics table is "Very Erratic". With the socket power alpha filter set as 10/100ms, we can correct that issue. Signed-off-by: Evan Quan Change-Id: Ia352579e1cc7a531cb1de5c835fe5bf132d5dd20 --

[PATCH 5/7] drm/amd/pm: fulfill Sienna_Cichlid implementations for DriverSmuConfig setting

2022-02-07 Thread Evan Quan
Fulfill the implementations for DriverSmuConfig setting on Sienna_Cichlid. Signed-off-by: Evan Quan Change-Id: Ic519c8d4fcfeefdda79ba9ed01b235824d76e40f --- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 54 +++ 1 file changed, 54 insertions(+) diff --git a/drivers/gpu/drm/amd

[PATCH 6/7] drm/amdgpu: disable MMHUB PG for Picasso

2022-02-07 Thread Evan Quan
MMHUB PG needs to be disabled for Picasso for stability reasons. Signed-off-by: Evan Quan Change-Id: Iea0ec757582a764ab5a000d7cc411fb814ffb19f --- drivers/gpu/drm/amd/amdgpu/soc15.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b

[PATCH 4/7] drm/amd/pm: fulfill Navi1x implementations for DriverSmuConfig setting

2022-02-07 Thread Evan Quan
Fulfill the implementations for DriverSmuConfig setting on Navi1x. Signed-off-by: Evan Quan Change-Id: I244766a893b4070dfdf171451f6338d33572ec1d --- .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 50 +++ 1 file changed, 50 insertions(+) diff --git a/drivers/gpu/drm/amd/pm

[PATCH 7/7] drm/amd/pm: fix some OEM SKU specific stability issues

2022-02-07 Thread Evan Quan
Add a quirk in sienna_cichlid_ppt.c to fix some OEM SKU specific stability issues. Signed-off-by: Evan Quan Change-Id: I172c6429c54253788dbf28f7acf877375f2bfc5b --- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 32 ++- 1 file changed, 31 insertions(+), 1 deletion(-) diff

[PATCH 11/12] drm/amd/pm: drop extra non-necessary null pointers checks

2022-02-10 Thread Evan Quan
They are totally redundant. The checks before them can guard they cannot be NULL. Signed-off-by: Evan Quan Change-Id: I9f31734f49a8093582fc321ef3d93233946006e3 --- .../gpu/drm/amd/pm/powerplay/amd_powerplay.c | 182 ++ .../amd/pm/powerplay/hwmgr/hardwaremanager.c | 42

[PATCH 12/12] drm/amd/pm: revise the implementations for asic reset

2022-02-10 Thread Evan Quan
Instead of having an interface for every reset method, we replace them with a new interface which can support all reset methods. Signed-off-by: Evan Quan Change-Id: I4c8a7121dd65c2671085673dd7c13cf7e4286f3d --- drivers/gpu/drm/amd/amdgpu/aldebaran.c| 2 +- drivers/gpu/drm/amd/amdgpu

[PATCH 05/12] drm/amd/pm: move the check for dpm enablement to amdgpu_dpm.c

2022-02-10 Thread Evan Quan
Instead of checking this in every instance(framework), moving that check to amdgpu_dpm.c is more proper. And that can make code clean and tidy. Signed-off-by: Evan Quan Change-Id: I2f83a3b860e8aa12cc86f119011f520fbe21a301 --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 5 +- drivers/gpu

[PATCH 08/12] drm/amd/pm: add proper check for amdgpu_dpm before granting pp_dpm_load_fw

2022-02-10 Thread Evan Quan
Make sure the interface get granted only when amdgpu_dpm enabled. Signed-off-by: Evan Quan Change-Id: Ia1d1123470fab89b41b24ea80dcb319570aa7438 --- drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 6 ++ drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c | 3 --- 2 files changed, 6

[PATCH 03/12] drm/amd/pm: drop unneeded !smu->pm_enabled check

2022-02-10 Thread Evan Quan
As smu->pm_enabled is a prerequisite for adev->pm.dpm_enabled. So, with adev->pm.dpm_enabled set, it can be guarded that smu->pm_enabled is also set. Thus the extra check for "!smu->pm_enabled" is totally unnecessary. Signed-off-by: Evan Quan Change-Id: I6ff67137d447e6a

[PATCH 04/12] drm/amd/pm: use adev->pm.dpm_enabled for dpm enablement check

2022-02-10 Thread Evan Quan
adev->pm.dpm_enabled instead of hwmgr->pm_en can better reflect whether the dpm features are actually enabled. Signed-off-by: Evan Quan Change-Id: I6896dcee19bb473d26115cdcb12b6efd554b30f9 --- drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c| 39 +++--- drivers/gpu/drm/amd/pm/legacy-dpm/si

[PATCH 06/12] drm/amd/pm: correct the checks for sriov(pp_one_vf)

2022-02-10 Thread Evan Quan
By setting pm_enabled as false for non pp_one_vf sriov case, we can avoid the check for (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)) in every routine. Signed-off-by: Evan Quan Change-Id: I3859529183cd26dce98c57dc87eab5273ecc949b --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_sm

[PATCH 07/12] drm/amd/pm: correct the checks for granting gpu reset APIs

2022-02-10 Thread Evan Quan
Those gpu reset APIs can be granted when: - System is up and dpm features are enabled. - System is under resuming and dpm features are not yet enabled. Under such scenario, the PMFW is already alive and can support those gpu reset functionalities. Signed-off-by: Evan Quan Change-Id

[PATCH 09/12] drm/amd/pm: drop redundant !pp_funcs check

2022-02-10 Thread Evan Quan
As it can be covered by the "!adev->pm.dpm_enabled" check. As long as "adev->pm.dpm_enabled != NULL", "pp_funcs != NULL" can be also guarded. Signed-off-by: Evan Quan Change-Id: Iec801f18a0069ad5fd384c4133016977fb2b67e8 --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c

[PATCH 10/12] drm/amd/pm: drop nonsense !smu->ppt_funcs check

2022-02-10 Thread Evan Quan
Since the "smu->ppt_funcs" was already well installed at early_init phase, the checks afterwards make nonsense. Signed-off-by: Evan Quan Change-Id: I07a945035a87b23032e4911bba768edacbd5e65a --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 20 +--- drivers/gpu/drm

[PATCH 01/12] drm/amd/pm: drop unused structure members

2022-02-10 Thread Evan Quan
Drop those members which get never used. Signed-off-by: Evan Quan Change-Id: Iec70ad1dfe2059be26843f378588e6c894e9cae8 --- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm

[PATCH 02/12] drm/amd/pm: drop unused interfaces

2022-02-10 Thread Evan Quan
Drop those interfaces which never get used. Signed-off-by: Evan Quan Change-Id: Ia22d395145a1003faca5ac792dca6a30ef2cae54 --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 13 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 5 drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 4

[PATCH] drm/amd/pm: fix enabled features retrieving on Renoir and Cyan Skillfish

2022-02-09 Thread Evan Quan
For Cyan Skillfish and Renoir, there is no interface provided by PMFW to retrieve the enabled features. So, we assume all features are enabled. Fixes: 7ade3ca9cdb5 ("drm/amd/pm: correct the usage for 'supported' member of smu_feature structure") Signed-off-by: Evan Quan

[PATCH V3 1/7] drm/amd/pm: drop unneeded lock protection smu->mutex

2022-01-20 Thread Evan Quan
As all those APIs are already protected either by adev->pm.mutex or smu->message_lock. Signed-off-by: Evan Quan Change-Id: I1db751fba9caabc5ca1314992961d3674212f9b0 -- v1->v2: - optimize the "!smu_table->hardcode_pptable" check(Guchun) - add the lock protection(a

[PATCH 4/7] drm/amd/pm: update the data type for retrieving enabled ppfeatures

2022-01-20 Thread Evan Quan
Use uint64_t instead of an array of uint32_t. This can avoid some non-necessary intermediate uint32_t -> uint64_t conversions. Signed-off-by: Evan Quan Change-Id: I4e217357203a23440f058d7e25f55eaebd15c5ef --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 +- drivers/gpu/drm/amd/pm/sw

[PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member of smu_feature structure

2022-01-20 Thread Evan Quan
As it has exactly the same value as the 'enabled' member and also do the same thing. Signed-off-by: Evan Quan Change-Id: I07c9a5ac5290cd0d88a40ce1768d393156419b5a --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm

[PATCH 6/7] drm/amd/pm: avoid consecutive retrieving for enabled ppfeatures

2022-01-20 Thread Evan Quan
As the enabled ppfeatures are just retrieved ahead. We can use that directly instead of retrieving again and again. Signed-off-by: Evan Quan Change-Id: I08827437fcbbc52084418c8ca6a90cfa503306a9 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 10 +- 1 file changed, 9 insertions(+), 1

[PATCH 5/7] drm/amd/pm: drop the cache for enabled ppfeatures

2022-01-20 Thread Evan Quan
related DPM features. All those are performed without driver's notice. Also considering driver does not actually interact with PMFW such frequently, the benefit brought by such cache is very limited. Signed-off-by: Evan Quan Change-Id: I20ed58ab216e930c7a5d223be1eb99146889f2b3 --- drivers

[PATCH 7/7] drm/amd/pm: revise the implementation of smu_cmn_disable_all_features_with_exception

2022-01-20 Thread Evan Quan
As there is no internal cache for enabled ppfeatures now. Thus the 2nd parameter will be not needed any more. Signed-off-by: Evan Quan Change-Id: I0c1811f216c55d6ddfabdc9e099dc214c21bdf2e --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 9 ++--- drivers/gpu/drm/amd/pm/swsmu/inc

[PATCH 1/7] drm/amd/pm: correct the way for retrieving enabled ppfeatures on Renoir

2022-01-20 Thread Evan Quan
As other dGPU asics, Renoir should use smu_cmn_get_enabled_mask() for that job. Signed-off-by: Evan Quan Change-Id: I9e845ba84dd45d0826506de44ef4760fa851a516 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm

[PATCH 2/7] drm/amd/pm: unify the interface for retrieving enabled ppfeatures

2022-01-20 Thread Evan Quan
Instead of having two which do the same thing. Signed-off-by: Evan Quan Change-Id: I6302c9b5abdb999c4b7c83a0d1852181208b1c1f --- .../amd/pm/swsmu/smu11/cyan_skillfish_ppt.c | 2 +- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 6 +- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 6

[PATCH] drm/amdgpu: suppress the warning about enum value 'AMD_IP_BLOCK_TYPE_NUM'

2022-01-19 Thread Evan Quan
Suppress the warning below on building htmldocs: drivers/gpu/drm/amd/include/amd_shared.h:103: warning: Enum value 'AMD_IP_BLOCK_TYPE_NUM' not described in enum 'amd_ip_block_type' Fixes: 6ee27ee27ba8 ("drm/amd/pm: avoid duplicate powergate/ungate setting") Signed-off-by: Evan Quan

[PATCH V2 4/7] drm/amd/pm: correct the usage for 'supported' member of smu_feature structure

2022-01-25 Thread Evan Quan
The supported features should be retrieved just after EnableAllDpmFeatures message complete. And the check(whether some dpm feature is supported) is only needed when we decide to enable or disable it. Signed-off-by: Evan Quan Change-Id: I07c9a5ac5290cd0d88a40ce1768d393156419b5a --- drivers

[PATCH V2 2/7] drm/amd/pm: unify the interface for retrieving enabled ppfeatures

2022-01-25 Thread Evan Quan
Instead of having two which do the same thing. Signed-off-by: Evan Quan Change-Id: I6302c9b5abdb999c4b7c83a0d1852181208b1c1f --- .../amd/pm/swsmu/smu11/cyan_skillfish_ppt.c | 2 +- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 6 +- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 6

[PATCH V2 1/7] drm/amd/pm: correct the way for retrieving enabled ppfeatures on Renoir

2022-01-25 Thread Evan Quan
As other dGPU asics, Renoir should use smu_cmn_get_enabled_mask() for that job. Signed-off-by: Evan Quan Change-Id: I9e845ba84dd45d0826506de44ef4760fa851a516 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm

[PATCH 1/2] drm/amd/pm: correct the MGpuFanBoost support for Beige Goby

2022-01-25 Thread Evan Quan
The existing way cannot handle Beige Goby well as a different PPTable data structure(PPTable_beige_goby_t instead of PPTable_t) is used there. Signed-off-by: Evan Quan Change-Id: I02208c011e93c4d37769bd022e65e9084faa97e4 --- drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 6 +++--- 1

[PATCH 2/2] drm/amd/pm: fix the deadlock observed on performance_level setting

2022-01-25 Thread Evan Quan
The sub-routine(amdgpu_gfx_off_ctrl) tried to obtain the lock adev->pm.mutex which was actually hold by amdgpu_dpm_force_performance_level. A deadlock happened then. Signed-off-by: Evan Quan Change-Id: Id692829381dedc6380f5464d74107d696f7abca1 --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c |

[PATCH V2 5/7] drm/amd/pm: drop the cache for enabled ppfeatures

2022-01-25 Thread Evan Quan
related DPM features. All those are performed without driver's notice. Also considering driver does not actually interact with PMFW such frequently, the benefit brought by such cache is very limited. Signed-off-by: Evan Quan Change-Id: I20ed58ab216e930c7a5d223be1eb99146889f2b3 --- drivers

[PATCH V2 6/7] drm/amd/pm: avoid consecutive retrieving for enabled ppfeatures

2022-01-25 Thread Evan Quan
As the enabled ppfeatures are just retrieved ahead. We can use that directly instead of retrieving again and again. Signed-off-by: Evan Quan Change-Id: I08827437fcbbc52084418c8ca6a90cfa503306a9 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 10 +- 1 file changed, 9 insertions(+), 1

[PATCH V2 7/7] drm/amd/pm: revise the implementation of smu_cmn_disable_all_features_with_exception

2022-01-25 Thread Evan Quan
As there is no internal cache for enabled ppfeatures now. Thus the 2nd parameter will be not needed any more. Signed-off-by: Evan Quan Change-Id: I0c1811f216c55d6ddfabdc9e099dc214c21bdf2e --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 9 ++--- drivers/gpu/drm/amd/pm/swsmu/inc

[PATCH] drm/amd/pm: fix the deadlock issue observed on SI

2022-04-11 Thread Evan Quan
By placing those unrelated code outside of adev->pm.mutex protections or restructuring the call flow, we can eliminate the deadlock issue. This comes with no real logics change. Fixes: 3712e7a49459 ("drm/amd/pm: unified lock protections in amdgpu_dpm.c") Signed-off-by: Evan Qu

[PATCH V2] drm/amd/pm: fix the deadlock issue observed on SI

2022-04-11 Thread Evan Quan
e. Fixes: 3712e7a49459 ("drm/amd/pm: unified lock protections in amdgpu_dpm.c") Reported-by: Paul Menzel Reported-by: Arthur Marsh Link: https: //lore.kernel.org/all/9e689fea-6c69-f4b0-8dee-32c4cf7d8...@molgen.mpg.de/ BugLink: https: //gitlab.freedesktop.org/drm/amd/-/issues/1957 Signe

[V11 2/8] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing

2023-08-31 Thread Evan Quan
The newly added WBRF feature needs this interface for channel width calculation. Signed-off-by: Evan Quan -- v8->v9: - correct typo(Mhz -> MHz) (Johnson) --- include/net/cfg80211.h | 8 net/wireless/chan.c| 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff

[V11 3/8] wifi: mac80211: Add support for WBRF features

2023-08-31 Thread Evan Quan
-developed-by: Mario Limonciello Signed-off-by: Mario Limonciello Co-developed-by: Evan Quan Signed-off-by: Evan Quan -- v1->v2: - place the new added member(`wbrf_supported`) in ieee80211_local(Johannes) - handle chandefs change scenario properly(Johannes) - some minor fixes around c

[V11 1/8] ACPI: Add support for AMD ACPI based Wifi band RFI mitigation feature

2023-08-31 Thread Evan Quan
can use to notify active use of particular frequencies so that other devices can make relative internal adjustments as necessary to avoid this resonance. Signed-off-by: Evan Quan -- v10->v11: - fix typo(Simon) --- drivers/acpi/Kconfig | 17 ++ drivers/acpi/Makefile |

[V11 0/8] Enable Wifi RFI interference mitigation feature support

2023-08-31 Thread Evan Quan
to wifi subsystem. Patch4 - 8: Bring WBRF support to AMD graphics driver. Evan Quan (8): ACPI: Add support for AMD ACPI based Wifi band RFI mitigation feature cfg80211: expose nl80211_chan_width_to_mhz for wide sharing wifi: mac80211: Add support for WBRF features drm/amd/pm: update

<    5   6   7   8   9   10   11   12   13   >