[PATCH V2 1/7] drm/amd/pm: correct the fan speed RPM setting

2021-08-11 Thread Evan Quan
The relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, we need a new way to perform the fan speed RPM setting. Change-Id: I1afe8102f02ead9a8a07c7105f689ac60a85b0d8 Signed-off-by: Evan Quan -- v1->v2: - hardcode crystal_clo

[PATCH V2 2/7] drm/amd/pm: record the RPM and PWM based fan speed settings

2021-08-11 Thread Evan Quan
As the relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, both the RPM and PWM settings need to be saved. Change-Id: I318c134d442273d518b805339cdf383e151b935d Signed-off-by: Evan Quan -- v1->v2: - coding style an

[PATCH V2 3/7] drm/amd/pm: correct the fan speed PWM retrieving

2021-08-11 Thread Evan Quan
The relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, we need a new way to retrieving the fan speed PWM. Change-Id: Idfe0276d7113b9c921b88fa08085a33fd971d621 Signed-off-by: Evan Quan --- .../include/asic_reg/thm/thm_11_0_2_o

[PATCH V2 6/7] drm/amd/pm: drop unnecessary manual mode check

2021-08-11 Thread Evan Quan
As the fan control was guarded under manual mode before fan speed RPM/PWM setting. Thus the extra check is totally redundant. Change-Id: Ia9d776141ec4aa39255accbf00d7e7ed81c8424d Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 12 +--- 1 file changed, 1

[PATCH V2 4/7] drm/amd/pm: correct the fan speed RPM retrieving

2021-08-11 Thread Evan Quan
The relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, we need a new way to retrieving the fan speed RPM. Change-Id: Ife4298c8b7ec93ef023a7da27d59654e0444e044 Signed-off-by: Evan Quan -- v1->v2 - drop unneeded inter

[PATCH V2 5/7] drm/amd/pm: drop the unnecessary intermediate percent-based transition

2021-08-11 Thread Evan Quan
Currently, the readout of fan speed pwm is transited into percent-based and then pwm-based. However, the transition into percent-based is totally unnecessary and make the final output less accurate. Change-Id: Ib99e088cda1875b4e2601f7077a178af6fe8a6cb Signed-off-by: Evan Quan --- v1->

[PATCH V2 7/7] drm/amd/pm: correct the address of Arcturus fan related registers

2021-08-11 Thread Evan Quan
These registers have different address from other SMU V11 ASICs. Change-Id: Iaeb0438331eed9b0313933da25622f8e4c048fab Signed-off-by: Evan Quan --- v1->v2: - cover the ASIC specific details in arcturus_ppt.c (Lijo) --- .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 138 +-

[PATCH V3 1/7] drm/amd/pm: correct the fan speed RPM setting

2021-08-12 Thread Evan Quan
The relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, we need a new way to perform the fan speed RPM setting. Change-Id: I1afe8102f02ead9a8a07c7105f689ac60a85b0d8 Signed-off-by: Evan Quan -- v1->v2: - hardcode crystal_clo

[PATCH V3 2/7] drm/amd/pm: record the RPM and PWM based fan speed settings

2021-08-12 Thread Evan Quan
As the relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, both the RPM and PWM settings need to be saved. Change-Id: I318c134d442273d518b805339cdf383e151b935d Signed-off-by: Evan Quan -- v1->v2: - coding style an

[PATCH V3 3/7] drm/amd/pm: correct the fan speed PWM retrieving

2021-08-12 Thread Evan Quan
The relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, we need a new way to retrieving the fan speed PWM. Change-Id: Idfe0276d7113b9c921b88fa08085a33fd971d621 Signed-off-by: Evan Quan --- .../include/asic_reg/thm/thm_11_0_2_o

[PATCH V3 4/7] drm/amd/pm: correct the fan speed RPM retrieving

