summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay
Commit message (Collapse)AuthorAgeFilesLines
* drm/amd/powerplay: Mark functions of ppevvmath.h staticNils Wallménius2016-07-291-64/+64
| | | | | | | | This introduces some warnings due to unused functions, that are deleted in the following commit. Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: Delete an unnecessary variable initialisation in ↵SF Markus Elfring2016-07-291-1/+1
| | | | | | | | | | | phm_dispatch_table() The variable "result" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: Change assignment for a buffer variable in ↵Markus Elfring2016-07-291-1/+3
| | | | | | | | | | | | | phm_dispatch_table() v2 The variable "temp_storage" was eventually reassigned with a pointer. Thus omit the explicit initialisation at the beginning. v2: agd: fix coding style Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drivers/amdgpu: Remove redundant itermediate return valEdward O'Callaghan2016-07-295-14/+7
| | | | | | | | Found-by: Coccinelle Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drivers/amdgpu: Use canonical boolean form in various predicatesEdward O'Callaghan2016-07-295-48/+53
| | | | | | | | | | | V.2: Fixup by hand to remove a few instances of redundant '()' left over. Found-by: Coccinelle Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drivers/amdgpu: Remove redundant casts on kzalloc() callsEdward O'Callaghan2016-07-293-15/+10
| | | | | | | | Found-by: Coccinelle Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drivers/amdgpu: Remove redundant NULL check before kfree()Edward O'Callaghan2016-07-291-2/+1
| | | | | | | | Found-by: Coccinelle Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drivers/amdgpu: Use 'true/false' for bool typed variablesEdward O'Callaghan2016-07-294-24/+24
| | | | | | | | Found-by: Coccinelle Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: enable DiDt feature for polaris10/11.Rex Zhu2016-07-293-5/+554
| | | | | | | | | | | DIDT is a power saving feature which helps limit power consumption in order to hit a target power allocation. v1: delete temp file added accidentally. 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: populate SMC ACPI minimum voltage using VBIOS boot SCLK ↵Rex Zhu2016-07-291-3/+2
| | | | | | | | and MCLK 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/powerplay: partial revert of endian fixesAlex Deucher2016-07-291-2/+2
| | | | | | | | | This fixes a warning on big endian. Bitfields need to be handled properly. Cc: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* Merge branch 'drm-next-4.8' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie2016-07-286-137/+231
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into drm-next A few more patches for 4.8. Mostly bug fixes and some prep work for iceland powerplay support. I have a couple polaris patches and Edward's misc cleanups that require a merge with Linus'. I don't know if you are planning a merge anytime soon. [airlied: fixed up endian vs 32-bit change in ppatomctrl] * 'drm-next-4.8' of git://people.freedesktop.org/~agd5f/linux: (26 commits) drm/amdgpu: comment out unused defaults_bonaire_pro static const structures to fix the build drm/amdgpu: temporary comment out unused static const structures to fix the build drm/amdgpu: S3 resume fail on Polaris10 drm/amd/powerplay: add pp_tables_get_response_times function in process pptables drm/amd/powerplay: fix the incorrect return value drm/amd/powerplay: add atomctrl_get_voltage_evv function in ppatomctrl drm/amdgpu: add new definitions into ppsmc.h for iceland drm/amd/powerplay: add SMU register macro for future use drm/amdgpu: add ucode_start_address into cgs_firmware_info drm/amdgpu: no need load microcode at sdma if powerplay is enabled drm/amdgpu: rename smumgr to smum for dpm drm/amdgpu: disable GFX PG on CZ/BR/ST drivers: gpu: drm: amd: powerplay: hwmgr: Remove unused variable drm/amdgpu: return -ENOSPC when running out of UVD handles drm/amdgpu: trace need_flush in grab_vm as well drm/amdgpu: always signal all fences drm/amdgpu: check flush fence context instead of same ring v2 drm/radeon: support backlight control for UNIPHY3 drm/amdgpu: support backlight control for UNIPHY3 drm/amdgpu: remove usec timeout loop from IB tests ...
| * drm/amd/powerplay: add pp_tables_get_response_times function in process pptablesHuang Rui2016-07-152-7/+23
| | | | | | | | | | | | | | | | | | The pp_tables_get_response_times function will be used on iceland HW mananger. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * drm/amd/powerplay: fix the incorrect return valueHuang Rui2016-07-151-2/+2
| | | | | | | | | | | | | | | | | | | | The return value 0 (false) means fail to find GPIO in atomctrl_get_pp_assign_pin. "-1" returns true as bool actually. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Cc: <stable@vger.kernel.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * drm/amd/powerplay: add atomctrl_get_voltage_evv function in ppatomctrlHuang Rui2016-07-152-0/+47
| | | | | | | | | | | | | | | | | | The atomctrl_get_voltage_evv function will be used on iceland HW manager. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * drm/amd/powerplay: add SMU register macro for future useHuang Rui2016-07-151-0/+29
| | | | | | | | | | | | Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * drivers: gpu: drm: amd: powerplay: hwmgr: Remove unused variableMatthias Beyer2016-07-151-6/+3
| | | | | | | | | | | | Reviewed-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * drm/amdgpu/powerplay: endian fixes for ppatomctrl.cAlex Deucher2016-07-081-122/+127
| | | | | | | | | | | | Atom tables are in LE format. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* | Backmerge tag 'v4.7' into drm-nextDave Airlie2016-07-269-63/+136
|\ \ | |/ |/| | | | | | | Linux 4.7 As requested by Daniel Vetter as the conflicts were getting messy.
| * drm/amd/powerplay: Update CKS on/ CKS off voltage offset calculation.Rex Zhu2016-07-061-13/+10
| | | | | | | | | | | | | | | | | | | | | | As get the right evv voltage, update them to latest coefficients to align with BB. agd: squash in Slava's 32 bit build fix 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 bug that get wrong polaris evv voltage.Rex Zhu2016-07-063-6/+7
| | | | | | | | | | | | | | | | value is 32 bits for polaris, not 16. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Ken Wang <Qingqing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * drm/amd/powerplay: incorrectly use of the function return valueRex Zhu2016-07-061-1/+1
| | | | | | | | | | | | | | | | | | '0' means true. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
| * drm/amd/powerplay: fix incorrect voltage table value for tongaHuang Rui2016-07-061-1/+1
| | | | | | | | | | | | | | Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
| * drm/amd/powerplay: fix incorrect voltage table value for polaris10Huang Rui2016-07-061-1/+1
| | | | | | | | | | | | Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * drm/amd/powerplay: fix issue uvd dpm can't enabled on Polaris11.Rex Zhu2016-06-291-41/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Populate correct value of VDDCI voltage for SMC SAMU, VCE, and UVD levels depending on whether VDDCi control is SVI2 or GPIO. 2. Populate SMC ACPI minimum voltage using VBIOS boot SCLK and MCLK When static voltage is configured as VDDCI, driver still tries to program a voltage for MM minVoltage using VDDC-VDDCI delta requirement. minVoltage should be set as boot up voltage. 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: Workaround for Memory EDC Error on Polaris10.Rex Zhu2016-06-291-0/+26
| | | | | | | | | | | | 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: Update CKS on/ CKS off voltage offset calculationRex Zhu2016-06-231-9/+17
| | | | | | | | | | | | | | | | CKS on/off voltage offset calculation algorithm takes in a few coefficients. We need to update them for polaris to latest coefficients to align with BB. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * drm/amd/powerplay: disable FFC.Rex Zhu2016-06-233-5/+24
| | | | | | | | | | | | | | | | | | SMC need use VBI signal for MCLK switching Send 2 x frame time as vbi timeout 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 definition for FFC feature on polaris.Rex Zhu2016-06-232-1/+4
| | | | | | | | | | | | 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: don't add invalid voltage.Rex Zhu2016-07-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | if atomctrl_get_voltage_evv_on_sclk_ai returns non zero (fail) in the expansion of the PP_ASSERT_WITH_CODE macro the continue will actually do nothing, So invalid voltage will be added to ppbable. 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 definitions related to di/dt feature for fiji and ↵Rex Zhu2016-07-072-0/+26
| | | | | | | | | | | | | | | | polaris. 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 mvdd dpm support.Rex Zhu2016-07-071-3/+2
| | | | | | | | | | | | | | | | SMC requires master switch bit to be set. 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: Unify family definesTom St Denis2016-07-072-4/+6
| | | | | | | | | | | | | | | | s/AMD_FAMILY_/AMDGPU_FAMILY_/ Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* | drm/amd/powerplay: change condition judgment as function's return value changed.Rex Zhu2016-07-071-7/+6
| | | | | | | | | | Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* | drm/amd/powerplay: functions's return state was reversedRex Zhu2016-07-071-2/+2
| | | | | | | | | | | | | | | | | | | | In commit 195567e99bdf6491a370b71a1dcf6b4c891495d7, use true/false instead of 1/0 to fix build warning. But the original logic: '0' means true and '1' means false. 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: fix typos in comment in polaris' hwmgrAlexandre Demers2016-07-071-2/+2
| | | | | | | | | | Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* | drm/amd/powerplay: fix trivial typo and tidy commentAlexandre Demers2016-07-071-1/+1
| | | | | | | | | | Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* | drm/amdgpu/powerplay/cz: add missing call to powergate VCEAlex Deucher2016-07-071-1/+1
| | | | | | | | | | | | Not enabled yet, but missing the call. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* | drm/amdgpu: change pcie_gen_cap magic code to macroHuang Rui2016-07-073-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | This patch changes pcie_gen_cap magic code to macro to make it more readable. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Huang Rui <ray.huang@amd.com> Cc: Eric Huang <JinHuiEric.Huang@amd.com> Cc: Ken Wang <Qingqing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* | drm/amd/powerplay: make sure VCE is disabled by defaultArindam Nath2016-07-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is a port of similar patch for amdgpu when PP is disabled. Since the code flow is little different when PP is enabled, we need to make sure the patch is applied for PP enabled path as well. With the current code, when we boot with the amdgpu driver enabled and loaded, the VCE also automatically remains enabled since bootup. This can be verified from the output of amdgpu_pm_info. It does not matter whether we boot into command line directly or into X, the VCE stays enabled the entire time. This patch addresses the issue and makes sure that VCE is turned on only during playback, and remains disabled otherwise. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Arindam Nath <arindam.nath@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* | amdgpu: use NULL instead of 0 for pointerArnd Bergmann2016-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the AMD powerplay driver, a pointer is checked for validity by comparing against an integer '0', which causes a harmless warning when building with "make W=1": drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/processpptables.c:1502:16: error: ordered comparison of pointer with integer zero [-Werror=extra] This changes the code to the more conventional "if (pointer)" check. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* | drm/amd/powerplay: remove useless soft pptable in Asic related backendEric Huang2016-07-076-31/+0
| | | | | | | | | | | | | | | | | | | | The soft pptable was used for re-uploading pptable as cache, but since previous commits, the generic codes for uploading pptable are used and backend is released during resetting powerplay. So it becomes redundance. 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: remove useless pp_table codes for Tonga/Fiji/Polaris10Eric Huang2016-07-074-116/+0
| | | | | | | | | | | | | | | | | | Due to uploading pptable implementation changed, the generic codes in previous commit have been used intead of the Asic specific codes. 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 uploading pptable and resetting powerplay supportEric Huang2016-07-074-9/+63
| | | | | | | | | | | | | | | | Necessary for re-initializing dpm with new pptables at runtime. 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: change backend allocation to backend initEric Huang2016-07-074-36/+30
| | | | | | | | | | | | | | | | | | backend_init and backend_fini are paired functions, backend is freed in backend_fini and should be allocated in backend_init. 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 disable dpm tasks for Polaris10Eric Huang2016-07-073-1/+257
| | | | | | | | | | | | 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 disable dpm tasks for TongaEric Huang2016-07-071-0/+1
| | | | | | | | | | | | 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 function disable_dpm_tasks for FijiEric Huang2016-07-073-0/+281
| | | | | | | | | | | | 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 event task of disable dynamic state managementEric Huang2016-07-074-2/+28
| | | | | | | | | | | | | | | | | | Add an interface to disable dpm so that we can disable dpm before updating pptables at runtime. 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: keep soft_pp_table pointer value for re-uploadingEric Huang2016-07-072-13/+8
| | | | | | | | | | | | | | | | Necessary for updating pptables at runtime. 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>
OpenPOWER on IntegriCloud