[PATCH 10/14] drm/amd/powerplay: drop unnecessary Sienna Cichlid specific APIs

2020-07-03 Thread Evan Quan
As a common performance level setting API is used. Then these ASIC specific APIs are not needed any more. Change-Id: I04c810859794b07ce8905a8df797ed6b5ae116a8 Signed-off-by: Evan Quan --- .../drm/amd/powerplay/sienna_cichlid_ppt.c| 178 +- 1 file changed, 1 insertion(+), 177

[PATCH 01/14] drm/amd/powerplay: add more members for dpm table

2020-07-03 Thread Evan Quan
These members can help to cache the clock frequencies for all dpm levels. Then simplifying the code for dpm level switching is possible. Change-Id: Ic80359adb8c0e018f306782f24e3f8906436f5e2 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h | 15 +-- 1 file

[PATCH 09/14] drm/amd/powerplay: drop unnecessary Navi1x specific APIs

2020-07-03 Thread Evan Quan
As a common performance level setting API is used. Then these ASIC specific APIs are not needed any more. Change-Id: I2c8831b9d00618c6578ee42b34e26892c5dba515 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 248 + 1 file changed, 1 insertion(+), 247

[PATCH 04/14] drm/amd/powerplay: update Sienna Cichlid default dpm table setup

2020-07-03 Thread Evan Quan
Cache all clocks levels for every dpm table. They are needed by other APIs. Change-Id: Idaa853356720e48ab3279f420ba1ae18bb7de4fd Signed-off-by: Evan Quan --- .../drm/amd/powerplay/sienna_cichlid_ppt.c| 234 -- 1 file changed, 211 insertions(+), 23 deletions(-) diff --git

[PATCH 08/14] drm/amd/powerplay: drop unnecessary Arcturus specific APIs

2020-07-03 Thread Evan Quan
As a common performance level setting API is used. Then these ASIC specific APIs are not needed any more. Change-Id: Icd96ce42218d78d670dd0c1f88663fd42108b311 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 170 --- 1 file changed, 170 deletions

[PATCH 06/14] drm/amd/powerplay: update UMD pstate clock settings

2020-07-03 Thread Evan Quan
Preparing for coming code sharing around performance level setting. Change-Id: I51b1536b62995f0fecd51b91f238793f57485aa9 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 6 +- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 47 ++--- drivers/gpu/drm/amd

[PATCH 03/14] drm/amd/powerplay: update Navi10 default dpm table setup

2020-07-03 Thread Evan Quan
Cache all clocks levels for every dpm table. They are needed by other APIs. Change-Id: I8114cf31e6ec8c9af4578d51749eb213befdcc71 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 182 ++--- 1 file changed, 158 insertions(+), 24 deletions(-) diff --git

[PATCH 05/14] drm/amd/powerplay: add new UMD pstate data structure

2020-07-03 Thread Evan Quan
This is used to cache the clock frequencies for all UMD pstates. So that we do not need to calculate from scratch on every UMD pstate switch. Change-Id: I3f2ef5ee2e6e433518f726988bbe5970848b99c8 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 15 +++ 1

[PATCH 02/14] drm/amd/powerplay: update Arcturus default dpm table setting

2020-07-03 Thread Evan Quan
Preparing for coming code sharing around performance level setting. Change-Id: Ie32b6af39f22d05c08096959bab0e02e53856170 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 297 +++--- drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h | 4 + drivers/gpu/drm

[PATCH 14/14] drm/amd/powerplay: drop unused APIs and parameters

2020-07-03 Thread Evan Quan
Leftover of previous performance level setting cleanups. Change-Id: Idddc4adce365b34eacbc13f75cc0629859c6d412 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 12 ++-- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 9 +++-- drivers/gpu/drm/amd

[PATCH 13/14] drm/amd/powerplay: drop smu_v12_0.c unnecessary wrapper

2020-07-03 Thread Evan Quan
By moving the implemention to renoir_ppt.c considering it's really ASIC specific. Change-Id: I6f7a594235dffdf75b56d1de5b9dc6d49833d7e8 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 3 - drivers/gpu/drm/amd/powerplay/renoir_ppt.c| 172

[PATCH 07/14] drm/amd/powerplay: update the common API for performance level setting

2020-07-03 Thread Evan Quan
So that it can be more widely shared around SMU v11 ASICs. Change-Id: Ie110edf2ec519699448d3ff3215188ba243d2415 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 91 +++ 1 file changed, 77 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 12/14] drm/amd/powerplay: drop unnecessary wrappers