2021-08-12 Thread Evan Quan
The relationship "PWM = RPM / smu->fan_max_rpm" between fan speed PWM and RPM is not true for SMU11 ASICs. So, we need a new way to retrieving the fan speed RPM. Change-Id: Ife4298c8b7ec93ef023a7da27d59654e0444e044 Signed-off-by: Evan Quan -- v1->v2 - drop unneeded inter

[PATCH V3 5/7] drm/amd/pm: drop the unnecessary intermediate percent-based transition

2021-08-12 Thread Evan Quan
Currently, the readout of fan speed pwm is transited into percent-based and then pwm-based. However, the transition into percent-based is totally unnecessary and make the final output less accurate. Change-Id: Ib99e088cda1875b4e2601f7077a178af6fe8a6cb Signed-off-by: Evan Quan --- v1->

[PATCH V3 7/7] drm/amd/pm: correct the address of Arcturus fan related registers

2021-08-12 Thread Evan Quan
These registers have different address from other SMU V11 ASICs. Change-Id: Iaeb0438331eed9b0313933da25622f8e4c048fab Signed-off-by: Evan Quan --- v1->v2: - cover the ASIC specific details in arcturus_ppt.c (Lijo) --- .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 138 +-

[PATCH V3 6/7] drm/amd/pm: drop unnecessary manual mode check

2021-08-12 Thread Evan Quan
As the fan control was guarded under manual mode before fan speed RPM/PWM setting. Thus the extra check is totally redundant. Change-Id: Ia9d776141ec4aa39255accbf00d7e7ed81c8424d Signed-off-by: Evan Quan -- v1->v2: - switch auto fan control off for AMD_FAN_CTRL_NONE mode (Lijo) --- driv

[PATCH] drm/amdgpu: disable BACO support for 699F:C7 polaris12 SKU temporarily

2021-08-13 Thread Evan Quan
We have a S3 issue on that SKU with BACO enabled. Will bring back this when that root caused. Change-Id: I56d4830e6275e20a415808896eecbadfe944070b Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/vi.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu

[PATCH V2] drm/amdgpu: disable BACO support for 699F:C7 polaris12 SKU temporarily

2021-08-16 Thread Evan Quan
We have a S3 issue on that SKU with BACO enabled. Will bring back this when that root caused. Change-Id: I56d4830e6275e20a415808896eecbadfe944070b Signed-off-by: Evan Quan Acked-by: Alex Deucher Reviewed-by: Guchun Chen -- v1->v2: - limit the SKU further by subsystem IDs (Alex) --- driv

[PATCH] drm/amdgpu: properly powergate Polaris12 UVD/VCE on suspend

2021-08-16 Thread Evan Quan
ned-off-by: Evan Quan Signed-off-by: xinhui pan --- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 5 + drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 5 + 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c index 4eebf973a065..2f

[PATCH] drm/amdgpu: add missing cleanups for Polaris12 UVD/VCE on suspend

2021-08-18 Thread Evan Quan
9ed Signed-off-by: Evan Quan Signed-off-by: xinhui pan --- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 24 drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 23 +++ 2 files changed, 47 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/g

[PATCH V2] drm/amdgpu: add missing cleanups for Polaris12 UVD/VCE on suspend

