Rex Zhu
4efe9b4794
drm/amd/pp: Refine code shorten variable name
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:16 -05:00
Rex Zhu
9bd2bae13d
drm/amd/pp: Add a helper to convert VID to voltage value
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:15 -05:00
Evan Quan
10cd19c877
drm/amd/powerplay: use ffs/fls instead of implementing our own
...
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:09 -05:00
Evan Quan
31a47dcab8
drm/amd/powerplay: export the thermal ranges of Carrizo (V2)
...
V2: reuse the SMUThermal structure defined in pp_thermal.h
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:09 -05:00
Evan Quan
4ba082572a
drm/amd/powerplay: export the thermal ranges of VI asics (V2)
...
V2: move the SMU7Thermal structure to newly created header file
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:08 -05:00
Evan Quan
0a91ee0775
drm/amd/powerplay: export vega10 specific thermal ranges (V2)
...
V2: new header file to hold the common SMU7Thermal structure
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:08 -05:00
Alex Deucher
77f208d91b
drm/amd/powerplay: export thermal range through temp sysfs
...
Populate the hwmon temp range as part of thermal controller setup.
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:07 -05:00
Evan Quan
80cfd1db67
drm/amd/powerplay: new hw manager interface for retrieving device specific thermal range
...
Added a new callback for asic specific backends to specify the temperature ranges.
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:07 -05:00
Evan Quan
4ad9d4dd65
drm/amd/powerplay: correct PP_TemperatureRange member type since negative values are part of the valid range
...
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:05 -05:00
Evan Quan
39199b803b
drm/amd/powerplay: removed hwmgr_handle_task unused parameter and given a better name for
...
other parameter
Signed-off-by: Evan Quan <evan.quan@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:05 -05:00
Evan Quan
8053e976cf
drm/amd/powerplay: remove unused parameter of phm_start_thermal_controller (v2)
...
Unused.
v2: squash in warning fix (Harry)
Signed-off-by: Evan Quan <evan.quan@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:04 -05:00
Julia Lawall
1446413f21
drm/amd/powerplay: drop unneeded newline
...
PP_ASSERT_WITH_CODE prints a newline at the end of the message string,
so the message string does not need to include a newline explicitly.
Done using Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-02-19 14:17:03 -05:00
Andrey Grodzovsky
adab595d16
drm/amd/powerplay: Fix smu_table_entry.handle type
...
The handle describes kernel logical address, should be
unsigned long and not uint32_t.
Fixes KASAN error and GFP on driver unload.
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2018-01-18 16:10:36 -05:00
Rex Zhu
ad8cec7df5
drm/amd/pp: Implement get_max_high_clocks for CI/VI
...
v2: add table length check.
DC component expect PP to give max engine clock and
memory clock through pp_get_display_mode_validation_clocks
on DGPU as well.
This patch can fix MultiGPU-Display blank
out with 1 IGPU-4k display and 2 DGPU-two 4K
displays.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-01-10 15:44:55 -05:00
Evan Quan
4dbda35ffa
drm/amd/powerplay: set pp_num_states as 0 on error situation
...
Signed-off-by: Evan Quan <evan.quan@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-01-10 15:44:52 -05:00
Yintian Tao
a25513e7b9
drm/amd/powerplay: fix memory leakage when reload (v2)
...
add smu_free_memory when smu fini to prevent memory leakage
v2: squash in typo fix (Yintian) and warning (Harry)
Signed-off-by: Yintian Tao <yttao@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-01-10 15:44:50 -05:00
Rex Zhu
873a7ea300
drm/amd/pp: Get and save CZ/ST smu version
...
The smu firmware is loaded by the sbios on APUs, so query it
from the smu and save the smu fw version info that is reported
to userspace.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-27 11:34:15 -05:00
Rex Zhu
923a50a686
drm/amd/pp: Implement force_dpm_level on Rv
...
user can change dpm level on Rv through sysfs
v3: add smu version check
v2: fix no return statement
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-20 11:59:40 -05:00
Rex Zhu
f49e9bac19
drm/amd/pp: Get and save Rv smu version
...
The smu firmware is loaded by the sbios on APUs, so query it
from the smu and save the smu fw version info that is reported
to userspace.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-20 11:59:21 -05:00
Rex Zhu
82eb0f3071
drm/amd/pp: update smu_version value for CI/VI
...
Set the new common smu firmware version for smu7 parts (CI and VI).
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-20 11:57:14 -05:00
Rex Zhu
d100033b2a
drm/amd/pp: Move smu_version to common code
...
Move the smu_version to struct hwmgr, so it can be shared
by other asics.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-20 11:56:48 -05:00
Rex Zhu
ea478d01ed
drm/amd/pp: export more smu message on Rv
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-19 12:11:58 -05:00
Rex Zhu
8621bbbbd3
drm/amd/pp: delete repeated call of force_dpm_level
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-19 12:11:58 -05:00
Rex Zhu
582dd5da5c
drm/amd/pp: implement phm_reset_power_profile_state
...
mv related code out of force_dpm_level to
phm_reset_power_profile_state
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-19 12:11:57 -05:00
Rex Zhu
29411f05c6
drm/amd/pp: delete dead code of arbiter overdriver clk
...
for sclk/mclk, can be adjusted through sysfs.
for uvd/vce clk, will be adjusted case by case when
requested.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-19 12:11:57 -05:00
Rex Zhu
ebe0dce655
drm/amd/pp: reset dpm level when adjust power state
...
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-14 10:23:02 -05:00
Rex Zhu
7364d60882
drm/amd/pp: implement dpm_get_sclk/mclk for RV
...
RV implementation was missing these callbacks. Used
to fetch the clock values for other components.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-13 17:31:01 -05:00
Alex Deucher
9ce6aae12c
drm/amdgpu: add license to files where it was missing
...
These files were missing it before.
Acked-by: Harry Wentland <harry.wentland@amd.com >
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-07 11:51:25 -05:00
Alex Deucher
1a09120f83
drm/amdgpu: add license to Makefiles
...
Was missing license text.
Acked-by: Harry Wentland <harry.wentland@amd.com >
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-07 11:51:10 -05:00
Feifei Xu
6b5b5fea3b
drm/amd/include:cleanup raven1 thm header files.
...
Cleanup asic_reg/raven1/THM folder.
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:26 -05:00
Feifei Xu
51199920a2
drm/amd/include:cleanup raven1 nbio header files.
...
Cleanup asic_reg/raven1/NBIO folder.
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:25 -05:00
Feifei Xu
a146391bbb
drm/amd/include:cleanup raven1 mp header files.
...
Cleanup asic_reg/raven1/MP folder.
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:25 -05:00
Feifei Xu
fb960bd283
drm/amd/include:cleanup vega10 header files.
...
Remove asic_reg/vega10 folder.
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:22 -05:00
Feifei Xu
f0a58aa3f2
drm/amd/include:cleanup vega10 nbio header files.
...
Cleanup asic_reg/vega10/NBIO folder.
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:21 -05:00
Feifei Xu
cde5c34f63
drm/amd/include:cleanup vega10 gc header files.
...
Cleanup asic_reg/vega10/GC folder.
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com >
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:20 -05:00
Feifei Xu
a629bf32df
drm/amd/include:cleanup vega10 thm header files.
...
Cleanup asic_reg/vega10/THM folder.
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:18 -05:00
Feifei Xu
a6651c98c6
drm/amd/include:cleanup vega10 mp header files.
...
Cleanup asic_reg/vega10/MP folder, remove mp_9_0_default.h
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:17 -05:00
Ernst Sjöstrand
8cdbad98c5
drm/amd/powerplay: Followup fixes to mc_reg_address
...
This is a followup to:
drm/amd/powerplay: Fix buffer overflows with mc_reg_address
Rework *_set_mc_special_registers for the other architectures to
use the same logic as the first patch. This allows the last entry
of the array to be filled without an error message for example.
This doesn't fix any known problems, perhaps avoided by luck.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:00 -05:00
Ernst Sjöstrand
47e8788b49
drm/amd/powerplay: Fix buffer overflows with mc_reg_address
...
Smatch warned about the following lines:
ci_set_mc_special_registers() error: buffer overflow 'table->mc_reg_address' 16 <= 16
tonga_set_mc_special_registers() error: buffer overflow 'table->mc_reg_address' 16 <= 16
Change the logic to check before access instead of after incrementing.
It's fine if j reaches max after we're done. This allows the last entry
of the array to be filled without an error message for example.
Changed some whitespace to clarify grouping.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:48:00 -05:00
Ernst Sjöstrand
e9c227b253
drm/amd/powerplay: Fix missing newlines at end of file
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:47:59 -05:00
Ernst Sjöstrand
19fef71cd1
drm/amd/powerplay: Minor fixes in processpptables.c (v2)
...
Reported by smatch:
init_overdrive_limits() error: uninitialized symbol 'result'.
get_clock_voltage_dependency_table() warn: inconsistent indenting
v2: set result to 0 (Alex)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:47:59 -05:00
Joe Perches
4f42a2dd3d
drm: amd: Fix line continuation formats
...
Line continuations with excess spacing causes unexpected output.
Miscellanea:
o Added missing '\n' to a few of the coalesced pr_<level> formats
Reviewed-by: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Joe Perches <joe@perches.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-06 12:47:57 -05:00
Rex Zhu
95a3ff787a
drm/amd/pp: delete an outdated comment in amd_powerplay.c
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-04 16:33:19 -05:00
Rex Zhu
4c7c8bbb1f
drm/amd/pp: implement notify_smu_memory_info on Powerplay
...
Used to set up smu power logging.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-04 16:33:19 -05:00
Rex Zhu
c79563a316
drm/amdgpu: add header kgd_pp_interface.h
...
move powerplay and amdgpu shared structures
and definitions to kgd_pp_interface.h. This
is the interface between the base driver
and powerplay.
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-04 16:33:18 -05:00
Rex Zhu
11dc9364bd
drm/amdgpu: move struct amd_powerplay to amdgpu.h
...
Clean up the interface.
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-04 16:33:17 -05:00
Rex Zhu
f685d71432
drm/amd/powerplay: move functions to amd_pm_funcs table
...
those functions are exported to DC
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-04 16:33:17 -05:00
Rex Zhu
2c2b67b479
drm/amdgpu: move DC and PP shared data structures to dm_pp_interface.h
...
Move the display/power interfaces to one place.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-04 16:33:17 -05:00
Evan Quan
7413d2faef
drm/amd/powerplay: describe the PCIE link speed in right GT/s
...
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-04 16:33:14 -05:00
pding
9953b72f9c
drm/amdgpu: change redundant init logs to debug level
...
When this VF stays in exclusive mode for long, other VFs will be
impacted.
The redundant messages causes exclusive mode timeout when they're
redirected. That is a normal use case for cloud service to redirect
guest log to virtual serial port.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: pding <Pixel.Ding@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2017-12-04 16:33:12 -05:00