summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay
Commit message (Collapse)AuthorAgeFilesLines
* drm/amd/powerplay: select samu dpm 0 as boot level on polaris.Rex Zhu2016-06-151-4/+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/amd/powerplay: update powerplay table parsingRex Zhu2016-06-154-34/+97
| | | | | | | | to handle pptable format change on Polaris boards 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: delete useless code as pptable changed in vbios.Rex Zhu2016-06-091-21/+0
| | | | | | | | The vbios table changed so this code is useless now. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: fix bug visit array out of boundsRex Zhu2016-06-092-2/+2
| | | | | | | Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: fix smu ucode memleak (v2)Monk Liu2016-06-093-0/+5
| | | | | | | | | | Properly release the smu ucode in powerplay. v2: agd: add polaris as well Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: fix tonga smu_fini mem leakMonk Liu2016-06-091-0/+5
| | | | | | Signed-off-by: Monk Liu <Monk.Liu@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: fix fiji smu fini mem leakMonk Liu2016-06-091-0/+4
| | | | | | Signed-off-by: Monk Liu <Monk.Liu@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: fix memleak in pptable_initMonk Liu2016-06-092-30/+32
| | | | | | Signed-off-by: Monk Liu <Monk.Liu@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: fix mem leak in pplib/hwmgrMonk Liu2016-06-091-0/+7
| | | | | | Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: fix mem leak in smumgrMonk Liu2016-06-091-0/+1
| | | | | | Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: fix pplib finish bugMonk Liu2016-06-091-3/+0
| | | | | | | | | | | | | 1,should use late_fini to kfree all resource otherwise the released pointer maybe accessed in IRQ ip fini routine. 2,hwmgr should not be kfree by pem_fini which is invoked by hw fini path. Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/admgpu/powerplay/polaris: fix powertune table uploadRex Zhu2016-06-091-1/+1
| | | | | | | | | Exclude AVFS related fields when update powertune table to hw. The driver shouldn't set them directly. 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/hwmgr: use kmemdupMuhammad Falak R Wani2016-05-191-3/+3
| | | | | | | | | Use kmemdup when some other buffer is immediately copied into allocated region. It replaces call to allocation followed by memcpy, by a single call to kmemdup. Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay/hwmgr: use kmemdupMuhammad Falak R Wani2016-05-191-3/+3
| | | | | | | | | Use kmemdup when some other buffer is immediately copied into allocated region. It replaces call to allocation followed by memcpy, by a single call to kmemdup. Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay/hwmgr: use kmemdupMuhammad Falak R Wani2016-05-191-3/+3
| | | | | | | | | Use kmemdup when some other buffer is immediately copied into allocated region. It replaces call to allocation followed by memcpy, by a single call to kmemdup. Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: fix bugs of checking if dpm is running on TongaEric Huang2016-05-181-4/+4
| | | | | | | | Fixes OD failures on Tonga. 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: use ARRAY_SIZE() to calculate array size.Muhammad Falak R Wani2016-05-161-1/+1
| | | | | | | | | | It is preferred to use ARRAY_SIZE() for size calculation, instead using sizeof(array)/sizeof(*array). It makes the code more readable. Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: fix a bug on updating sclk for TongaEric Huang2016-05-131-1/+1
| | | | | | | | Update sclk smc table rather than mclk smc table for sclk updates. 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: fix a bug on updating sclk for FijiEric Huang2016-05-131-1/+1
| | | | | | | | Update sclk smc table rather than mclk smc table for sclk updates. 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: move asic unrelated function to hwmgr.c.Rex Zhu2016-05-134-73/+40
| | | | | | | | It's generic and used by multiple asics. 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 NULL point check errorRex Zhu2016-05-131-2/+3
| | | | | | | | && was used instead of || 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: SCLK will have a big drop with low VDDC when PPlib was ↵Rex Zhu2016-05-131-1/+2
| | | | | | | | | | | | | | enabled. SMC uses CurrSclkPllRange structure to keep track of what range of PLL SCLK is sitting on. Driver overwrites this value to 0 because it's part of DPM table and driver doesn't program this. This change will set this field to 0xFF every time there's a init SMC table call. 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: rewrite pp_sw_init to make code readableHuang Rui2016-05-111-6/+9
| | | | | | | | | | Actually, pp_sw_init executes pptable_init and backend_init orderly if they are initialized successfully. So rewrite it to make code more readable. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/amdgpu: Add name field to amd_ip_funcs (v2)Tom St Denis2016-05-111-0/+1
| | | | | | | | | | | Add name that we can print out in kernel messages to aid in debugging. v2: drop DAL changes for upstream Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: Drop unused parameter for *get_sleep_divider_id_from_clockNils Wallménius2016-05-112-6/+6
| | | | | Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: Simplify calculation in *get_sleep_divider_id_from_clockNils Wallménius2016-05-113-3/+3
| | | | | | | a / (1 << b) is equivalent to a >> b for unsigned values Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: Use max macro in *get_sleep_divider_id_from_clockNils Wallménius2016-05-112-4/+2
| | | | | Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: Use defined constants for minium engine clockNils Wallménius2016-05-112-3/+4
| | | | | | | | Replacing magic numbers in calculation of sleep divider id for fiji and polaris. Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: add missing licenses on a couple of filesAlex Deucher2016-05-112-0/+45
| | | | | | Noticed by n1s on IRC. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd: cleanup remaining spaces and tabs v2Christian König2016-05-116-23/+23
| | | | | | | | | | | | | | This is the result of running the following commands: find drivers/gpu/drm/amd/ -name "*.h" -exec sed -i 's/[ \t]\+$//' {} \; find drivers/gpu/drm/amd/ -name "*.c" -exec sed -i 's/[ \t]\+$//' {} \; find drivers/gpu/drm/amd/ -name "*.h" -exec sed -i 's/ \+\t/\t/' {} \; find drivers/gpu/drm/amd/ -name "*.c" -exec sed -i 's/ \+\t/\t/' {} \; v2: drop changes to DAL and internal headers Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: fix build on aarch64.Dave Airlie2016-05-091-0/+1
| | | | | | Same fix went in previously for some other files. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/amdgpu/fiji: set UVD CG state when enabling UVD DPM (v2)Alex Deucher2016-05-041-2/+9
| | | | | | | | | Need to call the IP cg callbacks. v2: fix gate logic Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/powerplay: add missing clockgating callback for tongaAlex Deucher2016-05-041-0/+1
| | | | | | | Without this clockgating is not enabled. Reviewed-by: Ken Wang <Qingqing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: Constify some tablesNils Wallménius2016-05-046-33/+36
| | | | | | | | | Some more tables with constant data were added with the polaris support v2: missed a few Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: Delete dead struct declarationNils Wallménius2016-05-041-1/+0
| | | | | Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay/hwmgr: don't add invalid voltageMoritz Kühner2016-05-041-26/+28
| | | | | | | | | | | | | | | | | if atomctrl_get_voltage_evv_on_sclk returns non zero (fail) in the expansion of the PP_ASSERT_WITH_CODE macro the continue will actually do nothing (The macro uses a do ... while(0) as scope, which eats the continue). Based on the code I don't think this was the intent. Unfortunately fixing this requires rewriting the control flow and removing the macros. v2: added signed of by fixed error message print v3: agd: drop DRM_ERROR Signed-off-by: Moritz Kühner <kuehner.moritz@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay/hwmgr: prevent VDDC from exceeding 2VMoritz Kühner2016-05-041-2/+1
| | | | | | | | | | | If the tonga gpu is controlled by SVID2 tonga_get_evv_voltage will only print an error if the voltage exceeds 2V although a comment clearly states that it needs be less than 2V. v2: added signed of by Signed-off-by: Moritz Kühner <kuehner.moritz@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/amdgpu: Drop print_status callbacks.Tom St Denis2016-05-041-5/+0
| | | | | | | | | | | First patch in series to move to user mode debug tools we're removing the print_status callbacks. These functions were unused at the moment anyway. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: revise reading/writing pptable on Polaris10Eric Huang2016-05-042-4/+30
| | | | | | | | | Change the way we store pptables in the driver to better facilitate eventual runtime updates for debugging. 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: revise reading/writing pptable on TongaEric Huang2016-05-042-12/+27
| | | | | | | | | Change the way we store pptables in the driver to better facilitate eventual runtime updates for debugging. 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: revise reading/writing pptable on FijiEric Huang2016-05-042-7/+37
| | | | | | | | | Change the way we store pptables in the driver to better facilitate eventual runtime updates for debugging. 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: revise caching the soft pptable and add it's sizeEric Huang2016-05-042-6/+10
| | | | | | | | | This fixes a bug in the pptable access interface that could lead to a crash. Check the pointer before using it. 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 dpm force multiple levels on cz/tonga/fiji/polaris (v2)Eric Huang2016-05-047-19/+45
| | | | | | | | | | | | | Allows you to force multiple levels rather than just one via the new sysfs interrface. v2: squash in: drm/amd/powerplay: ensure clock level set by user is valid. From Rex. 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: fix fan speed percent setting error on Polaris10Eric Huang2016-05-041-2/+2
| | | | | | | | The logic was reversed. Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: fix bug dpm can't work when resume back on PolarisEric Huang2016-05-041-0/+5
| | | | | | | | | | | | Need to initialize the values to 0 since they get or'ed with additional values. If the initialization is missing, on resume, they may end up with a combination of stale data and new data. Fixes dpm on resume. 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 some initialize error on polaris10.Rex Zhu2016-05-041-4/+1
| | | | | | | | | 1. don't enable SclkThrottleLowNotification, it's not supported. 2. Set missing mclk_dpm0_activity_target 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: return 0 when interface not implement on some asic.Rex Zhu2016-05-041-56/+113
| | | | | | | | Don't fail if certain optional interface callbacks are missing. 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 vce power gate state for baffin.Rex Zhu2016-05-041-0/+2
| | | | | | | | | | Forgot to save the current gate state so we don't know what the current state is if we try and gate/ungate the block. 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 a bug for enabling ACDC gpio interruptEric Huang2016-05-041-4/+7
| | | | | | | | Only enable it if it's supported rather than unconitionally. Signed-off-by: Eric Yang <eric.yang2@amd.com> Reviewed-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: fix issue that get wrong reference clock value.Rex Zhu2016-05-041-1/+1
| | | | | | | | use wrong parameter to compute the reference clock. 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>
OpenPOWER on IntegriCloud