2021-08-19 Thread Evan Quan
9ed Signed-off-by: Evan Quan Signed-off-by: xinhui pan -- v1->v2: - move the changes to ->hw_fini() (James Zhu) --- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 24 drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 23 +++ 2 files changed, 47 insertions(

[PATCH] drm/amd/pm: a quick fix for "divided by zero" error

2021-08-20 Thread Evan Quan
Considering Arcturus is a dedicated ASIC for computing, it will be more proper to drop the support for fan speed reading and setting. That's on the TODO list. Change-Id: Id83a7a88f26644ba66c4fd15034b4fc861cc6901 Signed-off-by: Evan Quan Reported-by: Rui Teng --- .../gpu/drm/amd/pm/swsmu/

[PATCH 1/4] drm/amdgpu: correct clock/power gating sequence on UVD/VCE suspend/resume

2021-08-22 Thread Evan Quan
The clocks should be gated before power. And reverse sequence should be used on ungating. Change-Id: Iab09f1f616560ff1083b75e95bfc6433d05d7f98 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 8 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 8

[PATCH 2/4] drm/amdgpu: add missing cleanups for Polaris12 UVD/VCE on suspend

2021-08-22 Thread Evan Quan
9ed Signed-off-by: Evan Quan Signed-off-by: xinhui pan -- v1->v2: - move the changes to ->hw_fini() (James Zhu) v2->v3: - correct the sequence for clock/power gating (Lijo Lazar) --- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 24 drivers/gpu/drm/amd/amd

[PATCH 3/4] drm/amdgpu: add missing cleanups for more ASICs on UVD/VCE suspend

2021-08-22 Thread Evan Quan
This is a supplement for commit below: "drm/amdgpu: add missing cleanups for Polaris12 UVD/VCE on suspend". Change-Id: I7ff5692fd0c3e880ec8e55a7329469a67e5a1363 Signed-off-by: Evan Quan -- v1->v2: - correct the sequence for clock/power gating (Lijo Lazar) --- drivers/gpu/d

[PATCH 4/4] drm/amdgpu: drop redundant cancel_delayed_work_sync call

2021-08-22 Thread Evan Quan
As those _sw_fini() APIs follow just after _suspend() APIs. And the cancel_delayed_work_sync was already called in latter. Change-Id: I7f092e39242a1ffbc3c29e1fcd7bf31b769b0ef5 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 2 -- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c

[PATCH V2 2/3] drm/amdgpu: add missing cleanups for more ASICs on UVD/VCE suspend

2021-08-23 Thread Evan Quan
This is a supplement for commit below: "drm/amdgpu: add missing cleanups for Polaris12 UVD/VCE on suspend". Change-Id: I7ff5692fd0c3e880ec8e55a7329469a67e5a1363 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 24 drivers/gpu/drm/amd/amdgp

[PATCH V2 3/3] drm/amdgpu: drop redundant cancel_delayed_work_sync call

2021-08-23 Thread Evan Quan
As those _sw_fini() APIs follow just after _suspend() APIs. And the cancel_delayed_work_sync was already called in latter. Change-Id: I7f092e39242a1ffbc3c29e1fcd7bf31b769b0ef5 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 2 -- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c

[PATCH V2 1/3] drm/amdgpu: add missing cleanups for Polaris12 UVD/VCE on suspend

2021-08-23 Thread Evan Quan
9ed Signed-off-by: Evan Quan Signed-off-by: xinhui pan -- v1->v2: - move the changes to ->hw_fini() (James Zhu) --- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 24 drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 23 +++ 2 files changed, 47 insertions(

[PATCH] drm/amdgpu: reenable BACO support for 699F:C7 polaris12 SKU

2021-08-24 Thread Evan Quan
90abe6 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/vi.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c index 42a35d9520f9..fe9a7cc8d9eb 100644 --- a/drivers/gpu/drm/amd/amdgpu/vi.c +++ b/driver

[PATCH] drm/amdgpu: use generic fb helpers instead of setting up AMD own's.

2021-09-02 Thread Evan Quan
With the shadow buffer support from generic framebuffer emulation, it's possible now to have runpm kicked when no update for console. Change-Id: I285472c9100ee6f649d3f3f3548f402b9cd34eaf Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/Makefile | 2 +- drivers/gpu/dr

[PATCH] drm/amd/pm: fix runpm hang when amdgpu loaded prior to sound driver

2021-09-09 Thread Evan Quan
switching back to legacy message way on sound driver missing, we are able to fix the runpm hang observed for the scenario below: amdgpu driver loaded -> runpm suspend kicked -> sound driver loaded Change-Id: I0e44fef11349b5e45e6102913eb46c8c7d279c65 Signed-off-by: Evan Quan Reported-by: Pierr

[PATCH] drm/amdgpu: use generic fb helpers instead of setting up AMD own's.

2021-09-09 Thread Evan Quan
With the shadow buffer support from generic framebuffer emulation, it's possible now to have runpm kicked when no update for console. Change-Id: I285472c9100ee6f649d3f3f3548f402b9cd34eaf Signed-off-by: Evan Quan Acked-by: Christian König -- v1->v2: - rename amdgpu_align_

[PATCH] drm/amdgpu: fix Polaris12 uvd crash on driver unload

2021-10-11 Thread Evan Quan
This is a supplement for the change below: cdccf1ffe1a3 drm/amdgpu: Fix crash on device remove/driver unload Signed-off-by: Evan Quan Change-Id: Iedc25e2f572f04772511d56781b01b481e22fd00 --- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 24 +--- 1 file changed, 13 insertions

[PATCH] drm/amdgpu: fix the hang observed on Carrizo due to UVD suspend failure

2021-10-18 Thread Evan Quan
uring interaction with SMU for suspend scenario. Signed-off-by: Evan Quan Change-Id: I7804d3835aadbc7cf4b686da4994e8461748 --- .../powerplay/hwmgr/smu7_clockpowergating.c | 20 +-- .../drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c | 16 +-- drivers/gpu/drm/a

[PATCH] drm/amdgpu: correctly toggle gfx on/off around RLC_SPM_* register access

2021-11-03 Thread Evan Quan
with RDP launched in parallel. Signed-off-by: Evan Quan Change-Id: Ifae152e8151fecd25a238ebe87dffb3b17cdb540 --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 5 + drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 4 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 4 drivers/gpu/drm/amd/amdgpu/gfx_v9_0

[PATCH] drm/amdgpu: fix the Carrizo UVD hang on system reboot

2021-11-04 Thread Evan Quan
It's confirmed that on some APUs the interaction with SMU about DPM disablement will power off the UVD completely. Thus the succeeding interactions with UVD during the reboot will trigger hard hang. To workaround this issue, we will skip the dpm disablement on APUs. Signed-off-by: Evan

[PATCH] drm/amdgpu: fix uvd crash on Polaris12 during driver unloading

2021-11-04 Thread Evan Quan
There was a change(below) target for such issue: cdccf1ffe1a3 drm/amdgpu: Fix crash on device remove/driver unload But the fix for VI ASICs was missing there. This is a supplement for that. Signed-off-by: Evan Quan Change-Id: Iedc25e2f572f04772511d56781b01b481e22fd00 --- drivers/gpu/drm/amd

[PATCH] drm/amd/pm: avoid duplicate powergate/ungate setting

2021-11-07 Thread Evan Quan
Just bail out if the target IP block is already in the desired powergate/ungate state. This can avoid some duplicate settings which sometime may cause unexpected issues. Change-Id: I66346c69f121df0f5ee20182451313ae4fda2d04 Signed-off-by: Evan Quan Tested-by: Borislav Petkov --- drivers/gpu/drm

[PATCH] drm/amd/pm: avoid duplicate powergate/ungate setting

2021-11-10 Thread Evan Quan
-by: Evan Quan Tested-by: Borislav Petkov -- v1->v2: - typo fix and add link for the issue referred in commit message(Paul/Boris) - update the data type to uint32_t(Paul) - better Macro naming(Lijo) --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ drivers/gpu/drm/amd/incl

[PATCH V3] drm/amd/pm: avoid duplicate powergate/ungate setting

2021-11-14 Thread Evan Quan
-by: Evan Quan Tested-by: Borislav Petkov -- v1->v2: - typo fix and add link for the issue referred in commit message(Paul/Boris) - update the data type to uint32_t(Paul) - better Macro naming(Lijo) v2->v3: - stick to original logics on handling unmentioned IP blocks(Lijo) --- d

[PATCH] drm/amdgpu: update the domain flags for dumb buffer creation

2021-11-18 Thread Evan Quan
gpu: use generic fb helpers instead of setting up AMD own's.") Signed-off-by: Evan Quan Reviewed-by: Christian König Change-Id: I403bf7a0b265c564b5f3a3343999670e5eb87ca6 --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/d

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

2021-11-29 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 not

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

2021-11-29 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 Chan

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

2021-11-29 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 --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c

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

2021-11-29 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_

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

2021-11-29 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 V2 05/17] drm/amd/pm: do not expose those APIs used internally only in si_dpm.c

2021-11-29 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) --- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 25 --- drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 25 ---

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