2020-07-03 Thread Evan Quan
By calling the target APIs directly. Change-Id: I0f24f603d2fcb94d2078a35c405a1406093ba5e3 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay

[PATCH 3/6] drm/amd/powerplay: cache the software_shutdown_temp

2020-07-03 Thread Evan Quan
As it's needed in the succeeding thermal irq setting. Change-Id: Iee34fb6515a88a684c7f1214e40edb7e65245f8d Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 4 drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 1 + drivers/gpu/drm/amd/powerplay

[PATCH 6/6] drm/amd/powerplay: drop unused code around thermal range setting

2020-07-03 Thread Evan Quan
Leftover of previous cleanups. Change-Id: I36a018349647125513e47edda66db2005bd8b0c5 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 32 --- .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h| 2 -- drivers/gpu/drm/amd/powerplay/navi10_ppt.c| 32

[PATCH 5/6] drm/amd/powerplay: maximum the code sharing on thermal irq setting

2020-07-03 Thread Evan Quan
Put the common code in smu_v11_0.c instead of having one copy each. Change-Id: I6d0c27c5810ebc3273ef8b4fae07ac6dbed2715c Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 2/6] drm/amd/powerplay: correct Sienna Cichlid temperature limit settings

2020-07-03 Thread Evan Quan
These are needed for temp1/2/3 related hwmon interfaces. Change-Id: I76ec427aaae67a0dd257e2b1d7908990eb79a5b2 Signed-off-by: Evan Quan --- .../gpu/drm/amd/powerplay/sienna_cichlid_ppt.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd

[PATCH 2/4] drm/amd/powerplay: bypass wrapper on retrieving current clock frequency

2020-07-02 Thread Evan Quan
By calling the target API(asic specific) directly. Change-Id: I711a57f46cd471928b7700b3a651ebfee9bf8206 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 363 +- drivers/gpu/drm/amd/powerplay/navi10_ppt.c| 5 +- .../drm/amd/powerplay

[PATCH 3/4] drm/amd/powerplay: unshare the code for retrieving current clock frequency

2020-07-02 Thread Evan Quan
By moving them into asic specific file. Since they are really ASIC specific. Change-Id: I932369d5c2033ab8567d26bebcac053a500227f0 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 11 +++ drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 10

[PATCH 4/4] drm/amd/powerplay: drop unused code and wrapper around clock retrieving

2020-07-02 Thread Evan Quan
Clean code by dropping unnecessary ones. Change-Id: Idf89ef6fa787b61cd8baf8ded7e3f323bdcef189 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 8 +++- .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h| 3 -- drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h | 8

[PATCH 1/4] drm/amd/powerplay: drop unnecessary wrappers around clock retrieving

2020-07-02 Thread Evan Quan
By calling the target APIs directly. Change-Id: Ic1c92f26f7aeab334632a26bf75c3e232d1db0e1 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 9 - drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 1 - drivers/gpu/drm/amd/powerplay/navi10_ppt.c

[PATCH 4/4] drm/amd/powerplay: put dpm frequency setting common code in smu_v11_0.c

2020-07-02 Thread Evan Quan
As designed the common code shared among all smu v11 ASCIs go to smu_v11_0.c. This helps to maintain clear code layers. Change-Id: I1f848eba0b6b56f8b5ef6f0888ee6955ba1d2070 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 65 -- .../gpu/drm/amd/powerplay

[PATCH 3/4] drm/amd/powerplay: revise calling chain on retrieving frequency range

2020-07-02 Thread Evan Quan
This helps to maintain clear code layers and drop unnecessary parameter. Change-Id: I2250a014759a0c855e476bbfa9642c1efc47ae26 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 6 +-- drivers/gpu/drm/amd/powerplay

[PATCH 1/4] drm/amd/powerplay: put setting hard limit common code in smu_v11_0.c

2020-07-02 Thread Evan Quan
As designed the common code shared among all smu v11 ASCIs go to smu_v11_0.c. This helps to maintain clear code layers. Change-Id: Ib5bd4b40702f1442a4b094d927aa5fc101b960c5 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 36 - .../gpu/drm/amd

[PATCH 2/4] drm/amd/powerplay: revise calling chain on setting soft limit

2020-07-02 Thread Evan Quan
This helps to maintain clear code layers and drop unnecessary parameter. Change-Id: I2d27547414d964552d0515e76e165d34c8ce0132 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 +- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 20 + .../gpu/drm/amd

