aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
Commit message (Collapse)AuthorAgeFilesLines
...
* drm/amdgpu: add owner for sched fenceChunming Zhou2015-08-251-1/+1
| | | | | Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: fix and cleanup amd_sched_entity_push_jobChristian König2015-08-251-1/+1
| | | | | | | Calling schedule() is probably the worse things we can do. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: remove the context from amdgpu_jobChristian König2015-08-251-3/+1
| | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: fix user fences when scheduler is enabledChristian König2015-08-251-0/+2
| | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: remove v_seq handling from the scheduler v2Christian König2015-08-251-4/+2
| | | | | | | | | | | Simply not used any more. Only keep 32bit atomic for fence sequence numbering. v2: trivial rebase Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> (v1) Reviewed-by: Jammy Zhou <[email protected]> (v1) Reviewed-by: Chunming Zhou <[email protected]> (v1)
* drm/amdgpu: fix CS error handling v2Christian König2015-08-201-41/+26
| | | | | | | | | | | Stop double freeing the the BO list by pulling the content of amdgpu_cs_parser_prepare_job() into the IOCTL function again. v2: better commit message Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> (v1) Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: fix zeroing all IB fields manually v2Christian König2015-08-201-1/+1
| | | | | | | | | | | | | The problem now is that we don't necessarily call amdgpu_ib_get() in some error paths and so work with uninitialized data. Better require that the memory is already zeroed. v2: better commit message Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> (v1) Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: don't need to use bo_list_clone any moreChunming Zhou2015-08-201-21/+4
| | | | | Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: some clean up for cs_ioctlChunming Zhou2015-08-201-28/+1
| | | | | Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: prepare job should be common code pathChunming Zhou2015-08-201-6/+4
| | | | | Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: abstract amdgpu_job for schedulerChunming Zhou2015-08-201-46/+55
| | | | | Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: wait on page directory changes. v2Bas Nieuwenhuizen2015-08-171-0/+4
| | | | | | | | | | | | 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 <[email protected]> Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: move prepare work out of scheduler to cs_ioctlChunming Zhou2015-08-171-13/+8
| | | | | Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: drop bo_list_clone when no schedulermonk.liu2015-08-171-9/+13
| | | | | | | | | bo_list_clone() will take a lot of time when bo_list hold too much elements, like above 7000 Signed-off-by: Monk.Liu <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: add reference for **fenceChunming Zhou2015-08-171-0/+1
| | | | | | | | fix fence is released when pass to **fence sometimes. add reference for it. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amd: add scheduler fence implementation (v2)Chunming Zhou2015-08-171-6/+15
| | | | | | | | | scheduler fence is based on kernel fence framework. v2: squash in Christian's build fix Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: merge amd_sched_entity and amd_context_entity v2Christian König2015-08-171-2/+2
| | | | | | | | | Avoiding a couple of casts. v2: rename c_entity to entity as well Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: fix coding style in a couple of placesChristian König2015-08-171-4/+2
| | | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* Revert "drm/amdgpu: return new seq_no for amd_sched_push_job"Chunming Zhou2015-08-171-2/+3
| | | | | | | | | | This reverts commit d1d33da8eb86b8ca41dd9ed95738030df5267b95. Reviewed-by: Christian K?nig <[email protected]> Conflicts: drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
* drm/amdgpu: fix bo list handling in CSChristian König2015-08-171-3/+2
| | | | | | | | 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 <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: reorder the code to avoid forward declerationsChristian König2015-08-171-33/+28
| | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: return new seq_no for amd_sched_push_jobJammy Zhou2015-08-171-3/+2
| | | | | | | | It is clean to update last_queued_v_seq in the scheduler module Signed-off-by: Jammy Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: some code refinement v2Jammy Zhou2015-08-171-13/+13
| | | | | | | | | | Fix the code alignment, etc. v2: rebase the code Signed-off-by: Jammy Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: use kernel fence for last_pt_updateChunming Zhou2015-08-171-1/+1
| | | | | | Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: stop using addr to check for BO move v3Christian König2015-08-171-1/+10
| | | | | | | | | | | | | | It is theoretically possible that a swapped out BO gets the same GTT address, but different backing pages while being swapped in. Instead just use another VA state to note updated areas. Ported from not upstream yet radeon commit with the same name. v2: fix some bugs in the original implementation found in the radeon code. v3: squash in VCE/UVD fix Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: fix seq in ctx_add_fenceChunming Zhou2015-08-171-3/+2
| | | | | | | | if enabling scheduler, then the queued seq is assigned when pushing job before emitting job. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: add check for callbackChunming Zhou2015-08-171-1/+2
| | | | | | | it is possible that the callback isn't defined sometimes. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: prepare job before push to sw queue for pte ringChunming Zhou2015-08-171-1/+1
| | | | | | | | | | user mode will still use pte ring as a normal ring. if the prepare job generates another command(update pte) on its ring in scheduler, then will kill scheduler which is going to waiting later job but pending running job. Signed-off-by: Chunming Zhou <[email protected]> Acked-by: Christian K?nig <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: make sure the fence is emitted before ring to get it.Chunming Zhou2015-08-171-17/+9
| | | | | | Signed-off-by: Chunming Zhou <[email protected]> Acked-by: Christian K?nig <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: dispatch jobs in csChunming Zhou2015-08-171-55/+197
| | | | | | | | | BO validation is moved to scheduler except usrptr which must be validated in user process Signed-off-by: Chunming Zhou <[email protected]> Acked-by: Christian K?nig <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: optimize amdgpu_parser_initmonk.liu2015-08-171-9/+8
| | | | | | | | use kmalloc_array instead of kcalloc where appropriate and other cleanups. Signed-off-by: monk.liu <[email protected]> Reviewed-by: Christian König <[email protected]>
* drm/amdgpu: fix UVD/VCE fence handlingChristian König2015-08-171-1/+1
| | | | | | | | We need to return the sequence number to userspace even when we don't use user fences. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: add user fence context map v2Christian König2015-08-171-28/+32
| | | | | | | | | | | This is a prerequisite for the GPU scheduler to make the order of submission independent from the order of execution. v2: properly implement the locking Signed-off-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: deal with foreign fences in amdgpu_syncChristian König2015-08-171-2/+10
| | | | | | | | This also requires some error handling from the callers of that function. Signed-off-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: stop context leak in the error pathChristian König2015-07-161-2/+6
| | | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: validate the context id in the dependenciesChristian König2015-07-161-1/+10
| | | | | | | | Just to make sure userspace don't send nonsense to the kernel. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: add optional dependencies to the CS IOCTL v2Christian König2015-06-291-1/+58
| | | | | | | v2: remove unrelated whitespace change, fix C comment Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: recreate fence from user seqChristian König2015-06-291-4/+7
| | | | | | | | And use common fence infrastructure for the wait. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: add chunk id validity checkChristian König2015-06-291-3/+11
| | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: fix crash on invalid CS IOCTLChristian König2015-06-291-2/+3
| | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: fix UVD/VCE VM emulationChristian König2015-06-101-3/+15
| | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: only support IBs in the buffer list (v2)Marek Olšák2015-06-041-71/+24
| | | | | | | | | | amdgpu_cs_find_mapping doesn't work without all buffers being validated, so the TTM validation must be done first. v2: only use amdgpu_cs_find_mapping for UVD/VCE VM emulation Signed-off-by: Marek Olšák <[email protected]> Reviewed-by: Christian König <[email protected]>
* drm/amdgpu: sync fence of clear_invalids (v2)monk.liu2015-06-041-1/+1
| | | | | | | | bo_va may un-initialized, fix it. Signed-off-by: monk.liu <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: fix context switchChristian König2015-06-041-8/+8
| | | | | | | | | Properly protect the state and also handle submission failures. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Monk Liu <[email protected]>
* drm/amdgpu: add flags for amdgpu_ib structureJammy Zhou2015-06-041-4/+2
| | | | | Signed-off-by: Jammy Zhou <[email protected]> Reviewed-by: Christian König <[email protected]>
* drm/amdgpu: check context id for context switching (v2)Jammy Zhou2015-06-041-1/+3
| | | | | | | | | | check the filp is not robust, and sometimes different contexts may have same filp value. v2: check both filp and ctx_id Signed-off-by: Jammy Zhou <[email protected]> Reviewed-by: Christian König <[email protected]>
* drm/amdgpu: add ctx_id to the WAIT_CS IOCTL (v4)Jammy Zhou2015-06-041-0/+6
| | | | | | | | | | | It is required to support fence per context. v2: add amdgpu_ctx_get/put v3: improve get/put v4: squash hlock fix Signed-off-by: Jammy Zhou <[email protected]> Reviewed-by: Christian König <[email protected]>
* drm/amdgpu: fix bug occurs when bo_list is NULLmonk.liu2015-06-041-9/+9
| | | | | | | | Still need to handle ibs BO and validate them even bo_list is NULL Signed-off-by: Monk.Liu <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add core driver (v4)Alex Deucher2015-06-041-0/+825
This adds the non-asic specific core driver code. v2: remove extra kconfig option v3: implement minor fixes from Fengguang Wu v4: fix cast in amdgpu_ucode.c Acked-by: Christian König <[email protected]> Acked-by: Jammy Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>