2021-11-29 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 V2 07/17] drm/amd/pm: create a new holder for those APIs used only by legacy ASICs(si/kv)

2021-11-29 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: - move other APIs used by si/kv in amdgpu_atombios.c to the new holder a

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

2021-11-29 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 V2 09/17] drm/amd/pm: optimize the amdgpu_pm_compute_clocks() implementations

2021-11-29 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 V2 11/17] drm/amd/pm: correct the usage for amdgpu_dpm_dispatch_task()

2021-11-29 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 V2 10/17] drm/amd/pm: move those code piece used by Stoney only to smu8_hwmgr.c

2021-11-29 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 V2 12/17] drm/amd/pm: drop redundant or unused APIs and data structures

2021-11-29 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 V2 13/17] drm/amd/pm: do not expose the smu_context structure used internally in power

2021-11-29 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 --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 -- .../gpu/

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

2021-11-29 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 V2 15/17] drm/amd/pm: drop unnecessary gfxoff controls

2021-11-29 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 V2 16/17] drm/amd/pm: revise the performance level setting APIs

2021-11-29 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 V2 17/17] drm/amd/pm: unified lock protections in amdgpu_dpm.c

2021-11-29 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

[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 not

[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 Chan

[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

[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_

[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 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 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 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 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

[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 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 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 V4 01/17] drm/amd/pm: do not expose implementation details to other blocks out of power

2021-12-02 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 Chan

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

2021-12-02 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

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

2021-12-02 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_

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

2021-12-02 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 V4 06/17] drm/amd/pm: do not expose the API used internally only in kv_dpm.c

2021-12-02 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 V4 05/17] drm/amd/pm: do not expose those APIs used internally only in si_dpm.c

2021-12-02 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 V4 08/17] drm/amd/pm: move pp_force_state_enabled member to amdgpu_pm structure

2021-12-02 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 V4 07/17] drm/amd/pm: create a new holder for those APIs used only by legacy ASICs(si/kv)

2021-12-02 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) v2-

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