[PATCH 06/16] drm/amd/powerplay: add new UMD pstate data structure

2020-07-09 Thread Evan Quan
This is used to cache the clock frequencies for all UMD pstates. So that we do not need to calculate from scratch on every UMD pstate switch. Change-Id: I3f2ef5ee2e6e433518f726988bbe5970848b99c8 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/inc

[PATCH 09/16] drm/amd/powerplay: drop unnecessary Arcturus specific APIs

2020-07-09 Thread Evan Quan
As a common performance level setting API is used. Then these ASIC specific APIs are not needed any more. Change-Id: Icd96ce42218d78d670dd0c1f88663fd42108b311 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 170 --- 1 file

[PATCH 01/16] drm/amd/powerplay: add more members for dpm table

2020-07-09 Thread Evan Quan
These members can help to cache the clock frequencies for all dpm levels. Then simplifying the code for dpm level switching is possible. Change-Id: Ic80359adb8c0e018f306782f24e3f8906436f5e2 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h

[PATCH 16/16] drm/amd/powerplay: drop unused APIs and parameters

2020-07-09 Thread Evan Quan
Leftover of previous performance level setting cleanups. Change-Id: Idddc4adce365b34eacbc13f75cc0629859c6d412 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 12 ++-- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 9

[PATCH 11/16] drm/amd/powerplay: drop unnecessary Sienna Cichlid specific APIs

2020-07-09 Thread Evan Quan
As a common performance level setting API is used. Then these ASIC specific APIs are not needed any more. Change-Id: I04c810859794b07ce8905a8df797ed6b5ae116a8 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- .../drm/amd/powerplay/sienna_cichlid_ppt.c| 178 +- 1 file

[PATCH 07/16] drm/amd/powerplay: update UMD pstate clock settings

2020-07-09 Thread Evan Quan
Preparing for coming code sharing around performance level setting. Change-Id: I51b1536b62995f0fecd51b91f238793f57485aa9 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 6 +- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 47

[PATCH 02/16] drm/amd/powerplay: implement a common set dpm table API for smu V11

2020-07-09 Thread Evan Quan
Maximum the code sharing around smu V11. Change-Id: Ice0a874f3f70457f1012ca566f9f784ff3e9cd94 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h | 4 ++ drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 38 +++ 2 files changed, 42 insertions(+) diff --git

[PATCH 05/16] drm/amd/powerplay: update Sienna Cichlid default dpm table setup

2020-07-09 Thread Evan Quan
Cache all clocks levels for every dpm table. They are needed by other APIs. Change-Id: Idaa853356720e48ab3279f420ba1ae18bb7de4fd Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- .../drm/amd/powerplay/sienna_cichlid_ppt.c| 234 -- 1 file changed, 211 insertions(+), 23

[PATCH 12/16] drm/amd/powerplay: drop Sienna Cichlid specific set_soft_freq_limited_range

2020-07-09 Thread Evan Quan
Use the common smu_v11_0_set_soft_freq_limited_range. Change-Id: I9f8772880b324ce9e741291751bb1b8ff4c36ea3 Signed-off-by: Evan Quan --- .../drm/amd/powerplay/sienna_cichlid_ppt.c| 20 ++- drivers/gpu/drm/amd/powerplay/smu_internal.h | 1 - drivers/gpu/drm/amd/powerplay

[PATCH 13/16] drm/amd/powerplay: apply gfxoff disablement/enablement for all SMU11 ASICs

2020-07-09 Thread Evan Quan
Before and after setting gfx clock soft max/min frequency. Change-Id: I6f828da8de096ebc0ae27eaa89f988def2d547ec Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay

[PATCH 14/16] drm/amd/powerplay: drop unnecessary wrappers

2020-07-09 Thread Evan Quan
By calling the target APIs directly. Change-Id: I0f24f603d2fcb94d2078a35c405a1406093ba5e3 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/gpu

[PATCH 15/16] drm/amd/powerplay: drop smu_v12_0.c unnecessary wrapper

2020-07-09 Thread Evan Quan
By moving the implemention to renoir_ppt.c considering it's really ASIC specific. Change-Id: I6f7a594235dffdf75b56d1de5b9dc6d49833d7e8 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 3 - drivers/gpu/drm/amd/powerplay/renoir_ppt.c

[PATCH 10/16] drm/amd/powerplay: drop unnecessary Navi1x specific APIs

2020-07-09 Thread Evan Quan
As a common performance level setting API is used. Then these ASIC specific APIs are not needed any more. Change-Id: I2c8831b9d00618c6578ee42b34e26892c5dba515 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 248 + 1 file

