GitHub/LineageOS/android_kernel_motorola_exynos9610.git
8 years agodrm/amd/powerplay: mv avfs status to smumgr.h
rezhu [Mon, 16 Nov 2015 02:24:17 +0000 (10:24 +0800)]
drm/amd/powerplay: mv avfs status to smumgr.h

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/radeon: rework fbdev handling on chips with no connectors
Alex Deucher [Thu, 10 Mar 2016 20:55:26 +0000 (15:55 -0500)]
drm/radeon: rework fbdev handling on chips with no connectors

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
8 years agodrm/amdgpu: split pipeline sync out of SDMA vm_flush() as well
Christian König [Tue, 8 Mar 2016 13:11:00 +0000 (14:11 +0100)]
drm/amdgpu: split pipeline sync out of SDMA vm_flush() as well

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>
8 years agodrm/amdgpu: Revert "add mutex for ba_va->valids/invalids"
Christian König [Tue, 8 Mar 2016 17:03:27 +0000 (18:03 +0100)]
drm/amdgpu: Revert "add mutex for ba_va->valids/invalids"

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>
8 years agodrm/amdgpu: Revert "add lock for interval tree in vm"
Christian König [Tue, 8 Mar 2016 16:58:35 +0000 (17:58 +0100)]
drm/amdgpu: Revert "add lock for interval tree in vm"

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>
8 years agodrm/amdgpu: Revert "add spin lock to protect freed list in vm (v3)"
Christian König [Tue, 8 Mar 2016 16:52:01 +0000 (17:52 +0100)]
drm/amdgpu: Revert "add spin lock to protect freed list in vm (v3)"

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>
8 years agodrm/amdgpu: reserve the PD during unmap and remove
Christian König [Tue, 8 Mar 2016 16:47:46 +0000 (17:47 +0100)]
drm/amdgpu: reserve the PD during unmap and remove

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>
8 years agodrm/amdgpu: Fix two bugs in amdgpu_vm_bo_split_mapping
Felix Kuehling [Fri, 4 Mar 2016 00:13:20 +0000 (19:13 -0500)]
drm/amdgpu: Fix two bugs in amdgpu_vm_bo_split_mapping

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>
8 years agodrm/radeon: Don't drop DP 2.7 Ghz link setup on some cards.
Mario Kleiner [Sun, 6 Mar 2016 01:39:53 +0000 (02:39 +0100)]
drm/radeon: Don't drop DP 2.7 Ghz link setup on some cards.

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
8 years agoMAINTAINERS: update radeon entry to include amdgpu as well
Alex Deucher [Thu, 3 Mar 2016 16:49:34 +0000 (11:49 -0500)]
MAINTAINERS: update radeon entry to include amdgpu as well

