[PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots
Danilo Krummrich
dakr at kernel.org
Tue Mar 18 12:39:02 UTC 2025
On Tue, Mar 18, 2025 at 01:03:12PM +0100, Christian König wrote:
> /**
> * drm_sched_job_add_dependency - adds the fence as a job dependency
> * @job: scheduler job to add the dependencies to
> @@ -878,10 +910,12 @@ int drm_sched_job_add_dependency(struct drm_sched_job *job,
> * engines involved, rather than the number of BOs.
> */
> xa_for_each(&job->dependencies, index, entry) {
> - if (entry->context != fence->context)
> + bool signaled = dma_fence_is_signaled(entry);
> +
> + if (!signaled && entry->context != fence->context)
> continue;
>
> - if (dma_fence_is_later(fence, entry)) {
> + if (signaled || dma_fence_is_later(fence, entry)) {
> dma_fence_put(entry);
> xa_store(&job->dependencies, index, fence, GFP_KERNEL);
> } else {
> @@ -890,7 +924,8 @@ int drm_sched_job_add_dependency(struct drm_sched_job *job,
> return 0;
> }
>
> - ret = xa_alloc(&job->dependencies, &id, fence, xa_limit_32b, GFP_KERNEL);
> + ret = xa_alloc(&job->dependencies, &id, fence, xa_limit_32b,
> + GFP_KERNEL);
> if (ret != 0)
> dma_fence_put(fence);
Those changes seem unrelated, aren't they?
More information about the amd-gfx
mailing list