[PATCH 08/16] drm/amd/powerplay: update the common API for performance level setting

2020-07-09 Thread Evan Quan
So that it can be more widely shared around SMU v11 ASICs. Change-Id: Ie110edf2ec519699448d3ff3215188ba243d2415 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 91 +++ 1 file changed, 77 insertions(+), 14 deletions(-) diff

[PATCH 03/16] drm/amd/powerplay: update Arcturus default dpm table setting

2020-07-09 Thread Evan Quan
Preparing for coming code sharing around performance level setting. Change-Id: Iaa77af7a272121503f09ad5fbfbe9dff2d2597b1 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 297 --- 1 file changed, 119 insertions(+), 178 deletions(-) diff --git a/drivers

[PATCH 04/16] drm/amd/powerplay: update Navi10 default dpm table setup

2020-07-09 Thread Evan Quan
Cache all clocks levels for every dpm table. They are needed by other APIs. Change-Id: I8114cf31e6ec8c9af4578d51749eb213befdcc71 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 182 ++--- 1 file changed, 158 insertions(+), 24

[PATCH] drm/amd/powerplay: drop unnecessary "@" on OD sysfs output

2020-06-16 Thread Evan Quan
To follow conventional style. And this unnecessary "@" confuses our userspace tool. Change-Id: Id4cdc611d63e800cf5a93449b6331a1e8323e727 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drive

[PATCH] drm/amd/powerplay: declare driver if version mismatch as "warning" explicitly

2020-06-17 Thread Evan Quan
So that user knows it's just a warning and can be safely ignored. Change-Id: Ic518ec3eb68c6bd6682e6131e32cfe90843341ff Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay

[PATCH] drm/amd/powerplay: fix compile error with ARCH=arc

2020-06-28 Thread Evan Quan
test robot Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c index 677f8adb920c..48e15885e9c3 100644 --- a/drivers

[PATCH 2/7] drm/amd/powerplay: maximize code sharing around power limit

2020-06-08 Thread Evan Quan
Also cache the current and max power limits. Change-Id: Ida2ce964736bee2e558522441d3505f84c4e00f4 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 49 - .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h| 2 + drivers/gpu/drm/amd/powerplay/inc/smu_v11_0

[PATCH 6/7] drm/amd/powerplay: correct power limit retrieving based on current power source

2020-06-08 Thread Evan Quan
Instead of hard coding it as SMU_POWER_SOURCE_AC. Change-Id: I57066b2c206f8e1e2276f959ff2704dcbe6e5d77 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b

[PATCH 1/7] drm/amd/powerplay: drop unnecessary get_pptable_power_limit wrappers

2020-06-08 Thread Evan Quan
Minor code cleanup. Change-Id: I56a56ebe4a86e7fca5de02d41928f533dda4d185 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 10 -- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 3 +-- drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 3

[PATCH 3/7] drm/amd/powerplay: simplify the code around retrieving power limit

2020-06-08 Thread Evan Quan
Use the cached max/current power limit for other cases except .late_init. Change-Id: Ia4c063207faf051db27be1956f40554913c31c3b Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 7 +++ drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 6 +- drivers/gpu

[PATCH 5/7] drm/amd/powerplay: drop unused code around power limit

2020-06-08 Thread Evan Quan
Drop unused APIs, variables and argument. Change-Id: I59c99de30bf3fa0e5ed058aaa8ab95d0a9c748aa Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c| 4 +-- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 20 --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 35

[PATCH 4/7] drm/amd/powerplay: simplify the code around setting power limit

2020-06-08 Thread Evan Quan
Use the cached max/current power limit and move the input check to the top layer. Change-Id: Iefc7a89b871ce20422c2e70b8cd7ac85a0a7beba Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 11 +++ drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 16 ++-- 2

[PATCH 7/7] drm/amd/powerplay: add check for power limit OD support

2020-06-08 Thread Evan Quan
Before counting the OD percent into max power limit margin. Change-Id: I83b24d614e07fbc5eac41ff7cd668a1c2f33c6b2 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay

[PATCH] drm/amd/powerplay: move maximum sustainable clock retrieving to .hw_init

2020-06-08 Thread Evan Quan
Since DAL settings come between .hw_init and .late_init of SMU. And DAL needs to know the maximum sustainable clocks. Change-Id: I0702b7332a0d7c0b29dfdf4999c18efb588b8862 Signed-off-by: Evan Quan Reported-by: Flora Cui --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 19 +-- 1