Both are maintained by same team.

Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: disable runtime pm on PX laptops without dGPU power control
Alex Deucher [Wed, 2 Mar 2016 17:10:20 +0000 (12:10 -0500)]
drm/amdgpu: disable runtime pm on PX laptops without dGPU power control

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
8 years agodrm/radeon: disable runtime pm on PX laptops without dGPU power control
Alex Deucher [Wed, 2 Mar 2016 16:47:29 +0000 (11:47 -0500)]
drm/radeon: disable runtime pm on PX laptops without dGPU power control

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
8 years agodrm/amd/amdgpu: Fix indentation in do_set_base() (DCEv8)
Tom St Denis [Thu, 3 Mar 2016 14:46:41 +0000 (09:46 -0500)]
drm/amd/amdgpu: Fix indentation in do_set_base() (DCEv8)

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>
8 years agodrm/amd/amdgpu: make afmt_init cleanup if alloc fails (DCEv8)
Tom St Denis [Thu, 3 Mar 2016 14:45:29 +0000 (09:45 -0500)]
drm/amd/amdgpu: make afmt_init cleanup if alloc fails (DCEv8)

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>
8 years agodrm/amd/amdgpu: Move config init flag to bottom of sw_init (DCEv8)
Tom St Denis [Thu, 3 Mar 2016 14:42:43 +0000 (09:42 -0500)]
drm/amd/amdgpu: Move config init flag to bottom of sw_init (DCEv8)

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>
8 years agodrm/amd/amdgpu: Don't proceed into audio_fini if audio is disabled (DCEv8)
Tom St Denis [Thu, 3 Mar 2016 14:31:49 +0000 (09:31 -0500)]
drm/amd/amdgpu: Don't proceed into audio_fini if audio is disabled (DCEv8)

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>
8 years agodrm/amd/amdgpu: Fix identation in do_set_base() (DCEv10)
Tom St Denis [Thu, 3 Mar 2016 14:25:05 +0000 (09:25 -0500)]
drm/amd/amdgpu: Fix identation in do_set_base() (DCEv10)

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>
8 years agodrm/amd/amdgpu: Make afmt_init cleanup if alloc fails (DCEv10)
Tom St Denis [Thu, 3 Mar 2016 14:23:48 +0000 (09:23 -0500)]
drm/amd/amdgpu: Make afmt_init cleanup if alloc fails (DCEv10)

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>
8 years agodrm/amd/amdgpu: Move initialized flag to bottom of sw_init (DCEv10)
Tom St Denis [Thu, 3 Mar 2016 14:21:44 +0000 (09:21 -0500)]
drm/amd/amdgpu: Move initialized flag to bottom of sw_init (DCEv10)

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>
8 years agodrm/amd/amdgpu: Don't proceed in audio_fini if disabled (DCEv10)
Tom St Denis [Thu, 3 Mar 2016 14:20:10 +0000 (09:20 -0500)]
drm/amd/amdgpu: Don't proceed in audio_fini if disabled (DCEv10)

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>
8 years agodrm/amd/amdgpu: Fix indentation in dce_v11_0_crtc_do_set_base()
Tom St Denis [Wed, 2 Mar 2016 17:07:02 +0000 (12:07 -0500)]
drm/amd/amdgpu: Fix indentation in dce_v11_0_crtc_do_set_base()

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>
8 years agodrm/amd/amdgpu: Make afmt_init() cleanup if alloc fails (DCEv11)
Tom St Denis [Wed, 2 Mar 2016 14:19:57 +0000 (09:19 -0500)]
drm/amd/amdgpu: Make afmt_init() cleanup if alloc fails (DCEv11)

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>
8 years agodrm/amd/amdgpu: Move init flag to after init in sw_init() (DCEv11)
Tom St Denis [Wed, 2 Mar 2016 14:14:40 +0000 (09:14 -0500)]
drm/amd/amdgpu: Move init flag to after init in sw_init() (DCEv11)

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>
8 years agodrm/amd/amdgpu: Whitespace typo fix in sw_init (DCEv11)
Tom St Denis [Wed, 2 Mar 2016 14:10:50 +0000 (09:10 -0500)]
drm/amd/amdgpu: Whitespace typo fix in sw_init (DCEv11)

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>
8 years agodrm/amd/amdgpu: Don't proceed in audio_fini in DCEv11 if disabled
Tom St Denis [Wed, 2 Mar 2016 13:58:07 +0000 (08:58 -0500)]
drm/amd/amdgpu: Don't proceed in audio_fini in DCEv11 if disabled

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>
8 years agodrm/amdgpu: move get_user_pages out of amdgpu_ttm_tt_pin_userptr v6
Christian König [Tue, 23 Feb 2016 11:36:59 +0000 (12:36 +0100)]
drm/amdgpu: move get_user_pages out of amdgpu_ttm_tt_pin_userptr v6

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>
8 years agodrm/amdgpu: if a GDS switch is needed emit a pipeline sync as well
Christian König [Tue, 1 Mar 2016 14:51:53 +0000 (15:51 +0100)]
drm/amdgpu: if a GDS switch is needed emit a pipeline sync as well

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>
8 years agodrm/amdgpu: split pipeline sync and vm flush
Christian König [Tue, 1 Mar 2016 14:42:52 +0000 (15:42 +0100)]
drm/amdgpu: split pipeline sync and vm flush

This allows us to use the pipeline sync for other tasks as well.

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>
8 years agodrm/amdgpu: switch the GDS only on demand v2
Christian König [Tue, 1 Mar 2016 14:09:25 +0000 (15:09 +0100)]
drm/amdgpu: switch the GDS only on demand v2

Switching the GDS space to often seems to be problematic.

This patch together with the following can avoid VM faults on context switch.

v2: extend commit message a bit

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Reviewed-by: Chunming Zhou <david1.zhou@amd.com> (v1)
8 years agodrm/amdgpu: move the GDS switch into vm flush as well
Christian König [Tue, 1 Mar 2016 12:34:49 +0000 (13:34 +0100)]
drm/amdgpu: move the GDS switch into vm flush as well

After all it's an operation on the VMID.

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>
8 years agodrm/amdgpu: return the common fence from amdgpu_fence_emit
Christian König [Tue, 16 Feb 2016 16:39:39 +0000 (17:39 +0100)]
drm/amdgpu: return the common fence from amdgpu_fence_emit

Try to avoid using the hardware specific fences even more.

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>
8 years agodrm/amdgpu: add slap cache for sync objects as well
Christian König [Tue, 16 Feb 2016 10:24:58 +0000 (11:24 +0100)]
drm/amdgpu: add slap cache for sync objects as well

We need them all the time.

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>
8 years agodrm/amdgpu: remove HW fence owner
Christian König [Tue, 16 Feb 2016 09:57:10 +0000 (10:57 +0100)]
drm/amdgpu: remove HW fence owner

Not used any more since we now always use the sheduler.

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>
8 years agodrm/amdgpu: cleanup the sync code
Christian König [Tue, 16 Feb 2016 15:23:02 +0000 (16:23 +0100)]
drm/amdgpu: cleanup the sync code