2021-12-02 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 V4 09/17] drm/amd/pm: optimize the amdgpu_pm_compute_clocks() implementations

2021-12-02 Thread Evan Quan
Drop cross callings and multi-function APIs. Also avoid exposing internal implementations details. Signed-off-by: Evan Quan Change-Id: I55e5ab3da6a70482f5f5d8c256eed2f754feae20 -- v1->v2: - add back the adev->pm.dpm_enabled check(Lijo) --- .../gpu/drm/amd/include/kgd_pp_interface.h

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

2021-12-02 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 V4 12/17] drm/amd/pm: drop redundant or unused APIs and data structures

2021-12-02 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 V4 13/17] drm/amd/pm: do not expose the smu_context structure used internally in power

2021-12-02 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 V4 15/17] drm/amd/pm: drop unnecessary gfxoff controls

2021-12-02 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 V4 14/17] drm/amd/pm: relocate the power related headers

2021-12-02 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 V4 17/17] drm/amd/pm: unified lock protections in amdgpu_dpm.c

2021-12-02 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

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

2021-12-02 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 0/7] Drop unneeded power related lock protections

2021-12-07 Thread Evan Quan
As a follow-up for previous cleanup, those redundant lock protections can be dropped now. As we already adopted an unified lock(adev->pm.mutex) in amdgpu_dpm.c. Evan Quan (7): drm/amd/pm: drop unneeded lock protection smu->mutex drm/amd/pm: drop unneeded vcn/jpeg_gate_lock drm/amd/pm

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

2021-12-07 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

2021-12-07 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

2021-12-07 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

2021-12-07 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

2021-12-07 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

2021-12-07 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

  1   2   3   4   5   6   7   8   9   10   >