[PATCH 3/4] drm/amd/powerplay: update how to use metrics table on Sienna Cichlid

2020-06-05 Thread Evan Quan
Retrieve only those data interested instead of the whole table. Change-Id: I6008351209be3b8812c547043a532e5fb90dd980 Signed-off-by: Evan Quan --- .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h| 3 + .../drm/amd/powerplay/sienna_cichlid_ppt.c| 197 +- 2 files changed, 146

[PATCH 1/4] drm/amd/powerplay: update how to use metrics table on Arcturus

2020-06-05 Thread Evan Quan
Retrieve only those interested metrics data instead of the whole metrics table. By this, the memory copy can be dropped. Change-Id: Ice2b2ba4647301119130be0ba65bb587f19d38ae Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 213 -- .../gpu/drm/amd

[PATCH 2/4] drm/amd/powerplay: update how to use metrics table on Navi10

2020-06-05 Thread Evan Quan
Retrieve only those data interested instead of the whole table. Change-Id: I78a3ecce1075e73b96c2ee0b13aacc469bb09021 Signed-off-by: Evan Quan --- .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h| 1 + drivers/gpu/drm/amd/powerplay/navi10_ppt.c| 180 -- 2 files changed, 127

[PATCH 4/4] drm/amd/powerplay: use the same interval as PMFW on retrieving metrics table

2020-06-05 Thread Evan Quan
Current 100ms interval makes no sense. User gets outdated data due to this. Change-Id: Ie1d950285460443d493f1647463b68cbe4a5ec67 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 2 +- drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c | 2 +- 2 files changed, 2

[PATCH 2/3] drm/amd/powerplay: drop unnecessary wrappers

2020-06-05 Thread Evan Quan
These APIs are used in amdgpu_smu.c only. Thus these wrappers are unnecessary. Change-Id: I7768a84e3a7dfbbfa624ac97d94138de52402827 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 24 drivers/gpu/drm/amd/powerplay/smu_internal.h | 3 --- 2 files

[PATCH 3/3] drm/amd/powerplay: correct the APIs' naming

2020-06-05 Thread Evan Quan
'UVD' is a HW engine name for Vega20 and before ASICs. For newer ASICs, the similar engine is named as 'VCN'. Change-Id: I5f1b9500ed5d35e395a5da32b81a78eb87bffc68 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 13 + drivers/gpu/drm/amd/powerplay

[PATCH 1/3] drm/amd/powerplay: drop dead vce powergate code

2020-06-05 Thread Evan Quan
This was for Vega20. However Vega20 support is already dropped from current swSMU. Change-Id: I5400496dff2e338de4622823484b88cda6018ec1 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 6 ++ drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 1 - drivers/gpu/drm

[PATCH 3/3] drm/amd/powerplay: add error messages on some critical paths

2020-06-05 Thread Evan Quan
Helpful for error diagnostic. Change-Id: I983ca308a2ee6ed11e16ec59ad97040d98b90512 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 118 +++-- 1 file changed, 87 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b

[PATCH 2/3] drm/amd/powerplay: forbid to use pr_err/warn/info/debug

2020-06-05 Thread Evan Quan
Use dev_err/warn/info/dbg instead. They are more MGPU friendly. Change-Id: I07ad32c11dcf86cb1e3d1da1afa449f1f7dbd645 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 10 ++ drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 10 ++ drivers/gpu

[PATCH 06/16] drm/amd/powerplay: clean up the APIs for pptable setup

2020-06-03 Thread Evan Quan
Combine and simplify the logics for setup pptable. Change-Id: I062f15eab586050593afd960432c4c70fbdd5d41 Signed-off-by: Evan Quan Acked-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 17 drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 66 - .../gpu/drm/amd

[PATCH 07/16] drm/amd/powerplay: clean up the overdrive settings

2020-06-03 Thread Evan Quan
Eliminate the buffer allocation and drop the unnecessary overdrive table uploading. Change-Id: I8ba5383a330e6d5355cea219147500c1b4a43f47 Signed-off-by: Evan Quan Acked-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 2 +- .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h| 2

[PATCH 13/16] drm/amd/powerplay: max code sharing between .hw_fini and .suspend

2020-06-03 Thread Evan Quan
Thus redundant code can be dropped. Change-Id: I672f84ed5856da53b7f8f915b2f24ca11cd4b228 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 44 +++--- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay

[PATCH 04/16] drm/amd/powerplay: centralize all buffer allocation in sw_init phase

2020-06-03 Thread Evan Quan
To fit common design. And this can simplify the buffer deallocation. Change-Id: Iee682e76aadb5f34861d69d5794ced44f0a78789 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 342 ++--- drivers/gpu/drm/amd/powerplay/smu_v11_0.c

[PATCH 10/16] drm/amd/powerplay: max code sharing between .hw_init and .resume

2020-06-03 Thread Evan Quan
Then redundant code can be dropped. Change-Id: Icbafbb7ffc8189a09f4236786aea6702ee73f9f4 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 42 ++ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay

[PATCH 12/16] drm/amd/powerplay: better namings

2020-06-03 Thread Evan Quan
And some minor changes as dropping unused parameter and label internal used API as static. Change-Id: I0af0aea029dc4fc7d8e150ab6ec984e9a5f1a74a Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 12 +--- drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 2

[PATCH 05/16] drm/amd/powerplay: clean up the APIs for bootup clocks

2020-06-03 Thread Evan Quan
Combine and simplify the logics for retrieving bootup clocks. Change-Id: Ifca28c454f3769dece0cc705ba054ff34db0ab60 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 4 - drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 1 - .../gpu/drm

[PATCH 08/16] drm/amd/powerplay: postpone operations not must for hw setup to late_init

2020-06-03 Thread Evan Quan
So that we do not need to perform those unnecessary operations again on resume. Change-Id: I90f8a8d68762b5f88d7477934128a17bf67e3341 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 57 +++--- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git

[PATCH 16/16] drm/amd/powerplay: skip BACO feature on DPMs disablement

2020-06-03 Thread Evan Quan
Instead of disabling and reenabling it later. Change-Id: I90775202178f3b7695f42f39ce240bbfd51a1346 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 72 ++ 1 file changed, 31 insertions(+), 41 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay

[PATCH 15/16] drm/amd/powerplay: add firmware cleanup on sw_fini

2020-06-03 Thread Evan Quan
To avoid possible memory leak. Change-Id: I4740eac7fc2c6e934ec8f503e5a98057f0902f4a Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 ++ drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 1 + drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h

[PATCH 14/16] drm/amd/powerplay: allocate the struct amdgpu_irq_src on the stack

2020-06-03 Thread Evan Quan
Since it is only several bytes in size. Change-Id: Ie9df0db543fdd4cf5b963a286ef40dee03c436bf Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 --- drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 2 +- drivers/gpu/drm/amd/powerplay

[PATCH 11/16] drm/amd/powerplay: resort those operations performed in hw setup

2020-06-03 Thread Evan Quan
Those common operations(for all ASICs) are placed first and followed by ASIC specific ones. While the display related are placed at the last. Change-Id: Id45caee98273c8c0b9c1c9f2713fcf8106e02000 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 61

[PATCH 01/16] drm/amd/powerplay: eliminate asic type check

2020-06-03 Thread Evan Quan
By moving ASIC specific code into its own file. Change-Id: Ib6775c1c8c5211ea45db6c3fb604a8279411ab37 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 59 +++ drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 8 +-- drivers/gpu/drm/amd/powerplay

[PATCH 03/16] drm/amd/powerplay: implement a common API for dpms disablement

2020-06-03 Thread Evan Quan
So that code can be shared between .hw_fini and .suspend. Change-Id: I4a0eeb7cdecbf5b24fac3d0fe1d8fcb1ca9f0b0a Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 178 + 1 file changed, 77 insertions(+), 101 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 09/16] drm/amd/powerplay: move those operations not needed for resume out

2020-06-03 Thread Evan Quan
Since smu_smc_table_hw_init() is needed for both .hw_init and .resume. By doing this, we can drop unnecessary operations on resume. Change-Id: I2af6277efaa9adba2de69161e20e54c4aa10a411 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 40 +++--- 1 file

[PATCH 02/16] drm/amd/powerplay: drop unused APIs and unnecessary checks

2020-06-03 Thread Evan Quan
Minor code cleanups. Change-Id: I6d240241e78cae17288c1d49dbae6ab1796b1128 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 74 --- .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h| 2 - 2 files changed, 16 insertions(+), 60 deletions(-) diff --git

[PATCH] drm/amd/powerplay: use work queue to perform throttling logging

2020-06-02 Thread Evan Quan
As IO operations(access to SMU internals) and possible sleep are involved in throttling logging. Workqueue can handle them well. Otherwise we may hit "scheduling while atomic" error. Change-Id: I454d593e965e54b13fdf04c112abb0a022204278 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd

[PATCH 1/2] drm/amd/powerplay: drop redundant .set_min_dcefclk_deep_sleep API

2020-06-09 Thread Evan Quan
It has exactly the same functionality as .set_deep_sleep_dcefclk. Change-Id: Ib4d2d604ca014e194cb2b61ac770e4370ecad74d Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 11 +-- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 3 +-- drivers/gpu/drm

[PATCH 2/2] drm/amd/powerplay: drop unnecessary wrapper .populate_smc_tables

2020-06-09 Thread Evan Quan
Since .populate_smc_tables is just a wrapper of .set_default_dpm_table. Change-Id: I80e89146359d6cf5d80f1887878d371b41b41cb0 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 1 - drivers/gpu/drm/amd

[PATCH 2/3] drm/amd/powerplay: revise the calling chain on sensor reading

2020-06-09 Thread Evan Quan
milar changes will be coming. Change-Id: I95beba6c117b0cd3b0acea6158bf62240c6eac5a Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c| 81 --- .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h| 2 - drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 2 +- drivers/gpu/drm/amd/powerplay/

[PATCH 3/3] drm/amd/powerplay: maximum code sharing on sensor reading

2020-06-09 Thread Evan Quan
Move the common code to amdgpu_smu.c instead of having one copy in both smu_v11_0.c and smu_v12_0.c. Change-Id: Idc59c6f686139d034348a613f1a7b9213198312d Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 4 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 4

[PATCH 1/3] drm/amd/powerplay: drop unnecessary SMU_MSG_GetDpmClockFreq check

2020-06-09 Thread Evan Quan
Since SMU_MSG_GetDpmClockFreq is known to be supported for Vega20 and before ASICs only. For those ASICs supporting swSMU, it is not supported. Change-Id: I8ee71664baa32e40df5bb793550785120f3770c6 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 17 +++-- 1

[PATCH] drm/amd/powerplay: widely share the API for data table retrieving

2020-07-15 Thread Evan Quan
Considering the data table retrieving can be more widely shared, amdgpu_atombios.c is the right place. Change-Id: Id89476c14709b5676bbf043371a27f27b94a58ed Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c| 17 + drivers/gpu/drm/amd/amdgpu

[PATCH 05/17] drm/amd/powerplay: update the data structure for NV12 SmuMetrics

2020-07-30 Thread Evan Quan
Although it does not bring any problem for now, the coming gpu metrics interface needs to handle them differently based on the asic type. Change-Id: I88ee78c26795267588f944d4f1983e4dbf23ba85 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- .../powerplay/inc/smu11_driver_if_navi10.h

[PATCH 04/17] drm/amd/powerplay: add Arcturus support for gpu metrics export

2020-07-30 Thread Evan Quan
Add Arcturus gpu metrics export interface. Change-Id: I372337f31e2b7174d41fb4e3af180deb94b5ec06 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 92 +++ .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h| 3 + drivers/gpu/drm

[PATCH 01/17] drm/amd/powerplay: define an universal data structure for gpu metrics (V4)

2020-07-30 Thread Evan Quan
Thus we can provide an interface for UMD to retrieve gpu metrics data. V2: better naming and comments V3: two structures created for dGPU and APU separately V4: add driver attached timestamp Change-Id: Ibc2d5c642eff732c082f8447348749a44dc35be3 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher

[PATCH 07/17] drm/amd/powerplay: add Sienna Cichlid support for gpu metrics export

2020-07-30 Thread Evan Quan
Add Sienna Cichlid gpu metrics export interface. Change-Id: I89e6a4415fe467e7e4aaabe07d9e8cee379caa25 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- .../drm/amd/powerplay/sienna_cichlid_ppt.c| 91 ++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git

[PATCH 02/17] drm/amd/powerplay: add new sysfs interface for retrieving gpu metrics(V2)

2020-07-30 Thread Evan Quan
A new interface for UMD to retrieve gpu metrics data. V2: rich the documentation Change-Id: If7f3523915505c0ece0a56dfd476d2b8473440d4 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- Documentation/gpu/amdgpu.rst | 6 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h

[PATCH 14/17] drm/amd/powerplay: add control method to bypass metrics cache on Sienna Cichlid

2020-07-30 Thread Evan Quan
As for the gpu metric export, metrics cache makes no sense. It's up to user to decide how often the metrics should be retrieved. Change-Id: Ic9d5f10b470584c82d4ca9035ab27fed44f0ac20 Signed-off-by: Evan Quan --- .../drm/amd/powerplay/sienna_cichlid_ppt.c| 73 +-- 1 file

