aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/amdgpu: fix coding style in amdgpu_ctx.cChristian König2016-02-121-16/+15
| | | | | | | Don't use pointer arithmetic and fix the indentation. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: nuke the kernel contextChristian König2016-02-121-11/+7
| | | | | | | Not used any more. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: clean up non-scheduler code path (v2)Chunming Zhou2016-02-101-26/+22
| | | | | | | | | | | Non-scheduler code is longer supported. v2: agd: rebased on upstream Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Ken Wang <[email protected]> Reviewed-by: Monk Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: restrict the sched jobs number to power of twoChunming Zhou2015-12-181-2/+2
| | | | | | Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> CC: [email protected]
* drm/amdgpu: unify AMDGPU_CTX_MAX_CS_PENDING and amdgpu_sched_jobsChunming Zhou2015-12-151-7/+18
| | | | | | Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: handle error case for ctxChunming Zhou2015-12-151-2/+5
| | | | | | | | Properly handle ctx init failure. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd: abstract kernel rq and normal rq to priority of run queueChunming Zhou2015-12-021-6/+5
| | | | | | | | Allows us to set priorities in the scheduler. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Junwei Zhang <[email protected]>
* drm/amdgpu: don't oops on failure to load (v2)Dave Airlie2015-11-031-0/+3
| | | | | | | | | | | | | | | | | In two places amdgpu tries to tear down something it hasn't initalised when failing. This is what happens when you enable experimental support on topaz which then fails in ring init. This patch allows it to fail cleanly. v2 (agd): split out scheduler change into a separate patch Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
* drm/amdgpu: more scheduler cleanups v2Christian König2015-09-231-5/+5
| | | | | | | | | | | 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 <[email protected]> Reviewed-by: Junwei Zhang <[email protected]> Reviewed-by: Chunming Zhou<[email protected]>
* drm/amdgpu: rename fence->scheduler to sched v2Christian König2015-09-231-5/+5
| | | | | | | | | | Just to be consistent with the other members. v2: rename the ring member as well. Signed-off-by: Christian König <[email protected]> Reviewed-by: Junwei Zhang <[email protected]> (v1) Reviewed-by: Chunming Zhou<[email protected]>
* drm/amdgpu: remove the context from amdgpu_jobChristian König2015-08-251-7/+0
| | | | | 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-15/+5
| | | | | | | | | | | 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: abstract amdgpu_job for schedulerChunming Zhou2015-08-201-0/+7
| | | | | Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: cleanup sheduler rq handling v2Christian König2015-08-171-1/+1
| | | | | | | | | Rework run queue implementation, especially remove the odd list handling. v2: cleanup the code only, no algorithem change. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amd: add scheduler fence implementation (v2)Chunming Zhou2015-08-171-10/+0
| | | | | | | | | 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-9/+9
| | | | | | | | | 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: remove unused parent entityChristian König2015-08-171-1/+1
| | | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: cleanup amdgpu_ctx inti/fini v2Christian König2015-08-171-77/+68
| | | | | | | | | Cleanup the kernel context handling. v2: rebased Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> (v1)
* drm/amdgpu: stop leaking the ctx id into the scheduler v2Christian König2015-08-171-7/+4
| | | | | | | | | Id's are for the IOCTL ABI only. v2: remove tgid as well Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: cleanup ctx_mgr init/finiChristian König2015-08-171-17/+23
| | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: add amd_sched_next_queued_seq functionJammy Zhou2015-08-171-1/+1
| | | | | | | | This function is used to get the next queued sequence number Signed-off-by: Jammy Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: fix seq in ctx_add_fenceChunming Zhou2015-08-171-2/+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: wait forever for wait emitChunming Zhou2015-08-171-2/+2
| | | | | | | the job must be emitted by scheduler, otherwise scheduler is abnormal. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: add amdgpu.sched_jobs optionJammy Zhou2015-08-171-1/+2
| | | | | | | | This option can be used to specify the max job number in the job queue, and it is 16 by default. Signed-off-by: Jammy Zhou <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: add kernel ctx support (v2)Chunming Zhou2015-08-171-24/+59
| | | | | | | | v2: rebase against kfd changes 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-0/+10
| | | | | | Signed-off-by: Chunming Zhou <[email protected]> Acked-by: Christian K?nig <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: use scheduler user seq instead of previous user seqChunming Zhou2015-08-171-6/+20
| | | | | | Signed-off-by: Chunming Zhou <[email protected]> Acked-by: Christian K?nig <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: add context entity initChunming Zhou2015-08-171-1/+35
| | | | | | Signed-off-by: Chunming Zhou <[email protected]> Acked-by: Christian K?nig <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: fix signed overrun in amdgpu_ctx_get_fenceChristian König2015-08-171-1/+1
| | | | | | | Otherwise the first 16 fences of a context will always signal immediately. Signed-off-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: fix context memory leakChristian König2015-08-171-0/+1
| | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: add user fence context map v2Christian König2015-08-171-1/+59
| | | | | | | | | | | 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: cleanup context structure v2Alex Deucher2015-08-171-21/+7
| | | | | | | | | | | | | | | | | The comment is misleading and incorrect, remove it. Printing the id is completely meaningless and this practice can cause a race conditions on command submission. The flags and hangs fields are completely unused. Give all fields a common indentation. v2: remove fpriv reference and unused flags as well, fix debug message. Signed-off-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: add and implement the GPU reset status queryMarek Olšák2015-06-041-13/+23
| | | | | | Signed-off-by: Marek Olšák <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: add ctx_id to the WAIT_CS IOCTL (v4)Jammy Zhou2015-06-041-0/+30
| | | | | | | | | | | 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: make the CTX ioctl thread-safeMarek Olšák2015-06-041-10/+10
| | | | | | | | | | The existing locks were protecting the list, but not the elements. v2: rename hlock to lock Signed-off-by: Marek Olšák <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: remove unsafe context releasingMarek Olšák2015-06-041-10/+2
| | | | | | | | If ctx was released between put and get, then "get" would crash. Signed-off-by: Marek Olšák <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
* drm/amdgpu: add core driver (v4)Alex Deucher2015-06-041-0/+161
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]>