Christian König
6ef68c17d4
drm/amdgpu: remove amdgpu_fence_ref/unref
...
Just move the remaining users to fence_put/get.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-10-30 01:58:22 -04:00
Christian König
16545c32a5
drm/amdgpu: use common fence for sync
...
Stop using the driver internal functions.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-10-30 01:57:19 -04:00
Christian König
d52832986a
drm/amdgpu: use common fences for VMID management v2
...
v2: add missing NULL check.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-10-30 01:55:12 -04:00
Christian König
8120b61fdf
drm/amdgpu: move ring_from_fence to common code
...
Going to need that elsewhere as well.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-10-30 01:54:07 -04:00
Christian König
ee327caf1a
drm/amdgpu: switch to common fence_wait_any_timeout v2
...
No need to duplicate the functionality any more.
v2: fix handling if no fence is available.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com > (v1)
2015-10-30 01:51:11 -04:00
Junwei Zhang
ce16b0e5a3
drm/amdgpu: remove the unnecessary parameter adev for amdgpu_fence_wait_any()
...
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
2015-10-21 11:35:13 -04:00
Christian König
0c418f1010
drm/amdgpu: remove the exclusive lock
...
Finally getting rid of it.
Signed-off-by: Christian König <christian.koenig@amd.com >
2015-10-21 11:35:12 -04:00
Christian König
b7e4dad3e1
drm/amdgpu: remove old lockup detection infrastructure
...
It didn't worked to well anyway.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com >
2015-10-21 11:35:12 -04:00
Christian König
b495bd3a54
drm/amdgpu: add option to clear VM page tables after every submit
...
This makes it much easier to find when userspace misses to send some buffers.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-10-14 16:16:40 -04:00
Christian König
d9c13156a6
drm/amdgpu: add option to stop on VM fault
...
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-10-14 16:16:40 -04:00
Alex Deucher
c113ea1c4f
drm/amdgpu: rework sdma structures
...
Rework the sdma structures in the driver to
consolidate all of the sdma info into a single
structure and allow for asics that may have
different numbers of sdma instances.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2015-10-14 16:16:36 -04:00
monk.liu
5c3422b0b1
drm/amdgpu: sync ce and me with SWITCH_BUFFER(2)
...
we used to adopt wait_reg_mem to let CE wait before DE finish page
updating, but from Tonga+, CE doesn't support wait_reg_mem package so
this logic no longer works.
so here is another approach to do same thing:
Insert two of SWITCH_BUFFER at both front and end of vm_flush can
guarantee that CE not go further to process IB_const before vm_flush
done.
Insert two of SWITCH_BUFFER also works on CI, so remove legency method
to sync CE and ME
v2:
Insert double SWITCH_BUFFER at front of vm flush as well.
Signed-off-by: monk.liu <monk.liu@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
2015-09-23 17:23:45 -04:00
Christian König
4f839a243d
drm/amdgpu: more scheduler cleanups v2
...
Embed the scheduler into the ring structure instead of allocating it.
Use the ring name directly instead of the id.
v2: rebased, whitespace cleanup
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com >
Reviewed-by: Chunming Zhou<david1.zhou@amd.com >
2015-09-23 17:23:39 -04:00
Christian König
9b398fa5c2
drm/amdgpu: rename fence->scheduler to sched v2
...
Just to be consistent with the other members.
v2: rename the ring member as well.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com > (v1)
Reviewed-by: Chunming Zhou<david1.zhou@amd.com >
2015-09-23 17:23:37 -04:00
Junwei Zhang
a6db8a33e1
drm/amdgpu: refine the scheduler job type conversion
...
Use container_of rather than casting.
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: David Zhou <david1.zhou@amd.com >
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com >
2015-09-23 17:23:36 -04:00
Junwei Zhang
4c7eb91cae
drm/amdgpu: refine the job naming for amdgpu_job and amdgpu_sched_job
...
Use consistent naming across functions.
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: David Zhou <david1.zhou@amd.com >
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com >
2015-09-23 17:23:36 -04:00
Christian König
3daea9e3d3
drm/amdgpu: add option to disable semaphores
...
Provide module parameter to enable/disable them. Still
enabled by default.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-09-23 17:23:29 -04:00
Jammy Zhou
edff0e2826
drm/amdgpu: add insert_nop ring func and default implementation
...
The insert_nop function is added to amdgpu_ring_funcs structure as
well as the default implementation
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-09-02 12:24:43 -04:00
Jammy Zhou
4b2f7e2ca9
drm/amdgpu: add amdgpu_get_sdma_instance helper function
...
This function is added to map the ring to sdma instance
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-09-02 12:23:58 -04:00
Jammy Zhou
36f523a7c0
drm/amdgpu: add AMDGPU_MAX_SDMA_INSTANCES
...
Remove the hardcoded usage
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-09-02 12:23:12 -04:00
Jammy Zhou
18111de0df
drm/amdgpu: add burst_nop flag for sdma
...
The burst NOP is supported for SDMA when feature_version is >= 20.
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-09-02 12:22:28 -04:00
Christian König
8221d706f4
drm/amdgpu: partially revert "modify amdgpu_fence_wait_any() to amdgpu_fence_wait_multiple()" v2
...
That isn't used any more.
v2: rebase
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 >
2015-09-02 12:19:52 -04:00
Chunming Zhou
6e7a384074
drm/amdgpu: use IB for fill_buffer instead of direct command
...
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-08-28 15:04:19 -04:00
Christian König
8f8202f771
drm/amdgpu: stop trying to suspend UVD sessions v2
...
Saving the current UVD state on suspend and restoring it on resume
just doesn't work reliable. Just close cleanup all sessions on suspend.
Ported from radeon commit "12e49feadff6d7b7ebbe852b36943a71524d8d34".
v2: rebased
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com > (v1)
2015-08-28 15:04:18 -04:00
Christian König
e61235db62
drm/amdgpu: add scheduler dependency callback v2
...
This way the scheduler doesn't wait in it's work thread any more.
v2: fix race conditions
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com >
2015-08-28 15:04:17 -04:00
Chunming Zhou
c7ae72c01b
drm/amdgpu: use IB for copy buffer of eviction
...
This aids handling buffers moves with the scheduler.
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
2015-08-26 17:50:42 -04:00
Chunming Zhou
3c62338c26
drm/amdgpu: fix last_vm_update fence is not effetive for sched fence
...
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
2015-08-25 10:53:05 -04:00
Chunming Zhou
84f76ea6b0
drm/amdgpu: add owner for sched fence
...
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
2015-08-25 10:51:32 -04:00
Christian König
87e0a87dab
drm/amdgpu: remove amdgpu_bo_list_clone
...
Not used any more.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
2015-08-25 10:49:12 -04:00
Christian König
3a185a33a2
drm/amdgpu: remove the context from amdgpu_job
...
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
2015-08-25 10:48:27 -04:00
Christian König
f91b3a6941
drm/amdgpu: fix fence wait in sync_fence, instead should be in sync_rings
...
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
2015-08-25 10:39:39 -04:00
Christian König
ce882e6dc2
drm/amdgpu: remove v_seq handling from the scheduler v2
...
Simply not used any more. Only keep 32bit atomic for fence sequence numbering.
v2: trivial rebase
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com > (v1)
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com > (v1)
Reviewed-by: Chunming Zhou <david1.zhou@amd.com > (v1)
2015-08-25 10:39:16 -04:00
Chunming Zhou
4ce9891ee1
drm/amdgpu: improve sa_bo->fence by kernel fence
...
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
2015-08-25 10:38:41 -04:00
Junwei Zhang
1aa4051b7f
drm/amdgpu: modify amdgpu_fence_wait_any() to amdgpu_fence_wait_multiple()
...
Rename the function and update the related code with this modified function.
Add the new parameter of bool wait_all.
If wait_all is true, it will return when all fences are signaled or timeout.
If wait_all is false, it will return when any fence is signaled or timeout.
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com >
Reviewed-by: Monk Liu <monk.liu@amd.com >
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
2015-08-25 10:38:28 -04:00
Chunming Zhou
3c4adead84
drm/amdgpu: some clean up for cs_ioctl
...
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
2015-08-20 17:02:09 -04:00
Chunming Zhou
bb977d3711
drm/amdgpu: abstract amdgpu_job for scheduler
...
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
2015-08-20 17:00:35 -04:00
Bas Nieuwenhuizen
05906dec7d
drm/amdgpu: wait on page directory changes. v2
...
Pagetables can be moved and therefore the page directory update can be necessary
for the current cs even if none of the the bo's are moved. In that scenario
there is no fence between the sdma0 and gfx ring, so we add one.
v2 (chk): rebased
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-08-17 16:51:23 -04:00
Christian König
1ffd265243
drm/amdgpu: fix waiting for all fences before flipping
...
Otherwise we might see corruption.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-08-17 16:51:17 -04:00
Christian König
02bc0650bc
drm/amdgpu: remove amdgpu_fence_wait
...
It was just a wrapper for fence_wait anyway.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-08-17 16:51:09 -04:00
Christian König
3cdb8119d9
drm/amdgpu: remove amdgpu_fence_signaled
...
The common kernel function does the same thing.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
2015-08-17 16:51:08 -04:00
Chunming Zhou
f556cb0cae
drm/amd: add scheduler fence implementation (v2)
...
scheduler fence is based on kernel fence framework.
v2: squash in Christian's build fix
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
2015-08-17 16:51:07 -04:00
Chunming Zhou
4af9f07ccd
drm/amdgpu: use kernel submit helper in vm
...
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
2015-08-17 16:51:07 -04:00
Christian König
91404fb208
drm/amdgpu: merge amd_sched_entity and amd_context_entity v2
...
Avoiding a couple of casts.
v2: rename c_entity to entity as well
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
2015-08-17 16:51:05 -04:00
Chunming Zhou
4cef92670b
drm/amdgpu: process sched job exactly triggered by fence signal
...
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
2015-08-17 16:51:03 -04:00
Christian König
47f38501f1
drm/amdgpu: cleanup amdgpu_ctx inti/fini v2
...
Cleanup the kernel context handling.
v2: rebased
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com > (v1)
2015-08-17 16:51:02 -04:00
Christian König
efd4ccb59a
drm/amdgpu: cleanup ctx_mgr init/fini
...
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
2015-08-17 16:51:00 -04:00
Christian König
34cb581a7d
drm/amdgpu: fix bo list handling in CS
...
We didn't initialized the mutex in the cloned bo list resulting in nice
warnings from lockdep. Also fixes error handling in this function.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Chunming Zhou <david1.zhou@amd.com >
2015-08-17 16:51:00 -04:00
Chunming Zhou
7484667c6a
drm/amdgpu: move sched job process from isr to fence callback
...
This way can avoid interrupt lost, and can process sched job exactly.
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com >
2015-08-17 16:50:59 -04:00
Chunming Zhou
1763552ee8
drm/amdgpu: add kernel fence in ib_submit_kernel_helper
...
every sbumission should be able to get a fence.
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
Reviewed-by: Jammy Zhou <jammy.zhou@amd.com >
2015-08-17 16:50:54 -04:00
Chunming Zhou
bb1e38a4be
drm/amdgpu: use kernel fence for last_pt_update
...
Signed-off-by: Chunming Zhou <david1.zhou@amd.com >
Reviewed-by: Christian K?nig <christian.koenig@amd.com >
Reviewed-by: Jammy Zhou <jammy.zhou@amd.com >
2015-08-17 16:50:51 -04:00