[PATCH 12/17] drm/amd/powerplay: add control method to bypass metrics cache on Arcturus

2020-07-30 Thread Evan Quan
As for the gpu metric export, metrics cache makes no sense. It's up to user to decide how often the metrics should be retrieved. Change-Id: Ie6e9377f5984c3c09737b323c52249f9189bcaf5 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 74 +--- 1 file

[PATCH 08/17] drm/amd/powerplay: add Renoir support for gpu metrics export(V2)

2020-07-30 Thread Evan Quan
Add Renoir gpu metrics export interface. V2: use memcpy to make code more compact Change-Id: Ic83265536eeaa9e458dc395b2be18ea49da4c68a Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h | 2 + drivers/gpu/drm/amd/powerplay/renoir_ppt.c

[PATCH 06/17] drm/amd/powerplay: add Navi1x support for gpu metrics export

2020-07-30 Thread Evan Quan
Add Navi1x gpu metrics export interface. Change-Id: I9028fb925e70c36fb2a0b00968c462c0bbc822db Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 93 +- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 10/17] drm/amd/powerplay: add Vega20 support for gpu metrics export

2020-07-30 Thread Evan Quan
Add Vega20 gpu metrics export interface. Change-Id: I7b4ab850358cc6d7455889d9031a7111cba35ebd Signed-off-by: Evan Quan --- .../drm/amd/powerplay/hwmgr/vega20_hwmgr.c| 123 +- .../drm/amd/powerplay/hwmgr/vega20_hwmgr.h| 1 + 2 files changed, 117 insertions(+), 7

[PATCH 11/17] drm/amd/powerplay: add Vega12 support for gpu metrics export

2020-07-30 Thread Evan Quan
Add Vega12 gpu metrics export interface. Change-Id: I2c910f523049f0f90eecb8d74cb73ebb39a22bd9 Signed-off-by: Evan Quan --- .../drm/amd/powerplay/hwmgr/vega12_hwmgr.c| 111 ++ .../drm/amd/powerplay/hwmgr/vega12_hwmgr.h| 1 + 2 files changed, 112 insertions(+) diff

[PATCH 03/17] drm/amd/powerplay: implement SMU V11 common APIs for retrieving link speed/width

2020-07-30 Thread Evan Quan
This will be shared around all SMU V11 asics. Change-Id: Iaa4554fb0e011b9f565d89375ac7b6a7eb525420 Signed-off-by: Evan Quan Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h | 8 +++ drivers/gpu/drm/amd/powerplay/navi10_ppt.c| 9 +--- drivers/gpu/drm/amd

[PATCH 16/17] drm/amd/powerplay: add control method to bypass metrics cache on Vega20

2020-07-30 Thread Evan Quan
As for the gpu metric export, metrics cache makes no sense. It's up to user to decide how often the metrics should be retrieved. Change-Id: I8836f7f096dceb08a90dd3c899d2e9ccea1ef1f3 Signed-off-by: Evan Quan --- .../drm/amd/powerplay/hwmgr/vega20_hwmgr.c| 31 --- 1 file

[PATCH 13/17] drm/amd/powerplay: add control method to bypass metrics cache on Navi10

2020-07-30 Thread Evan Quan
As for the gpu metric export, metrics cache makes no sense. It's up to user to decide how often the metrics should be retrieved. Change-Id: I281b4de9262b98f0c52131feb39ba9e101b548b7 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 60 ++ 1 file

[PATCH 15/17] drm/amd/powerplay: add control method to bypass metrics cache on Renoir

2020-07-30 Thread Evan Quan
As for the gpu metric export, metrics cache makes no sense. It's up to user to decide how often the metrics should be retrieved. Change-Id: I780aba0be35a35bd9c9727118b33625e7cc9bf1f Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 22 ++ 1 file

[PATCH 17/17] drm/amd/powerplay: add control method to bypass metrics cache on Vega12

2020-07-30 Thread Evan Quan
As for the gpu metric export, metrics cache makes no sense. It's up to user to decide how often the metrics should be retrieved. Change-Id: Ic2a27ebc90f0a7cf581d0697c121b6d7df030f3b Signed-off-by: Evan Quan --- .../drm/amd/powerplay/hwmgr/vega12_hwmgr.c| 29 --- 1 file

<    2   3   4   5   6   7   8   9   10   11   >