summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay
Commit message (Collapse)AuthorAgeFilesLines
* drm/amd/powerplay: add powerplay valid check to avoid null point.Rex Zhu2016-02-101-3/+9
| | | | | | | | | | In case CONFIG_DRM_AMD_POWERPLAY is defined and amdgpu.powerplay=0. some functions in powrplay can also be called by DAL. and the input parameter is *adev. if just check point not NULL was not enough and will lead to NULL point error. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: Enable low mem pstate when cancel_highEric Yang2016-02-101-1/+1
| | | | | | Signed-off-by: Eric Yang <eric.yang2@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: Use correct clock in cz_apply_state_adjust_rulesEric Yang2016-02-101-2/+2
| | | | | | Signed-off-by: Eric Yang <eric.yang2@amd.com> Reviewed-by: Eagle Yeh <eagle.yeh@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: get real display device num by cgs interfaceRex Zhu2016-02-101-9/+16
| | | | | | | | Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: Use engine clock limit calculated by dalVitaly Prosyak2016-02-101-3/+3
| | | | | | | | Use min required system clock calculated by dal Signed-off-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: Make declarations of functions exposed to DAL type-safe.David Rokhvarg2016-02-102-14/+16
| | | | | | Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: implement functions in carrizo for DAL.Rex Zhu2016-02-101-11/+115
| | | | | | 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>
* drm/amd/powerplay: export interface to DAL.Rex Zhu2016-02-105-21/+251
| | | | | | 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>
* drm/amd/powerplay: change struct name.Rex Zhu2016-02-106-8/+8
| | | | | | | | amd_pp_dal_clock_info to amd_pp_simple_clock_info. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add some hwmgr functions for sysfs interface on TongaEric Huang2016-02-101-0/+123
| | | | | | Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add some hwmgr functions for sysfs interface on CarrizoEric Huang2016-02-101-0/+51
| | | | | | | | These add the interfaces for manual clock control. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add hwmgr's functions for Fiji sysfs interfaces.Eric Huang2016-02-101-0/+123
| | | | | | | | These add the interfaces for manual clock control. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add some sysfs interfaces for powerplay.Eric Huang2016-02-103-1/+136
| | | | | | | | | | | | | | | | | | | | The new sysfs interfaces: pp_num_states: Read-only, return the number of all pp states, 0 if powerplay is not available. pp_cur_state: Read-only, return the index number of current pp state. pp_force_state: Read-write, to write a power state index will switch to selected state forcedly and enable forced state mode, disable forced state mode. such as "echo >...". pp_table: Read-write, binary output, to be used to read or write the dpm table, the maximum file size is 4KB of page size. pp_dpm_sclk: Read-write, reading will return a dpm levels list, to write an index number will force powerplay to set the corresponding dpm level. pp_dpm_mclk: same as sclk. pp_dpm_pcie: same as sclk. And add new setting "manual" to the existing interface power_dpm_force_performance_level. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: indent a couple if statementsDan Carpenter2016-02-101-2/+2
| | | | | | | We recently redid the indenting, but missed these two if statements. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: Update SMU firmware loading for StoneyRex Zhu2016-01-271-9/+32
| | | | | | | | Fix firmware init on Stoney when powerplay is enabled. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: add a message to indicate when powerplay is enabled (v2)Alex Deucher2016-01-221-0/+5
| | | | | | | | | | | Makes it clear to the user which power management path is in use. v2: make consistent with dpm Reviewed-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* Merge branch 'drm-next-4.5' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie2016-01-131-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into drm-next A few more misc things for radeon and amdgpu for 4.5: - TTM fixes for imported buffers - amdgpu fixes to avoid -ENOMEM in CS ioctl - CZ UVD and VCE clock force options for debugging video issues - A couple of ACP prerequisites - Misc fixes * 'drm-next-4.5' of git://people.freedesktop.org/~agd5f/linux: drm/amdgpu: validate duplicates first drm/amdgpu: move VM page tables to the LRU end on CS v2 drm/ttm: add ttm_bo_move_to_lru_tail function v2 drm/ttm: fix adding foreign BOs to the swap LRU drm/ttm: fix adding foreign BOs to the LRU during init v2 drm/radeon: use kobj_to_dev() drm/amdgpu: use kobj_to_dev() drm/amdgpu/cz: force vce clocks when sclks are forced drm/amdgpu/cz: force uvd clocks when sclks are forced drm/amdgpu/cz: add code to enable forcing VCE clocks drm/amdgpu/cz: add code to enable forcing UVD clocks drm/amdgpu: fix lost sync_to if scheduler is enabled. drm/amd/powerplay: fix static checker warning for return meaningless value. drm/amdgpu: add irq domain support drm/amdgpu/cgs: add an interface to access PCI resources
| * drm/amd/powerplay: fix static checker warning for return meaningless value.Rex Zhu2016-01-131-3/+3
| | | | | | | | | | | | | | The return value should be either negative or zero, no positive. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* | drm/amdgpu/powerplay: include asm/div64.h for do_div()Stephen Rothwell2016-01-122-2/+2
|/ | | | | | Fixes: 1e4854e96c35 ("drm/amdgpu/powerplay: implement thermal control for tonga.") Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/amd/powerplay: implement power down asic task for CZRex Zhu2016-01-081-0/+55
| | | | | | Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: enable power down asic task. (v2)Rex Zhu2016-01-084-5/+23
| | | | | | | | v2: AGD: rebase on upstream Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: enable set boot state taskRex Zhu2016-01-083-5/+6
| | | | | | Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add thermal control task when resume.Rex Zhu2016-01-081-0/+1
| | | | | | Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: fix hex/decimal bug when show gpu load.Rex Zhu2016-01-082-10/+10
| | | | | | 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>
* drm/amdgpu: Show gpu load when display gpu performance for Fiji of VI.Rex Zhu2016-01-081-1/+10
| | | | | | 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>
* drm/amd/powerplay: Reload and initialize the smc firmware on powerplay resume.Rex Zhu2016-01-081-0/+17
| | | | | | 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>
* drm/amd/powerplay: add powerplay valid check to avoid null point. (v2)Rex Zhu2016-01-082-3/+15
| | | | | | | | | | | | In case CONFIG_DRM_AMD_POWERPLAY is defined and amdgpu.powerplay=0. some functions in powrplay can also be called by DAL. and the input parameter is *adev. if just check point not NULL was not enough and will lead to NULL point error. V2: AGD: rebase on upstream Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: fix Smatch static checker warningsRex Zhu2016-01-088-32/+51
| | | | | | | | | | 1. return -1 instead of -ENOMEM 2. The struct type mismatch warnings. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Ken Wang <Qingqing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: fix Smatch static checker warnings with indenting (v2)Rex Zhu2016-01-085-316/+311Star
| | | | | | | | | v2: AGD: rebase on upstream Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Ken Wang <Qingqing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: fix bug that NULL checks are reversed.Rex Zhu2016-01-081-5/+5
| | | | | | | | | && was used instead of ||. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Ken Wang <Qingqing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: precedence bug in init_non_clock_fields()Dan Carpenter2016-01-041-2/+2
| | | | | | | | | The cast to uint8_t happens before the right shift so this always sets .m3arb to zero. The cast is actually a no-op so we can remove it. Fixes: 3bace3591493 ('drm/amd/powerplay: add hardware manager sub-component') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: fix a reversed conditionDan Carpenter2016-01-041-1/+1
| | | | | | | | This test was reversed so it would end up leading to a NULL dereference. Fixes: 4630f0faae80 ('drm/amd/powerplay: add Carrizo smu support') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm: powerplay: use div64_s64 instead of do_divArnd Bergmann2016-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | The newly added code for Fiji creates a correct compiler warning about invalid use of the do_div macro: In file included from powerplay/hwmgr/ppatomctrl.c:31:0: drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppevvmath.h: In function 'fDivide': drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppevvmath.h:382:89: warning: comparison of distinct pointer types lacks a cast do_div(longlongX, longlongY); /*Q(32,32) divided by Q(16,16) = Q(16,16) Back to original format */ do_div() divides an unsigned 64-bit number by an unsigned 32-bit number. The code instead wants to divide two signed 64-bit numbers, which is done using the div64_s64 function. Reviewed-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 770911a3cfbb ("drm/amd/powerplay: add/update headers for Fiji SMU and DPM") Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* Merge branch 'drm-next-4.5' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie2015-12-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | into drm-next [airlied: fixup build problems on arm - added errno.h include] * 'drm-next-4.5' of git://people.freedesktop.org/~agd5f/linux: (152 commits) amd/powerplay: fix copy paste typo in hardwaremanager.c amd/powerplay: disable powerplay by default initially amd/powerplay: don't enable ucode fan control if vbios has no fan table drm/amd/powerplay: show gpu load when print gpu performance for Cz. (v2) drm/amd/powerplay: check whether need to enable thermal control. (v2) drm/amd/powerplay: add point check to avoid NULL point hang. drm/amdgpu/powerplay: Program a calculated value as Deep Sleep clock. drm/amd/powerplay: Don't return an error if fan table is missing drm/powerplay/hwmgr: log errors in tonga_hwmgr_backend_init drm/powerplay: add debugging output to processpptables.c drm/powerplay: add debugging output to tonga_processpptables.c amd/powerplay: Add structures required to report configuration change amd/powerplay: Fix get dal power level amd\powerplay Implement get dal power level drm/amd/powerplay: display gpu load when print performance for tonga. drm/amdgpu/powerplay: enable sysfs and debugfs interfaces late drm/amd/powerplay: move shared function of vi to hwmgr. (v2) drm/amd/powerplay: check whether enable dpm in powerplay. drm/amd/powerplay: fix bug that dpm funcs in debugfs/sysfs missing. drm/amd/powerplay: fix boolreturn.cocci warnings ...
* amd/powerplay: fix copy paste typo in hardwaremanager.cAlex Deucher2015-12-211-1/+1
| | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* amd/powerplay: don't enable ucode fan control if vbios has no fan tableAlex Deucher2015-12-211-0/+3
| | | | | | | | Some systems have a single fan controlled by ACPI or some other method. Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: show gpu load when print gpu performance for Cz. (v2)Rex Zhu2015-12-211-1/+12
| | | | | | | | | Show GPU load in in the debugfs output. v2: integrate Tom's optimization Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
* drm/amd/powerplay: check whether need to enable thermal control. (v2)Rex Zhu2015-12-211-1/+8
| | | | | | | | | In I+A platform(skylake), it is controlled by intel. v2: integrate Tom's fix Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
* drm/amd/powerplay: add point check to avoid NULL point hang.Rex Zhu2015-12-211-13/+47
| | | | | Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu/powerplay: Program a calculated value as Deep Sleep clock.David Rokhvarg2015-12-211-2/+4
| | | | | | This replaces programming of a hardcoded value. Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com>
* drm/amd/powerplay: Don't return an error if fan table is missingAlex Deucher2015-12-211-1/+1
| | | | | | | It's a valid configuration on some laptops. Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/powerplay/hwmgr: log errors in tonga_hwmgr_backend_initAlex Deucher2015-12-211-0/+2
| | | | | | | Helpful in debugging init issues. Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/powerplay: add debugging output to processpptables.cAlex Deucher2015-12-211-13/+29
| | | | | | | To help track down init errors. Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/powerplay: add debugging output to tonga_processpptables.cAlex Deucher2015-12-211-13/+26
| | | | | | | To help track down init errors. Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* amd/powerplay: Add structures required to report configuration changeEric Yang2015-12-215-39/+139
| | | | | | Add required structures for amd_powerplay_display_configuration_change Signed-off-by: Eric Yang <eric.yang2@amd.com>
* amd/powerplay: Fix get dal power levelVitaly Prosyak2015-12-216-15/+12Star
| | | | | | Simplify data struct for get dal power level Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
* amd\powerplay Implement get dal power levelVitaly Prosyak2015-12-216-19/+85
| | | | | | Implement get dal power level and simple clock info Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
* drm/amd/powerplay: display gpu load when print performance for tonga.Rex Zhu2015-12-211-1/+12
| | | | | | Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
* drm/amd/powerplay: move shared function of vi to hwmgr. (v2)Rex Zhu2015-12-214-19/+379
| | | | | | | v2: agd: rebase on upstream Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
* drm/amd/powerplay: fix boolreturn.cocci warningskbuild test robot2015-12-211-2/+2
| | | | | | | | | | | | drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/ppatomctrl.c:475:10-11: WARNING: return of 0/1 in function 'atomctrl_lookup_gpio_pin' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Generated by: scripts/coccinelle/misc/boolreturn.cocci CC: yanyang1 <young.yang@amd.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>