aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
Commit message (Collapse)AuthorAgeFilesLines
...
* drm/amdgpu: cleanup hw reference handling in the IB testsChristian König2016-07-141-5/+1
| | | | | | | | Reference should be taken when we make the assignment, not anywhere else. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add a bool to specify if needing vm flush V2Chunming Zhou2016-07-071-4/+1
| | | | | | | | | | which avoids job->vm_pd_addr be changed. V2: pass job structure to amdgpu_vm_grab_id and amdgpu_vm_flush directly. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: fix user fence handling once moreChristian König2016-07-071-5/+2
| | | | | | | | | | | | Same problem as with the VM page tables. The user fence address must be determined before the job is scheduled, not when the IB is executed. This fixes a security problem where user fences could be used to overwrite any part of VRAM. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: fix and cleanup user fence handling v2Christian König2016-05-111-4/+5
| | | | | | | | | | | We leaked the BO in the error pass, additional to that we only have one user fence for all IBs in a job. v2: remove white space changes Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: move VM fields into jobChristian König2016-05-111-10/+9
| | | | | | | | They are the same for all IBs. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: move the context from the IBs into the jobChristian König2016-05-111-7/+15
| | | | | | | | We only have one context for all IBs. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: move context switch handling into common code v2Christian König2016-05-111-9/+7
| | | | | | | | | | It was a source of bugs to repeat that in each IP version. v2: rename parameter Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: move preamble IB handling into common codeChristian König2016-05-111-1/+7
| | | | | | | | | This fixes the handling which was completely broken when you ad more than one preamble IB. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: use fence_context to judge ctx switch v2Christian König2016-05-111-1/+1
| | | | | | | | | | | Use of the ctx pointer is not safe, because they are likely already be assigned to another ctx when doing comparing. v2: recreate from scratch, avoid all unnecessary changes. Signed-off-by: Christian König <[email protected]> Reviewed-by: Monk.Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: two minor 80 char fixesChristian König2016-05-111-1/+2
| | | | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Tom St Denis <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: hdp flush&inval should always doMonk Liu2016-05-111-7/+5
| | | | | | | | | | | | | This fixes Tonga vm-fault issue when running disaster (a multiple context GL heavy tests), We should always flush & invalidate hdp no matter vm used or not. Signed-off-by: Monk Liu <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
* drm/amdgpu: keep vm in job instead of ib (v2)Monk Liu2016-05-111-12/+4
| | | | | | | | | | | | | | | | | | | | | | ib.vm is a legacy way to get vm, after scheduler implemented vm should be get from job, and all ibs from one job share the same vm, no need to keep ib.vm just move vm field to job. this patch as well add job as paramter to ib_schedule so it can get vm from job->vm. v2: agd: sqaush in: drm/amdgpu: check if ring emit_vm_flush exists in vm flush No vm flush on engines that don't support VM. bug: https://bugs.freedesktop.org/show_bug.cgi?id=95195 Signed-off-by: Monk Liu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Mark all instances of struct drm_info_list as constNils Wallménius2016-05-051-1/+1
| | | | | | | | | | All these are compile time constand and the drm_debugfs_create/remove_files functions take a const pointer argument. Reviewed-by: Christian König <[email protected]> Signed-off-by: Nils Wallménius <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: add a fence after the VM flushChristian König2016-05-051-4/+8
| | | | | | | | | This way we can track when the flush is done. Signed-off-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: patch cond exec for SDMAMonk Liu2016-05-021-1/+8
| | | | | | | | | More ground work for conditional execution on SDMA necessary for preemption. Signed-off-by: Monk Liu <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: support cond execMonk Liu2016-05-021-0/+3
| | | | | | | | | This adds the groundwork for conditional execution on SDMA which is necessary for preemption. Signed-off-by: Monk Liu <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: move ib.fence to job.fenceMonk Liu2016-03-171-3/+3
| | | | | | Signed-off-by: Monk Liu <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: give a fence param to ib_freeMonk Liu2016-03-171-2/+3
| | | | | | | | | | | | | thus amdgpu_ib_free() can hook sched fence to SA manager in later patches. BTW: for amdgpu_free_job(), it should only fence_put() the fence of the last ib once, so fix it as well in this patch. Signed-off-by: Monk Liu <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: switch the GDS only on demand v2Christian König2016-03-081-0/+4
| | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> (v1) Reviewed-by: Chunming Zhou <[email protected]> (v1)
* drm/amdgpu: move the GDS switch into vm flush as wellChristian König2016-03-081-7/+4
| | | | | | | | After all it's an operation on the VMID. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: return the common fence from amdgpu_fence_emitChristian König2016-03-081-4/+3
| | | | | | | | Try to avoid using the hardware specific fences even more. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: remove HW fence ownerChristian König2016-03-081-4/+2
| | | | | | | | Not used any more since we now always use the sheduler. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
* drm/amdgpu: add hdp_invalidate functionChunming Zhou2016-03-081-0/+5
| | | | | | | | | It's called after emitting ibs. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: fix VM faults caused by vm_grab_id() v4Christian König2016-02-291-3/+4
| | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: move sync into job objectChristian König2016-02-101-11/+2
| | | | | | | | No need to keep that for every IB. Signed-off-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: directly return fence from ib_scheduleChristian König2016-02-101-1/+6
| | | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: move ring from IBs into jobChristian König2016-02-101-7/+4
| | | | | | | | We can't submit to multiple rings at the same time anyway. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: remove AMDGPU_NUM_SYNCSChristian König2016-02-101-1/+1
| | | | | | | | Just a leftover from semaphores. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: remove adev and fence from amdgpu_sync_freeChristian König2016-02-101-1/+1
| | | | | | | | Just leftovers from the semaphores. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: remove the ring lock v2Christian König2016-02-101-5/+5
| | | | | | | | | | | It's not needed any more because all access goes through the scheduler now. v2: Update commit message. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: grab VMID before submitting job v5Christian König2016-02-101-12/+5
| | | | | | | | | | | | | | This allows the scheduler to handle the dependencies on ID contention as well. v2: grab id only once v3: use a separate lock for the VMIDs v4: cleanup after semaphore removal v5: minor coding style change Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: clean up non-scheduler code path (v2)Chunming Zhou2016-02-101-4/+0
| | | | | | | | | | | 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: cleanup amdgpu_sync_rings V2Chunming Zhou2016-02-101-7/+3
| | | | | | | | | | | No longer needed now that semaphores are gone. V2: remove the first amdgpu_sync_wait in amdgpu_ib_schedule Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Ken Wang <[email protected]> (V1) Reviewed-by: Monk Liu <[email protected]> (V2) Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: remove the unnecessary parameter adev for amdgpu_sa_bo_new()Junwei Zhang2015-11-161-1/+1
| | | | | Signed-off-by: Junwei Zhang <[email protected]> Reviewed-by: Christian König <[email protected]>
* drm/amdgpu: use common fence for amdgpu_vm_fenceChristian König2015-11-161-1/+1
| | | | | | | | Just cleanup the function parameters. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: remove amdgpu_fence_ref/unrefChristian König2015-10-301-1/+2
| | | | | | | Just move the remaining users to fence_put/get. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: remove old lockup detection infrastructureChristian König2015-10-211-1/+0
| | | | | | | | It didn't worked to well anyway. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Junwei Zhang <[email protected]>
* drm/amdgpu: fix fence wait in sync_fence, instead should be in sync_ringsChristian König2015-08-251-1/+5
| | | | | | Signed-off-by: Christian König <[email protected]> Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: remove v_seq handling from the scheduler v2Christian König2015-08-251-5/+1
| | | | | | | | | | | 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: improve sa_bo->fence by kernel fenceChunming Zhou2015-08-251-2/+2
| | | | | Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian K?nig <[email protected]>
* drm/amdgpu: fix zeroing all IB fields manually v2Christian König2015-08-201-17/+0
| | | | | | | | | | | | | 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/amd: add scheduler fence implementation (v2)Chunming Zhou2015-08-171-1/+1
| | | | | | | | | 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: fix seq in ctx_add_fenceChunming Zhou2015-08-171-1/+5
| | | | | | | | 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: fix UVD/VCE fence handlingChristian König2015-08-171-3/+6
| | | | | | | | 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: rework vm_grab_id interfaceChristian König2015-08-171-3/+1
| | | | | | | This makes assigning VM IDs independent from the use of VM IDs. 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/+3
| | | | | | | | | | | 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-1/+5
| | | | | | | | 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: hdp_flush is not needed for inside IBmonk.liu2015-07-291-8/+8
| | | | | | | | hdp flush is not needed for IBs that dispatched from kernel inside because there is no video memory host access Signed-off-by: monk.liu <[email protected]> Reviewed-by: Christian König <[email protected]>
* drm/amdgpu: disable user fence interrupt (v2)Chunming Zhou2015-06-051-1/+2
| | | | | | | | | | amdgpu submits both kernel and user fences, but just need one interrupt, disable user fence interrupt and don't effect user fence. v2: fix merge error Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* drm/amdgpu: fix context switchChristian König2015-06-041-1/+7
| | | | | | | | | 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]>