@@ -76,6 +76,7 @@
#include <linux/sched.h>
#include <linux/completion.h>
#include <linux/dma-resv.h>
+#include <linux/dma-fence-preempt.h>
#include <uapi/linux/sched/types.h>
#include <drm/drm_print.h>
@@ -916,7 +917,8 @@ static int __drm_sched_job_add_dependency(struct drm_sched_job *job,
int drm_sched_job_add_dependency(struct drm_sched_job *job,
struct dma_fence *fence)
{
- return __drm_sched_job_add_dependency(job, fence, false);
+ return __drm_sched_job_add_dependency(job, fence,
+ dma_fence_is_preempt(fence));
}
EXPORT_SYMBOL(drm_sched_job_add_dependency);
Update drm_sched_job_add_dependency to detect dma_fence_preempt and correctly store it in the dedicated preemptive fence xarray ensuring preempt fence semantics are followed. Cc: Philipp Stanner <pstanner@redhat.com> Cc: Danilo Krummrich <dakr@kernel.org> Cc: Luben Tuikov <ltuikov89@gmail.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Simona Vetter <simona.vetter@ffwll.ch> Cc: Christian Koenig <christian.koenig@amd.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> --- drivers/gpu/drm/scheduler/sched_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)