diff options
author | Matthew Brost <matthew.brost@intel.com> | 2023-05-22 04:24:20 +0300 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 19:34:44 +0300 |
commit | 8ae8a2e8dd21bd8bc94c9817874a97239aa867a2 (patch) | |
tree | 4287e92b7ad80bc9edb45d014b5e4bf432c08da6 /drivers/gpu/drm/xe/xe_exec.c | |
parent | 37430402618db90b53aa782a6c49f66ab0efced0 (diff) | |
download | linux-8ae8a2e8dd21bd8bc94c9817874a97239aa867a2.tar.xz |
drm/xe: Long running job update
For long running (LR) jobs with the DRM scheduler we must return NULL in
run_job which results in signaling the job's finished fence immediately.
This prevents LR jobs from creating infinite dma-fences.
Signaling job's finished fence immediately breaks flow controlling ring
with the DRM scheduler. To work around this, the ring is flow controlled
and written in the exec IOCTL. Signaling job's finished fence
immediately also breaks the TDR which is used in reset / cleanup entity
paths so write a new path for LR entities.
v2: Better commit, white space, remove rmb(), better comment next to
emit_job()
v3 (Thomas): Change LR reference counting, fix working in commit
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_exec.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_exec.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c index 4f7694a29348..700f65b66d40 100644 --- a/drivers/gpu/drm/xe/xe_exec.c +++ b/drivers/gpu/drm/xe/xe_exec.c @@ -14,6 +14,7 @@ #include "xe_device.h" #include "xe_engine.h" #include "xe_macros.h" +#include "xe_ring_ops_types.h" #include "xe_sched_job.h" #include "xe_sync.h" #include "xe_vm.h" @@ -302,6 +303,11 @@ retry: goto err_engine_end; } + if (xe_engine_is_lr(engine) && xe_engine_ring_full(engine)) { + err = -EWOULDBLOCK; + goto err_engine_end; + } + job = xe_sched_job_create(engine, xe_engine_is_parallel(engine) ? addresses : &args->address); if (IS_ERR(job)) { @@ -388,6 +394,8 @@ retry: xe_sync_entry_signal(&syncs[i], job, &job->drm.s_fence->finished); + if (xe_engine_is_lr(engine)) + engine->ring_ops->emit_job(job); xe_sched_job_push(job); xe_vm_reactivate_rebind(vm); |