aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd
AgeCommit message (Collapse)AuthorFilesLines
2016-01-13drm/amdgpu/cz: force vce clocks when sclks are forcedAlex Deucher1-1/+23
Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-13drm/amdgpu/cz: force uvd clocks when sclks are forcedAlex Deucher1-0/+24
Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-13drm/amdgpu/cz: add code to enable forcing VCE clocksAlex Deucher2-1/+98
VCE DPM works similarly to SCLK DPM. Add a similar interface for VCE for forcing the VCE clocks. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-13drm/amdgpu/cz: add code to enable forcing UVD clocksAlex Deucher2-0/+130
UVD DPM works similarly to SCLK DPM. Add a similar interface for UVD for forcing the UVD clocks. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-13drm/amdgpu: fix lost sync_to if scheduler is enabled.Chunming Zhou1-2/+3
when scheduler is enabled, the semaphore isn't used at all. Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Cc: stable@vger.kernel.org
2016-01-13drm/amd/powerplay: fix static checker warning for return meaningless value.Rex Zhu1-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>
2016-01-11drm/amdgpu: add irq domain supportAlex Deucher6-8/+136
Hardware blocks on the GPU like ACP generate interrupts in the GPU interrupt controller, but are driven by a separate driver. Add an irq domain to the GPU driver so that blocks like ACP can register a Linux interrupt. Acked-by: Dave Airlie <airlied@redhat.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-11drm/amdgpu/cgs: add an interface to access PCI resourcesAlex Deucher2-0/+70
This provides an interface to get access to the base address of PCI resources (MMIO, DOORBELL, etc.). Only MMIO and DOORBELL are implemented right now. This is necessary to properly utilize shared drivers on platform devices. IP modules can use this interface to get the base address of the resource and add any additional offset and set the size when setting up the platform driver(s). Acked-by: Dave Airlie <airlied@redhat.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-08drm/amdgpu: add warning to amdgpu_bo_gpu_offset() v2Christian König1-0/+1
Check if there really is a valid offset for the BO. v2: user WARN_ON_ONCE Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1) Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-08drm/amd/powerplay: implement power down asic task for CZRex Zhu1-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>
2016-01-08drm/amd/powerplay: enable power down asic task. (v2)Rex Zhu4-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>
2016-01-08drm/amd/powerplay: enable set boot state taskRex Zhu3-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>
2016-01-08drm/amd/powerplay: add thermal control task when resume.Rex Zhu1-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>
2016-01-08drm/amdgpu: fix hex/decimal bug when show gpu load.Rex Zhu2-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>
2016-01-08drm/amdgpu: Show gpu load when display gpu performance for Fiji of VI.Rex Zhu1-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>
2016-01-08drm/amdgpu: Show gpu load when display gpu performance for Ci.Rex Zhu1-2/+12
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>
2016-01-08drm/amd/powerplay: Reload and initialize the smc firmware on powerplay resume.Rex Zhu1-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>
2016-01-08drm/amd/powerplay: add powerplay valid check to avoid null point. (v2)Rex Zhu2-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>
2016-01-08drm/amd/powerplay: fix Smatch static checker warningsRex Zhu8-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>
2016-01-08drm/amd/powerplay: fix Smatch static checker warnings with indenting (v2)Rex Zhu6-317/+312
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>
2016-01-08drm/amd/powerplay: fix bug that NULL checks are reversed.Rex Zhu1-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>
2016-01-04amdgpu/dce11: Add test for crtc < 0 to various DCEv11 functionsTom St Denis1-4/+4
To be consistent with other DCE11 functions test for crtc < 0. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-04amdgpu/dce11: Remove division from dce_v11_0_vblank_wait()Tom St Denis1-3/+5
Mimics odd behaviour where (i++ % 100 == 0) is true in the first iteration of each loop... Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-04amdgpu/vce3: Simplify vce_v3_0_hw_init and ensure both rings default to not ↵Tom St Denis1-15/+9
ready. Simplified the ring test and added logic to ensure rings are marked not ready by default. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2016-01-04amdgpu/vce3: Remove magic constants from harvest register masks.Tom St Denis1-4/+4
Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-04amdgpu/vce3: Simplify vce_v3_0_process_interrupt()Tom St Denis1-3/+1
Fold two cases into one for a LOC reduction. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2016-01-04amdgpu/vce3: Simplify vce_v3_0_soft_reset()Tom St Denis1-9/+2
LOC reduction and simplification. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2016-01-04amdgpu/vce3: Simplify idle and wait for idle codeTom St Denis1-25/+5
More LOC reductions in VCE3 code. This patch simplifies the is_idle and wait_for_idle logic. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2016-01-04amdgpu/vce3: Cleanup harvest config function.Tom St Denis1-14/+6
Basic LOC reduction. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2016-01-04drm/amdgpu: fix NULL in vm_grab_id while S3 backChunming Zhou2-2/+0
vm_manager_fini shouldn't be in suspend phase. Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
2016-01-04drm/amd/powerplay: precedence bug in init_non_clock_fields()Dan Carpenter1-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>
2016-01-04drm/amdgpu/cgs: cleanup some indentingDan Carpenter1-9/+9
This code is indented too far. Also we normally use spaces to align if statement conditions. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-04drm/amd/powerplay: fix a reversed conditionDan Carpenter1-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>
2016-01-04drm: powerplay: use div64_s64 instead of do_divArnd Bergmann1-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>
2015-12-24Backmerge drm-fixes merge into Linus's tree into drm-next.Dave Airlie3-22/+52
This merges '5b726e06d6e8309e5c9ef4109a32caf27c71dfc8' into drm-next Just to resolve some merges to make Daniel's life easier. Signed-off-by: DAve Airlie <airlied@redhat.com>
2015-12-23Merge branch 'drm-next-4.5' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie134-2251/+50559
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 ...
2015-12-21amd/powerplay: fix copy paste typo in hardwaremanager.cAlex Deucher1-1/+1
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-12-21amd/powerplay: disable powerplay by default initiallyAlex Deucher1-1/+1
Hopefully we can enable this by default once we get more upstream feedback on stability, etc. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-12-21amd/powerplay: don't enable ucode fan control if vbios has no fan tableAlex Deucher1-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>
2015-12-21drm/amd/powerplay: show gpu load when print gpu performance for Cz. (v2)Rex Zhu1-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>
2015-12-21drm/amd/powerplay: check whether need to enable thermal control. (v2)Rex Zhu1-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>
2015-12-21drm/amd/powerplay: add point check to avoid NULL point hang.Rex Zhu1-13/+47
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-12-21drm/amdgpu/powerplay: Program a calculated value as Deep Sleep clock.David Rokhvarg1-2/+4
This replaces programming of a hardcoded value. Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com>
2015-12-21drm/amd/powerplay: Don't return an error if fan table is missingAlex Deucher1-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>
2015-12-21drm/powerplay/hwmgr: log errors in tonga_hwmgr_backend_initAlex Deucher1-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>
2015-12-21drm/powerplay: add debugging output to processpptables.cAlex Deucher1-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>
2015-12-21drm/powerplay: add debugging output to tonga_processpptables.cAlex Deucher1-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>
2015-12-21amd/powerplay: Add structures required to report configuration changeEric Yang5-39/+139
Add required structures for amd_powerplay_display_configuration_change Signed-off-by: Eric Yang <eric.yang2@amd.com>
2015-12-21amd/powerplay: Fix get dal power levelVitaly Prosyak6-15/+12
Simplify data struct for get dal power level Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
2015-12-21amd\powerplay Implement get dal power levelVitaly Prosyak6-19/+85
Implement get dal power level and simple clock info Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>