No need for two functions doing the same, remove one and
add comments what those functions actually do.

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>
8 years agodrm/amdgpu: prevent get_user_pages recursion
Christian König [Thu, 3 Mar 2016 13:24:57 +0000 (14:24 +0100)]
drm/amdgpu: prevent get_user_pages recursion

Remember the tasks which are inside get_user_pages()
and ignore MMU callbacks from there.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: group userptr in the BO list v2
Christian König [Mon, 22 Feb 2016 14:40:59 +0000 (15:40 +0100)]
drm/amdgpu: group userptr in the BO list v2

We need them together with the next patch.

v2: Don't take bo reference twice

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>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: sync to the active user on reusing a VMID
Christian König [Thu, 3 Mar 2016 09:50:01 +0000 (10:50 +0100)]
drm/amdgpu: sync to the active user on reusing a VMID

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: Clear HDP_MISC_CNTL.HDP_FLUSH_INVALIDATE_CACHE
Chunming Zhou [Thu, 3 Mar 2016 06:47:54 +0000 (14:47 +0800)]
drm/amdgpu: Clear HDP_MISC_CNTL.HDP_FLUSH_INVALIDATE_CACHE

So that we can invalidate and flush the HDP independently

Signed-off-by: Chunming Zhou <David1.Zhou@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>
8 years agodrm/amdgpu: add hdp invalidation for sdma v3_0
Chunming Zhou [Thu, 3 Mar 2016 04:06:45 +0000 (12:06 +0800)]
drm/amdgpu: add hdp invalidation for sdma v3_0

Signed-off-by: Chunming Zhou <David1.Zhou@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>
8 years agodrm/amdgpu: add hdp invalidation for sdma v2_4
Chunming Zhou [Thu, 3 Mar 2016 04:06:34 +0000 (12:06 +0800)]
drm/amdgpu: add hdp invalidation for sdma v2_4

Signed-off-by: Chunming Zhou <David1.Zhou@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>
8 years agodrm/amdgpu: add hdp invalidation for cik sdma
Chunming Zhou [Thu, 3 Mar 2016 04:05:44 +0000 (12:05 +0800)]
drm/amdgpu: add hdp invalidation for cik sdma

Signed-off-by: Chunming Zhou <David1.Zhou@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>
8 years agodrm/amdgpu: add hdp invalidation for gfx8
Chunming Zhou [Thu, 3 Mar 2016 03:55:13 +0000 (11:55 +0800)]
drm/amdgpu: add hdp invalidation for gfx8

Signed-off-by: Chunming Zhou <David1.Zhou@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>
8 years agodrm/amdgpu: add hdp invalidation for gfx7
Chunming Zhou [Thu, 3 Mar 2016 03:46:40 +0000 (11:46 +0800)]
drm/amdgpu: add hdp invalidation for gfx7

Signed-off-by: Chunming Zhou <David1.Zhou@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>
8 years agodrm/amdgpu: add hdp_invalidate function
Chunming Zhou [Thu, 3 Mar 2016 03:38:48 +0000 (11:38 +0800)]
drm/amdgpu: add hdp_invalidate function

It's called after emitting ibs.

Signed-off-by: Chunming Zhou <David1.Zhou@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>
8 years agodrm/amdgpu: wait engine idle before vm flush for sdma
Chunming Zhou [Wed, 2 Mar 2016 03:30:31 +0000 (11:30 +0800)]
drm/amdgpu: wait engine idle before vm flush for sdma

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: Switch to drm_vblank_on/off (v2)
Daniel Vetter [Thu, 21 Jan 2016 10:08:58 +0000 (11:08 +0100)]
drm/amdgpu: Switch to drm_vblank_on/off (v2)

Equivalent change to the radeon driver.

Note that with radeon this caught a bug in the dri3 DDX
implementation, which asked for vblank interrupts when the pipe is
off. That bug needs to be fixed before we can merge this patch (if
amdgpu is affected too). Michel discovered this one.

v2: agd: switch dce8 as well.

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/radeon: Switch to drm_vblank_on/off
Daniel Vetter [Thu, 21 Jan 2016 10:08:57 +0000 (11:08 +0100)]
drm/radeon: Switch to drm_vblank_on/off

These should be functionally equivalent to the older per/post modeset
functions, except that they block out drm_vblank_get right away.
There's only the clock adjusting code (outside of pageflips) in
readone which uses drm_vblank_get. But that code doesn't synchronize
against concurrent modesets and instead handles any such races by
waiting for the right vblank to arrive with a short timetout.

The longer-term plan here is to switch all kms drivers to
drm_vblank_on/off so that common code like pending event cleanup can
be done there, while drm_vblank_pre/post_modeset will be purely
drm internal for the old UMS ioctl.

Note that with this patch Michel uncovered a bug in the dri3
implementation of the DDX (it does vblank waits when the pipe is off),
which had to be fixed first.

Cc: Michel Dänzer <michel.daenzer@amd.com>
Acked-and-tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: delete set-but-not-read member has_uvd from amdgpu_device
Nils Wallménius [Sat, 5 Mar 2016 05:59:51 +0000 (06:59 +0100)]
drm/amdgpu: delete set-but-not-read member has_uvd from amdgpu_device

