Tom St Denis
ff923479ee
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 >
2016-03-08 11:01:56 -05:00
Tom St Denis
74c1e84279
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 >
2016-03-08 11:01:56 -05:00
Tom St Denis
84cffef127
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 >
2016-03-08 11:01:55 -05:00
Tom St Denis
849dc32b20
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 >
2016-03-08 11:01:55 -05:00
Tom St Denis
720a6ce3ce
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 >
2016-03-08 11:01:54 -05:00
Tom St Denis
98822a2f74
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 >
2016-03-08 11:01:54 -05:00
Tom St Denis
441ce96f14
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 >
2016-03-08 11:01:53 -05:00
Tom St Denis
e484f8d479
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 >
2016-03-08 11:01:53 -05:00
Tom St Denis
041ab0a494
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 >
2016-03-08 11:01:52 -05:00
Tom St Denis
c437b9d6c0
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 >
2016-03-08 11:01:52 -05:00
Tom St Denis
bcc71beb2a
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 >
2016-03-08 11:01:51 -05:00
Tom St Denis
29f646dfb2
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 >
2016-03-08 11:01:51 -05:00
Christian König
2f568dbd6b
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 >
2016-03-08 11:01:50 -05:00
Christian König
d564a06e1c
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 >
2016-03-08 11:01:50 -05:00
Christian König
b8c7b39ec1
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 >
2016-03-08 11:01:49 -05:00
Christian König
971fe9a941
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)
2016-03-08 11:01:49 -05:00
Christian König
cffadc83c7
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 >
2016-03-08 11:01:48 -05:00
Christian König
364beb2cc4
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 >
2016-03-08 11:01:48 -05:00
Christian König
257bf15a4b
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 >
2016-03-08 11:01:47 -05:00
Christian König
336d1f5efe
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 >
2016-03-08 11:01:47 -05:00
Christian König
bcc634f4a8
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 >
2016-03-08 11:01:46 -05:00
Christian König
637dd3b5ca
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 >
2016-03-08 11:01:46 -05:00
Christian König
211dff5518
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 >
2016-03-08 11:01:45 -05:00
Christian König
a8bd1bec7c
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 >
2016-03-08 11:01:45 -05:00
Chunming Zhou
13459bd0fb
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 >
2016-03-08 11:01:44 -05:00