aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/kv_dpm.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-05-16drm/radeon: fix array out of boundstom will1-1/+1
When the initial value of i is greater than zero, it may cause endless loop, resulting in array out of bounds, fix it. Signed-off-by: tom will <os@iscas.ac.cn> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-16drm/radeon: fix indentation.Jérome Glisse1-2/+2
I hate doing this but it hurts my eyes to go over code that does not comply with indentation rules. Only thing that is not only space change is in atom.c all other files are space indentation issues. Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Jérôme Glisse <jglisse@redhat.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19drm/radeon/kv: implement get_current_sclk/mclkAlex Deucher1-0/+23
Will be used for exposing current clocks via INFO ioctl. Tested-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-11drm/radeon: only enable kv/kb dpm interrupts once v3Alex Deucher1-2/+15
Enable at init and disable on fini. Workaround for hardware problems. v2 (chk): extend commit message v3: add new function Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> (v2) Cc: stable@vger.kernel.org
2015-01-22drm/radeon: comment out some currently unused kv dpm codeAlex Deucher1-0/+2
Keep it around for reference. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-05drm/radeon: adjust default bapm settings for KVAlex Deucher1-6/+4
Enabling bapm seems to cause clocking problems on some KV configurations. Disable it by default for now. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2014-10-28drm/radeon: dpm fixes for asrock systemsAlex Deucher1-3/+16
- bapm seems to cause CPU stuck messages so disable it. - nb dpm seems to prevent GPU dpm from getting enabled, so disable it. bug: https://bugs.freedesktop.org/show_bug.cgi?id=85107 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2014-10-14Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds1-0/+2
Pull drm updates from Dave Airlie: "This is the main git pull for the drm, I pretty much froze major pulls at -rc5/6 time, and haven't had much fallout, so will probably continue doing that. Lots of changes all over, big internal header cleanup to make it clear drm features are legacy things and what are things that modern KMS drivers should be using. Also big move to use the new generic fences in all the TTM drivers. core: atomic prep work, vblank rework changes, allows immediate vblank disables major header reworking and cleanups to better delinate legacy interfaces from what KMS drivers should be using. cursor planes locking fixes ttm: move to generic fences (affects all TTM drivers) ppc64 caching fixes radeon: userptr support, uvd for old asics, reset rework for fence changes better buffer placement changes, dpm feature enablement hdmi audio support fixes intel: Cherryview work, 180 degree rotation, skylake prep work, execlist command submission full ppgtt prep work cursor improvements edid caching, vdd handling improvements nouveau: fence reworking kepler memory clock work gt21x clock work fan control improvements hdmi infoframe fixes DP audio ast: ppc64 fixes caching fix rcar: rcar-du DT support ipuv3: prep work for capture support msm: LVDS support for mdp4, new panel, gpu refactoring exynos: exynos3250 SoC support, drop bad mmap interface, mipi dsi changes, and component match support" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (640 commits) drm/mst: rework payload table allocation to conform better. drm/ast: Fix HW cursor image drm/radeon/kv: add uvd/vce info to dpm debugfs output drm/radeon/ci: add uvd/vce info to dpm debugfs output drm/radeon: export reservation_object from dmabuf to ttm drm/radeon: cope with foreign fences inside the reservation object drm/radeon: cope with foreign fences inside display drm/core: use helper to check driver features drm/radeon/cik: write gfx ucode version to ucode addr reg drm/radeon/si: print full CS when we hit a packet 0 drm/radeon: remove unecessary includes drm/radeon/combios: declare legacy_connector_convert as static drm/radeon/atombios: declare connector convert tables as static drm/radeon: drop btc_get_max_clock_from_voltage_dependency_table drm/radeon/dpm: drop clk/voltage dependency filters for BTC drm/radeon/dpm: drop clk/voltage dependency filters for CI drm/radeon/dpm: drop clk/voltage dependency filters for SI drm/radeon/dpm: drop clk/voltage dependency filters for NI drm/radeon: disable audio when we disable hdmi (v2) drm/radeon: split audio enable between eg and r600 (v2) ...
2014-10-03drm/radeon/kv: add uvd/vce info to dpm debugfs outputAlex Deucher1-0/+2
Track whether UVD or VCE are enabled in debugfs. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-09-18drm/radeon/dpm: fix resume on mullinsAlex Deucher1-7/+21
Need to properly disable nb dpm on dpm disable. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2014-08-15drm/radeon/dpm: select the appropriate vce power state for KV/KB/MLAlex Deucher1-3/+3
Compare the clock in the limits table to the requested evclk rather than just taking the first value. Improves vce performance in certain cases. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2014-08-15drm/radeon: add bapm module parameterAlex Deucher1-1/+4
Add a module paramter to enable bapm on APUs. It's disabled by default on certain APUs due to stability issues. This option makes it easier to test and to enable it on systems that are stable. bug: https://bugzilla.kernel.org/show_bug.cgi?id=81021 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2014-07-01drm/radeon: enable bapm by default on KV/KBAlex Deucher1-1/+1
bapm allows the GPU and CPU to share TDP. This allows for additional performance out of the GPU and CPU when the headroom is available. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-05-06drm/radeon: dpm updates for KV/KBAlex Deucher1-20/+97
- Use vddc/sclk dep table for voltage if available - Fix UVD DPM setup - Patch voltage tables properly for non-UVD blocks - Fix DPM + UVD/VCE on Mullins Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com>
2014-05-06drm/radeon: add Mullins dpm support.Samuel Li1-10/+10
Generic dpm support similar to Kabini. Mullins specific features will be worked on later. Signed-off-by: Samuel Li <samuel.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-18drm/radeon/cik: enable/disable vce cg when encoding v2Alex Deucher1-0/+4
Some of the vce clocks are automatic, others need to be manually enabled. For ease, just disable cg when vce is active. v2: rebased Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-18drm/radeon/dpm: properly enable/disable vce when vce pg is enabledAlex Deucher1-4/+7
The adds the appropriate function calls to properly re-init vce before it's used after it has been power gated. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-18drm/radeon: add vce dpm support for KV/KBAlex Deucher1-11/+35
TODO: plug in cik_vce_suspend()/resume() so we can enable vce powergating. See XXX in code. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-18drm/radeon/dpm: move platform caps fetching to a separate functionAlex Deucher1-3/+4
It's needed by by both the asic specific functions and the extended table parser. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-06drm/radeon/dpm: fix uninitialized read from stack in kv_dpm_late_enableDave Jones1-1/+1
If we take the false branch of the if quoted in the diff below, we end up doing a return ret, without ever having initialized it. Picked up by coverity. Signed-off-by: Dave Jones <davej@fedoraproject.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24drm/radeon/dpm: switch on new late_enable callbackAlex Deucher1-17/+0
Right now it's called right after enable, but after reworking the dpm init order, it will get called later to accomodate loading the smc early, but enabling thermal interrupts and block powergating later after the ring tests are complete. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24drm/radeon/dpm: add late_enable for KB/KVAlex Deucher1-0/+24
Make sure interrupts are enabled before we enable thermal interrupts. Also, don't powergate uvd, etc. until after the ring tests. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24drm/radeon/cik: drop cg_update from dpm codeAlex Deucher1-25/+0
I'm not entirely sure this is required and it won't work with the dpm restructing anyway. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-10-23drm/radeon: disable bapm on KBAlex Deucher1-1/+1
May cause stability problems on some boards. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-15drm/radeon/dpm: rework auto performance level enableAlex Deucher1-1/+0
Calling force_performance_level() from set_power_state() doesn't work on some asics because the current power state pointer has not been properly updated at that point. Move the calls to force_performance_level() out of the asic specific set_power_state() functions and into the main power state sequence. Fixes dpm resume on SI. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11drm/radeon/dpm: add bapm callback for kb/kvAlex Deucher1-0/+20
This adds the enable_bapm callback for kb/kv. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11drm/radeon/dpm: handle bapm on kb/kvAlex Deucher1-0/+8
bapm is a power management feature for handling the power budget between the CPU and GPU on APUs. This patch adds support for enabling or disabling it. For now disable it by default. Enabling it properly requires quite a bit more work and will be addressed in a separate patch. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11drm/radeon: dpm updates for KVAlex Deucher1-15/+88
This updates dpm support for KV asics. Notably there are some changes in acp handling and forcing performance levels. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11drm/radeon: signedness bug in kv_dpm.cDan Carpenter1-19/+13
The problem here is that "unsigned i" is always greater than or equal to zero. These loops mostly have a second check for "(i == 0)" so only the last two are actually buggy. The rest is just cleanup. Bug 1: kv_force_dpm_highest() doesn't have an "(i == 0)" check so it's a potential forever loop. Bug 2: In kv_get_sleep_divider_id_from_clock() there is a typo and the test is reversed "<=" vs ">" so we never enter the loop. That means normally we return KV_MAX_DEEPSLEEP_DIVIDER_ID (5). The return value from here is saved in ->DeepSleepDivId and I wasn't able to determine how that is used. This is a static checker fix and I have not tested it. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30drm/radeon: gcc fixes for kb/kv dpmAlex Deucher1-2/+5
Newer versions of gcc seem to wander off into the weeds when dealing with variable sizes arrays in structs. Rather than indexing the arrays, use pointer arithmetic. See bugs: https://bugs.freedesktop.org/show_bug.cgi?id=66932 https://bugs.freedesktop.org/show_bug.cgi?id=66972 https://bugs.freedesktop.org/show_bug.cgi?id=66945 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30drm/radeon/dpm: only need to reprogram uvd if uvd pg is enabledAlex Deucher1-6/+9
Avoid needless uvd reprogramming if uvd powergating is disabled. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2013-08-30drm/radeon/dpm: ungate blocks in dpm disable for kb/kvAlex Deucher1-0/+6
These blocks need to be ungated for the other parts of the driver properly initialize them (e.g., after a gpu reset, etc.). Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30drm/radeon: handle cg in KB/KV dpm codeAlex Deucher1-0/+26
Clockgating needs to be disabled around certain parts of dpm setup otherwise the smc gets into a bad state and dpm doesn't work properly. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30drm/radeon: separate UVD code v3Christian König1-7/+4
Our different hardware blocks are actually completely separated, so it doesn't make much sense any more to structure the code by pure chipset generations. Start restructuring the code by separating our the UVD block. v2: updated commit message v3: rebased and restructurized start/stop functions for kv dpm. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30drm/radeon/dpm: implement UVD powergating for KB/KVAlex Deucher1-7/+15
Powergate the UVD block when not in use to save power. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30drm/radeon/dpm: implement force performance level for KB/KVAlex Deucher1-0/+43
Allows you to force the selected performance level via sysfs. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30drm/radeon/dpm: add debugfs support for KB/KVAlex Deucher1-0/+23
This allows you to look at the current DPM state via debugfs. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-30drm/radeon/kms: add dpm support for KB/KVAlex Deucher1-0/+2536
This adds dpm support for KB/KV asics. This includes: - dynamic engine clock scaling - dynamic voltage scaling - power containment - shader power scaling Set radeon.dpm=1 to enable. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>