Clean up leftover from radeon code.

Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/ci: sync up with dpm changes from radeon
Alex Deucher [Thu, 3 Mar 2016 17:27:46 +0000 (12:27 -0500)]
drm/amdgpu/ci: sync up with dpm changes from radeon

Looks like radeon commit:
d3052b8ce8a308d2086519fa5f7c4966257ea184
was missed.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/ci: remove redundant pcie setup
Alex Deucher [Thu, 3 Mar 2016 17:28:37 +0000 (12:28 -0500)]
drm/amdgpu/ci: remove redundant pcie setup

Looks like this got leftover by accident.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/ci: drop some old thermal setup
Alex Deucher [Thu, 3 Mar 2016 16:28:24 +0000 (11:28 -0500)]
drm/amdgpu/ci: drop some old thermal setup

This was leftover from a long time ago and is not longer needed
since the thermal controller setup code was added.  Additional
mucking with the thermal interrupts can cause spurious thermal
events which can lead to unnecessary state changes.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: refine the dmesg info.
Rex Zhu [Thu, 21 Jan 2016 11:33:56 +0000 (19:33 +0800)]
drm/amd/powerplay: refine the dmesg info.

this do not mean driver error.

Change-Id: If2080eb4b79fc6389280b7c75cb7998d77090739
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: fix rb bitmap & cu bitmap calculation
Flora Cui [Thu, 3 Mar 2016 04:59:49 +0000 (12:59 +0800)]
drm/amdgpu: fix rb bitmap & cu bitmap calculation

Fix some copy paste typos.

Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: trace the pd_addr in vm_grab_id as well
Christian König [Fri, 26 Feb 2016 15:18:36 +0000 (16:18 +0100)]
drm/amdgpu: trace the pd_addr in vm_grab_id as well

Makes matching it to the flushes much easier.

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>
8 years agodrm/amdgpu: fix VM faults caused by vm_grab_id() v4
Christian König [Fri, 26 Feb 2016 15:18:26 +0000 (16:18 +0100)]
drm/amdgpu: fix VM faults caused by vm_grab_id() v4

The owner must be per ring as long as we don't
support sharing VMIDs per process. Also move the
assigned VMID and page directory address into the
IB structure.

v3: assign the VMID to all IBs, not just the first one.
v4: use correct pointer for owner

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>
8 years agodrm/amdgpu: update radeon acpi header
Alex Deucher [Thu, 25 Feb 2016 06:47:53 +0000 (01:47 -0500)]
drm/amdgpu: update radeon acpi header

Add some new defs for ATPX.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/radeon: update radeon acpi header
Alex Deucher [Thu, 25 Feb 2016 06:45:56 +0000 (01:45 -0500)]
drm/radeon: update radeon acpi header

Add some new defs for ATPX.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd: cleanup get_mfd_cell_dev()
Dan Carpenter [Thu, 25 Feb 2016 07:47:10 +0000 (10:47 +0300)]
drm/amd: cleanup get_mfd_cell_dev()

It's simpler to just use snprintf() to print this to one buffer instead
of using strcpy() and strcat().  Also using snprintf() is slightly safer
than using sprintf().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: fix error handling in amdgpu_bo_list_set
Christian König [Mon, 22 Feb 2016 14:11:56 +0000 (15:11 +0100)]
drm/amdgpu: fix error handling in amdgpu_bo_list_set

Don't leak BOs in case of some error.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: fix code style warning.
Rex Zhu [Thu, 25 Feb 2016 09:48:24 +0000 (17:48 +0800)]
drm/amd/powerplay: fix code style warning.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd: Do not make DRM_AMD_ACP default to y
Geert Uytterhoeven [Wed, 24 Feb 2016 08:13:45 +0000 (09:13 +0100)]
drm/amd: Do not make DRM_AMD_ACP default to y

By default, not only this driver is enabled on all platforms, but also
generic PM Domains and Multi-Function Devices.

Drop the "default y" to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/gfx: fix off by one in rb rework (v2)
Alex Deucher [Wed, 24 Feb 2016 15:06:06 +0000 (10:06 -0500)]
drm/amdgpu/gfx: fix off by one in rb rework (v2)

When I reworked this code, I messed up num rb count.

v2: use hweight32

Reviewed-by: Ken Wang <Qingquing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agoMerge branch 'drm-rockchip-next-2016-02-18' of https://github.com/markyzq/kernel...
Dave Airlie [Fri, 19 Feb 2016 03:10:18 +0000 (13:10 +1000)]
Merge branch 'drm-rockchip-next-2016-02-18' of https://github.com/markyzq/kernel-drm-rockchip into drm-next

add Innosilicon HDMI support.

* 'drm-rockchip-next-2016-02-18' of https://github.com/markyzq/kernel-drm-rockchip:
  dt-bindings: add document for Innosilicon HDMI on Rockchip platform
  drm/rockchip: hdmi: add Innosilicon HDMI support

