summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* drm/amd/powerplay: add uvd/vce dpm enabling flag to fix the performance ↵Eric Huang2016-03-161-0/+5
| | | | | | | | | | issue for CZ Set the UVD and VCE DPM flags otherwise UVD and VCE DPM won't get enabled. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com> Cc: stable@vger.kernel.org
* drm/amdgpu: switch back to 32bit hw fences v2Christian König2016-03-162-32/+21
| | | | | | | | | | We don't need to extend them to 64bits any more, so avoid the extra overhead. v2: update commit message. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* drm/amdgpu: remove amdgpu_fence_is_signaledChristian König2016-03-161-25/+0
| | | | | | | | | It's just overhead to check the fence value when we signal them directly anyway. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* drm/amdgpu: drop the extra fence range check v2Christian König2016-03-161-3/+0
| | | | | | | | | | | Amdgpu doesn't support using scratch registers for fences any more. So we won't see values like 0xdeadbeef as fence value any more. v2: reschedule timer even if no change detected Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* drm/amdgpu: signal fences directly in amdgpu_fence_processChristian König2016-03-162-68/+31
| | | | | | | | | Because of the scheduler we need to signal all fences immediately anyway, so try to avoid the waitqueue overhead. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* drm/amdgpu: cleanup amdgpu_fence_wait_empty v2Christian König2016-03-161-54/+15
| | | | | | | | | | Just wait for last fence instead of waiting for the sequence manually. v2: don't use amdgpu_sched_jobs for the mask Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* drm/amdgpu: keep all fences in an RCU protected array v2Christian König2016-03-162-3/+31
| | | | | | | | | | | Just keep all HW fences in a RCU protected array as a first step to replace the wait queue. v2: update commit message, move fixes into separate patch. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* drm/amdgpu: add number of hardware submissions to amdgpu_fence_driver_init_ringChristian König2016-03-163-4/+12
| | | | | | | | Make this a parameter instead of using the global variable directly. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* drm/amdgpu: RCU protected amd_sched_fence_releaseChristian König2016-03-161-1/+22
| | | | | | | | Fences must be freed RCU protected, otherwise the reservation_object_*_rcu() functions can run into problems. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: RCU protected amdgpu_fence_releaseChristian König2016-03-161-1/+22
| | | | | | | | Fences must be freed RCU protected, otherwise the reservation_object_*_rcu() functions can run into problems. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: merge amdgpu_fence_process and _activityChristian König2016-03-161-19/+5
| | | | | | | No need to keep the two separate any more. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* drm/amdgpu: cleanup amdgpu_fence_activityChristian König2016-03-161-32/+3
| | | | | | | | The comment about the loop counter was never valid, even when you have multiple threads this loop only runs as long as the sequence increases. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* drm/amdgpu: move fence structure into amdgpu_fence.cChristian König2016-03-142-26/+25
| | | | | | | | No need to have that in the header file any more. 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: remove amdgpu_fence_wait_nextChristian König2016-03-142-21/+0
| | | | | | | | Not used any more. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: remove amdgpu_ring_from_fenceChristian König2016-03-142-25/+0
| | | | | | | | Not used any more. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: stop using the ring index in the SAChristian König2016-03-142-36/+22
| | | | | | | | | | The ring index will always collide as hash into the fence list, so use the context number instead. That can still cause collisions, but they are less likely than using ring indices. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: stop waiting on UVD messages before mapping themChristian König2016-03-141-7/+0
| | | | | | | | amdgpu_bo_kmap() now always waits for moves to finish. 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: always wait before kmap a BOChristian König2016-03-141-5/+11
| | | | | | | | | When a BO is currently moving we otherwise would blindly access the new location without checking. 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/radeon: refactor SI tiling table initializationJosh Poimboeuf2016-03-141-486/+439
| | | | | | | | Simplify the control flow of si_tiling_mode_table_init() similar to how it was done in gfx_v7_0.c and gfx_v8_0.c. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: refactor CIK tiling table initializationJosh Poimboeuf2016-03-141-1025/+666
| | | | | | | | | Simplify the control flow of cik_tiling_mode_table_init() similar to how it was done in gfx_v7_0.c and gfx_v8_0.c. Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: allow write access to mapped userptrsChristian König2016-03-141-5/+3
| | | | | | | | With the updated MMU notifier we should also be able to handle the writeback case correctly. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: use pp_endian.h for TongaAlex Deucher2016-03-141-11/+1
| | | | | | | | Drop local versions of these macros. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Ken Wang <Qingqing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: use pp_endian.h for FijiAlex Deucher2016-03-141-11/+1
| | | | | | | | Drop local versions of these macros. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Ken Wang <Qingqing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add a common pp endian headerAlex Deucher2016-03-141-0/+38
| | | | | | | | | To replace the duplicated versions of this in all asic variants. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Ken Wang <Qingqing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: mv avfs status to smumgr.hrezhu2016-03-142-18/+21
| | | | | Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: rework fbdev handling on chips with no connectorsAlex Deucher2016-03-142-8/+17
| | | | | | | | | | | Move all the logic to radeon_fb.c and add checks to functions called frome elsewhere. bug: https://bugzilla.kernel.org/show_bug.cgi?id=112781 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
* drm/amdgpu: split pipeline sync out of SDMA vm_flush() as wellChristian König2016-03-103-20/+53
| | | | | | | | Code it similar to how we did it for the gfx and compute engines. 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: Revert "add mutex for ba_va->valids/invalids"Christian König2016-03-092-12/+6
| | | | | | | | | | | Not needed any more because we need to protect the elements on the list anyway. This reverts commit 38bf516c75b4ef0f5c716e05fa9baab7c52d6c39. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: Revert "add lock for interval tree in vm"Christian König2016-03-092-15/+2
| | | | | | | | | | | Not needed any more because we need to protect the elements on the list anyway. This reverts commit fe237ed7efec8ac147a4572fdf81173a7f8ddda7. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: Revert "add spin lock to protect freed list in vm (v3)"Christian König2016-03-091-13/+3
| | | | | | | | | | | Not needed any more because we need to protect the elements on the list anyway. This reverts commit dae6ecf9e6c9b677e577826c3ac665c6dd9c490b. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: reserve the PD during unmap and removeChristian König2016-03-091-10/+24
| | | | | | | | | | We not only need to protect the mapping tree and freed list itself, but also the items on those list. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: Fix two bugs in amdgpu_vm_bo_split_mappingFelix Kuehling2016-03-091-2/+2
| | | | | | | | | Off-by-one: last is inclusive, so the maximum is start + max_size - 1 Wrong unit: addr is in bytes, max_size is in pages Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: Don't drop DP 2.7 Ghz link setup on some cards.Mario Kleiner2016-03-091-2/+4
| | | | | | | | | | | | | | | | | | As observed on Apple iMac10,1, DCE-3.2, RV-730, link rate of 2.7 Ghz is not selected, because the args.v1.ucConfig flag setting for 2.7 Ghz gets overwritten by a following assignment of the transmitter to use. Move link rate setup a few lines down to fix this. In practice this didn't have any positive or negative effect on display setup on the tested iMac10,1 so i don't know if backporting to stable makes sense or not. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
* drm/amdgpu: disable runtime pm on PX laptops without dGPU power controlAlex Deucher2016-03-092-5/+11
| | | | | | | | | | Some PX laptops don't provide an ACPI method to control dGPU power. On those systems, the driver is responsible for handling the dGPU power state. Disable runtime PM on them until support for this is implemented. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
* drm/radeon: disable runtime pm on PX laptops without dGPU power controlAlex Deucher2016-03-092-5/+11
| | | | | | | | | | Some PX laptops don't provide an ACPI method to control dGPU power. On those systems, the driver is responsible for handling the dGPU power state. Disable runtime PM on them until support for this is implemented. 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/amdgpu: Fix indentation in do_set_base() (DCEv8)Tom St Denis2016-03-081-4/+3
| | | | | | 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/amdgpu: make afmt_init cleanup if alloc fails (DCEv8)Tom St Denis2016-03-081-2/+12
| | | | | | | | If the allocation fails free memory and return error code. 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/amdgpu: Move config init flag to bottom of sw_init (DCEv8)Tom St Denis2016-03-081-3/+2
| | | | | | 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/amdgpu: Don't proceed into audio_fini if audio is disabled (DCEv8)Tom St Denis2016-03-081-0/+3
| | | | | | 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/amdgpu: Fix identation in do_set_base() (DCEv10)Tom St Denis2016-03-081-4/+3
| | | | | | 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/amdgpu: Make afmt_init cleanup if alloc fails (DCEv10)Tom St Denis2016-03-081-2/+12
| | | | | | | | | Make the function free memory and return an error code if the allocation fails. 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/amdgpu: Move initialized flag to bottom of sw_init (DCEv10)Tom St Denis2016-03-081-3/+2
| | | | | | 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/amdgpu: Don't proceed in audio_fini if disabled (DCEv10)Tom St Denis2016-03-081-0/+3
| | | | | | | | If audio is disabled we shouldn't proceed into the fini function. 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/amdgpu: Fix indentation in dce_v11_0_crtc_do_set_base()Tom St Denis2016-03-081-4/+3
| | | | | | 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/amdgpu: Make afmt_init() cleanup if alloc fails (DCEv11)Tom St Denis2016-03-081-2/+12
| | | | | | | | | | Updated DCEv11 afmt_init to cleanup if any kzalloc fails and then return an error code. Don't continue initializing the audio stack in that case. 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/amdgpu: Move init flag to after init in sw_init() (DCEv11)Tom St Denis2016-03-081-3/+3
| | | | | | | | Don't set config_init to true until all config statements pass. 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/amdgpu: Whitespace typo fix in sw_init (DCEv11)Tom St Denis2016-03-081-2/+2
| | | | | | 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/amdgpu: Don't proceed in audio_fini in DCEv11 if disabledTom St Denis2016-03-081-0/+3
| | | | | | | | | If amdgpu_audio is disabled then the audio structure is not initialized so we shouldn't read it in the fini function. 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: move get_user_pages out of amdgpu_ttm_tt_pin_userptr v6Christian König2016-03-086-24/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That avoids lock inversion between the BO reservation lock and the anon_vma lock. v2: * Changed amdgpu_bo_list_entry.user_pages to an array of pointers * Lock mmap_sem only for get_user_pages * Added invalidation of unbound userpointer BOs * Fixed memory leak and page reference leak v3 (chk): * Revert locking mmap_sem only for_get user_pages * Revert adding invalidation of unbound userpointer BOs * Sanitize and fix error handling v4 (chk): * Init userpages pointer everywhere. * Fix error handling when get_user_pages() fails. * Add invalidation of unbound userpointer BOs again. v5 (chk): * Add maximum number of tries. v6 (chk): * Fix error handling when we run out of tries. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> (v4) Acked-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu: if a GDS switch is needed emit a pipeline sync as wellChristian König2016-03-081-10/+12
| | | | | | | | Otherwise we might change the GDS settings while they are still in use. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>