8 years agoMerge tag 'drm-vc4-next-2016-02-17' of github.com:anholt/linux into drm-next
Dave Airlie [Fri, 19 Feb 2016 02:51:43 +0000 (12:51 +1000)]
Merge tag 'drm-vc4-next-2016-02-17' of github.com:anholt/linux into drm-next

This pull request brings in overlay plane support for vc4.

* tag 'drm-vc4-next-2016-02-17' of github.com:anholt/linux:
  drm/vc4: Add support for YUV planes.
  drm/vc4: Add support a few more RGB display plane formats.
  drm/vc4: Add support for scaling of display planes.
  drm/vc4: Fix which value is being used for source image size.
  drm/vc4: Add more display planes to each CRTC.
  drm/vc4: Make the CRTCs cooperate on allocating display lists.
  drm/vc4: Add a proper short-circut path for legacy cursor updates.
  drm/vc4: Move the plane clipping/scaling setup to a separate function.
  drm/vc4: Add missing __iomem annotation to hw_dlist.
  drm/vc4: Improve comments on vc4_plane_state members.

8 years agoMerge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Fri, 19 Feb 2016 01:13:01 +0000 (11:13 +1000)]
Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next

First radeon and amdgpu pull request for 4.6.  Highlights:
- ACP support for APUs with i2s audio
- CS ioctl optimizations
- GPU scheduler optimizations
- GPUVM optimizations
- Initial GPU reset support (not enabled yet)
- New powerplay sysfs interface for manually selecting clocks
- Powerplay fixes
- Virtualization fixes
- Removal of hw semaphore support
- Lots of other misc fixes and cleanups

* 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux: (118 commits)
  drm/amdgpu: Don't call interval_tree_remove in amdgpu_mn_destroy
  drm/amdgpu: Fix race condition in amdgpu_mn_unregister
  drm/amdgpu: cleanup gem init/finit
  drm/amdgpu: rework GEM info printing
  drm/amdgpu: print the GPU offset as well in gem_info
  drm/amdgpu: optionally print the pin count in gem_info as well
  drm/amdgpu: print the BO size only once in amdgpu_gem_info
  drm/amdgpu: print pid as integer
  drm/amdgpu: remove page flip work queue v3
  drm/amdgpu: stop blocking for page filp fences
  drm/amdgpu: stop calling amdgpu_gpu_reset from the flip code
  drm/amdgpu: remove fence reset detection leftovers
  drm/amdgpu: Fix race condition in MMU notifier release
  drm/radeon: Fix WARN_ON if DRM_DP_AUX_CHARDEV is enabled
  drm/amdgpu/vi: move uvd tiling config setup into uvd code
  drm/amdgpu/vi: move sdma tiling config setup into sdma code
  drm/amdgpu/cik: move uvd tiling config setup into uvd code
  drm/amdgpu/cik: move sdma tiling config setup into sdma code
  drm/amdgpu/gfx7: rework gpu_init()
  drm/amdgpu/gfx: clean up harvest configuration (v2)
  ...

8 years agoMerge tag 'topic/drm-misc-2016-02-18' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Fri, 19 Feb 2016 00:57:44 +0000 (10:57 +1000)]
Merge tag 'topic/drm-misc-2016-02-18' of git://anongit.freedesktop.org/drm-intel into drm-next

Misc stuff all over:
- more mode_fixup removal from Carlos, there's another final pile still
  left.
- final bits of vgaswitcheroo from Lukas for apple gmux, we're still
  discussing an api cleanup patch to make it a bit more abuse-safe as a
  follow-up
- dp aux interface for userspace for tools&tests from Rafael Antognolli
- actual interface parts for dma-buf flushing for userspace mmap
- few small bits all over

- vgaswitcheroo support for apple gmux from Lukas Wunner
- checks for ->mode_fixup in non-atomic helpers from Carlos Palminha, plus
  removing dummy funcs from drivers. Carlos promised to follow up with
  more, since there's lots more silly dummy functions around.
- dma-buf patches from Tiago, except the ioctl itself (that needed a
  respin to address review from David Herrmann)
- encoder mask for atomic from Maarten
- bunch of random things all over.

* tag 'topic/drm-misc-2016-02-18' of git://anongit.freedesktop.org/drm-intel: (57 commits)
  drm/udl: Use module_usb_driver
  drm: fixes crct set_mode when crtc mode_fixup is null.
  drm/tilcdc: removed optional dummy encoder mode_fixup function.
  drm/sti: removed optional dummy encoder mode_fixup function.
  drm/rockchip: removed optional dummy encoder mode_fixup function.
  drm/qxl: removed optional dummy encoder mode_fixup function.
  drm/mgag200: removed optional dummy encoder mode_fixup function.
  drm/msm/mdp: removed optional dummy encoder mode_fixup function.
  drm/imx: removed optional dummy encoder mode_fixup function.
  drm/gma500: removed optional dummy encoder mode_fixup function.
  drm/radeon: removed optional dummy encoder mode_fixup function.
  drm/cirrus: removed optional dummy encoder mode_fixup function.
  drm/bochs: removed optional dummy encoder mode_fixup function.
  drm/ast: removed optional dummy encoder mode_fixup function.
  drm/amdgpu: removed optional dummy encoder mode_fixup function.
  drm/exynos: removed optional dummy encoder mode_fixup function.
  drm/udl: removed optional dummy encoder mode_fixup function.
  drm/virtio: removed optional dummy encoder mode_fixup function.
  drm/fb_helper: Use add_one_connector in add_all_connectors.
  drm/fb_helper: Use correct allocation count for arrays.
  ...

8 years agodt-bindings: add document for Innosilicon HDMI on Rockchip platform
Yakir Yang [Fri, 29 Jan 2016 07:10:33 +0000 (15:10 +0800)]
dt-bindings: add document for Innosilicon HDMI on Rockchip platform

Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
8 years agodrm/rockchip: hdmi: add Innosilicon HDMI support
Yakir Yang [Wed, 3 Feb 2016 09:44:57 +0000 (17:44 +0800)]
drm/rockchip: hdmi: add Innosilicon HDMI support

The Innosilicon HDMI is a low power HDMI 1.4 transmitter
IP, and it have been integrated on some rockchip CPUs
(like RK3036, RK312x).

Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
8 years agodrm/amdgpu: Don't call interval_tree_remove in amdgpu_mn_destroy
Felix Kuehling [Tue, 16 Feb 2016 20:31:30 +0000 (15:31 -0500)]
drm/amdgpu: Don't call interval_tree_remove in amdgpu_mn_destroy

rbtree_postorder_for_each_entry_safe can skip over some entries if
the tree is rebalanced in interval_tree_remove. interval_tree_remove
is also redundant when the tree is just about to be freed.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agodrm/amdgpu: Fix race condition in amdgpu_mn_unregister
Felix Kuehling [Tue, 16 Feb 2016 20:29:23 +0000 (15:29 -0500)]
drm/amdgpu: Fix race condition in amdgpu_mn_unregister

Exchange locking order of adev->mn_lock and mm_sem, so that
rmn->mm->mmap_sem can be taken safely, protected by adev->mn_lock,
when amdgpu_mn_destroy runs concurrently.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agodrm/udl: Use module_usb_driver
Amitoj Kaur Chawla [Wed, 17 Feb 2016 12:13:27 +0000 (17:43 +0530)]
drm/udl: Use module_usb_driver

Macro module_usb_driver is used for drivers whose init and exit paths
only register and unregister to usb API. So remove boilerplate code to
make code simpler by using module_usb_driver.

This change was made with the help of the following Coccinelle
semantic patch:

//<smpl>
@a@
identifier f, x;
@@
-static f(...) { return usb_register(&x); }

@b depends on a@
identifier e, a.x;
@@
-static e(...) { usb_deregister(&x); }

@c depends on a && b@
identifier a.f;
declarer name module_init;
@@
-module_init(f);

@d depends on a && b && c@
identifier b.e, a.x;
declarer name module_exit;
declarer name module_usb_driver;
@@
-module_exit(e);
+module_usb_driver(x);
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160217121327.GA29682@amitoj-Inspiron-3542
8 years agoMerge branch 'topic/mode_fixup-optional' into topic/drm-misc
Daniel Vetter [Wed, 17 Feb 2016 13:15:42 +0000 (14:15 +0100)]
Merge branch 'topic/mode_fixup-optional' into topic/drm-misc

Pull in pile of patches from Carlos to remove now redundant mode_fixup
hooks for encoders.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
8 years agodrm/amdgpu: cleanup gem init/finit
Christian König [Mon, 15 Feb 2016 15:59:57 +0000 (16:59 +0100)]
drm/amdgpu: cleanup gem init/finit

Remove the double housekeeping and use something sane to
forcefuly delete BOs on unload.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: rework GEM info printing
Christian König [Mon, 15 Feb 2016 14:23:00 +0000 (15:23 +0100)]
drm/amdgpu: rework GEM info printing

Print BOs grouped per client.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: print the GPU offset as well in gem_info
Christian König [Mon, 15 Feb 2016 16:36:22 +0000 (17:36 +0100)]
drm/amdgpu: print the GPU offset as well in gem_info

To easily find which memory is used.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: optionally print the pin count in gem_info as well
Christian König [Mon, 15 Feb 2016 11:41:37 +0000 (12:41 +0100)]
drm/amdgpu: optionally print the pin count in gem_info as well

Usefull when debugging page flipping.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: print the BO size only once in amdgpu_gem_info
Christian König [Mon, 15 Feb 2016 12:01:23 +0000 (13:01 +0100)]
drm/amdgpu: print the BO size only once in amdgpu_gem_info

Splitting it into KB/MB is just confusing.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: print pid as integer
Christian König [Mon, 15 Feb 2016 14:28:34 +0000 (15:28 +0100)]
drm/amdgpu: print pid as integer

Not sure why somebody thought that this is a long.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: remove page flip work queue v3
Christian König [Thu, 11 Feb 2016 16:31:37 +0000 (17:31 +0100)]
drm/amdgpu: remove page flip work queue v3

Just use the system queue now that we don't block any more.

v2: handle DAL as well.
v3: agd: split DAL changes out

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Mykola Lysenko <mykola.lysenko@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com> (v1)
8 years agodrm/amdgpu: stop blocking for page filp fences
Christian König [Thu, 11 Feb 2016 14:48:30 +0000 (15:48 +0100)]
drm/amdgpu: stop blocking for page filp fences

Just register an callback and reschedule the work item if necessary.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: stop calling amdgpu_gpu_reset from the flip code
Christian König [Thu, 11 Feb 2016 13:51:47 +0000 (14:51 +0100)]
drm/amdgpu: stop calling amdgpu_gpu_reset from the flip code

We don't return -EDEADLK any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: remove fence reset detection leftovers
Christian König [Thu, 11 Feb 2016 13:42:33 +0000 (14:42 +0100)]
drm/amdgpu: remove fence reset detection leftovers

wait_event() never returns before the fence was signaled.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: Fix race condition in MMU notifier release
Felix Kuehling [Thu, 14 Jan 2016 05:35:08 +0000 (00:35 -0500)]
drm/amdgpu: Fix race condition in MMU notifier release

The release notifier can get called a second time from
mmu_notifier_unregister depending on a race between
__mmu_notifier_release and amdgpu_mn_destroy. Use
mmu_notifier_unregister_no_release to avoid this.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agodrm/vc4: Add support for YUV planes.
Eric Anholt [Wed, 30 Dec 2015 20:25:44 +0000 (12:25 -0800)]
drm/vc4: Add support for YUV planes.

This supports 420 and 422 subsampling with 2 or 3 planes, tested with
modetest.  It doesn't set up chroma subsampling position (which it
appears KMS doesn't deal with yet).

The LBM memory is overallocated in many cases, but apparently the docs
aren't quite correct and I'll probably need to look at the hardware
source to really figure it out.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add support a few more RGB display plane formats.
Eric Anholt [Tue, 20 Oct 2015 12:59:15 +0000 (13:59 +0100)]
drm/vc4: Add support a few more RGB display plane formats.

These were all touch-tested with modetest.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add support for scaling of display planes.
Eric Anholt [Tue, 20 Oct 2015 15:06:57 +0000 (16:06 +0100)]
drm/vc4: Add support for scaling of display planes.

This implements a simple policy for choosing scaling modes
(trapezoidal for decimation, PPF for magnification), and a single PPF
filter (Mitchell/Netravali's recommendation).

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Fix which value is being used for source image size.
Eric Anholt [Mon, 28 Dec 2015 22:45:25 +0000 (14:45 -0800)]
drm/vc4: Fix which value is being used for source image size.

This doesn't matter yet since we only allow 1:1 scaling, but the
comment clearly says we should be using the source size.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add more display planes to each CRTC.
Eric Anholt [Tue, 20 Oct 2015 13:18:56 +0000 (14:18 +0100)]
drm/vc4: Add more display planes to each CRTC.

Previously we only did the primary and cursor plane, but overlay
planes are useful and just require this setup to add, since all planes
go into the HVS display list in the same way.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Make the CRTCs cooperate on allocating display lists.
Eric Anholt [Mon, 28 Dec 2015 21:25:41 +0000 (13:25 -0800)]
drm/vc4: Make the CRTCs cooperate on allocating display lists.

So far, we've only ever lit up one CRTC, so this has been fine.  To
extend to more displays or more planes, we need to make sure we don't
run our display lists into each other.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add a proper short-circut path for legacy cursor updates.
Eric Anholt [Wed, 30 Dec 2015 19:50:22 +0000 (11:50 -0800)]
drm/vc4: Add a proper short-circut path for legacy cursor updates.

Previously, on every modeset we would allocate new display list
memory, recompute changed planes, write all of them to the new memory,
and pointed scanout at the new list (which will latch approximately at
the next line of scanout).  We let
drm_atomic_helper_wait_for_vblanks() decide whether we needed to wait
for a vblank after a modeset before cleaning up the old state and
letting the next modeset proceed, and on legacy cursor updates we
wouldn't wait.  If you moved the cursor fast enough, we could
potentially wrap around the display list memory area and overwrite the
existing display list while it was still being scanned out, resulting
in the HVS scanning out garbage or just halting.

Instead of making cursor updates wait for scanout to move to the new
display list area (which introduces significant cursor lag in X), we
just rewrite our current display list.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Move the plane clipping/scaling setup to a separate function.
Eric Anholt [Mon, 28 Dec 2015 22:34:44 +0000 (14:34 -0800)]
drm/vc4: Move the plane clipping/scaling setup to a separate function.

As we add actual scaling, this is going to get way more complicated.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add missing __iomem annotation to hw_dlist.
Eric Anholt [Mon, 28 Dec 2015 22:14:57 +0000 (14:14 -0800)]
drm/vc4: Add missing __iomem annotation to hw_dlist.

This is the pointer to the HVS device's memory where we stored the
contents of *dlist.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Improve comments on vc4_plane_state members.
Eric Anholt [Mon, 28 Dec 2015 22:14:09 +0000 (14:14 -0800)]
drm/vc4: Improve comments on vc4_plane_state members.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm: fixes crct set_mode when crtc mode_fixup is null.
Carlos Palminha [Tue, 16 Feb 2016 14:10:03 +0000 (14:10 +0000)]
drm: fixes crct set_mode when crtc mode_fixup is null.

This patch set nukes all the dummy crtc mode_fixup implementations.
(made on top of Daniel topic/drm-misc branch)

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/9d41105dee6632b4bb50e9555f2196ac249b9fce.1455630967.git.palminha@synopsys.com
8 years agodrm/tilcdc: removed optional dummy encoder mode_fixup function.
Carlos Palminha [Mon, 15 Feb 2016 13:01:35 +0000 (13:01 +0000)]
drm/tilcdc: removed optional dummy encoder mode_fixup function.

mode_fixup function for encoder drivers became optional with patch
http://patchwork.freedesktop.org/patch/msgid/1455106522-32307-1-git-send-email-palminha@synopsys.com

This patch set nukes all the dummy mode_fixup implementations.

(made on top of Daniel topic/drm-misc branch)

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/4d838f580cf81068a4df2500a096d66f06f3ad37.1455540137.git.palminha@synopsys.com
8 years agodrm/sti: removed optional dummy encoder mode_fixup function.
Carlos Palminha [Mon, 15 Feb 2016 13:01:25 +0000 (13:01 +0000)]
drm/sti: removed optional dummy encoder mode_fixup function.

mode_fixup function for encoder drivers became optional with patch
http://patchwork.freedesktop.org/patch/msgid/1455106522-32307-1-git-send-email-palminha@synopsys.com

This patch set nukes all the dummy mode_fixup implementations.

(made on top of Daniel topic/drm-misc branch)

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/7f47c6a7b00e4f16af672ebf3a277e31ad117e21.1455540137.git.palminha@synopsys.com
8 years agodrm/rockchip: removed optional dummy encoder mode_fixup function.
Carlos Palminha [Mon, 15 Feb 2016 13:01:15 +0000 (13:01 +0000)]
drm/rockchip: removed optional dummy encoder mode_fixup function.

mode_fixup function for encoder drivers became optional with patch
http://patchwork.freedesktop.org/patch/msgid/1455106522-32307-1-git-send-email-palminha@synopsys.com

This patch set nukes all the dummy mode_fixup implementations.

(made on top of Daniel topic/drm-misc branch)

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Acked-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/cae559aa2c04a906c21ed5ebe4861f92440e6910.1455540137.git.palminha@synopsys.com
8 years agodrm/qxl: removed optional dummy encoder mode_fixup function.
Carlos Palminha [Mon, 15 Feb 2016 13:00:54 +0000 (13:00 +0000)]
drm/qxl: removed optional dummy encoder mode_fixup function.

mode_fixup function for encoder drivers became optional with patch
http://patchwork.freedesktop.org/patch/msgid/1455106522-32307-1-git-send-email-palminha@synopsys.com

This patch set nukes all the dummy mode_fixup implementations.

(made on top of Daniel topic/drm-misc branch)

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/f35bc322f7af69ba0fea734d58b4daf5e0cd9786.1455540137.git.palminha@synopsys.com
8 years agodrm/mgag200: removed optional dummy encoder mode_fixup function.
Carlos Palminha [Mon, 15 Feb 2016 13:00:35 +0000 (13:00 +0000)]
drm/mgag200: removed optional dummy encoder mode_fixup function.

mode_fixup function for encoder drivers became optional with patch
http://patchwork.freedesktop.org/patch/msgid/1455106522-32307-1-git-send-email-palminha@synopsys.com

This patch set nukes all the dummy mode_fixup implementations.

(made on top of Daniel topic/drm-misc branch)

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/c5852d59a8890c3570ce97d16c0714a71eb61651.1455540137.git.palminha@synopsys.com
8 years agodrm/msm/mdp: removed optional dummy encoder mode_fixup function.
Carlos Palminha [Mon, 15 Feb 2016 13:00:24 +0000 (13:00 +0000)]
drm/msm/mdp: removed optional dummy encoder mode_fixup function.

mode_fixup function for encoder drivers became optional with patch
http://patchwork.freedesktop.org/patch/msgid/1455106522-32307-1-git-send-email-palminha@synopsys.com

This patch set nukes all the dummy mode_fixup implementations.

(made on top of Daniel topic/drm-misc branch)

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/77692d9d34c2ed6a035f36d377d3544dbe100114.1455540137.git.palminha@synopsys.com