accel/ivpu: Add job status for jobs aborted by the driver
authorGrzegorz Trzebiatowski <grzegorz.trzebiatowski@intel.com>
Fri, 26 Jan 2024 12:28:04 +0000 (13:28 +0100)
committerJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Tue, 6 Feb 2024 12:37:34 +0000 (13:37 +0100)
Add DRM_IVPU_JOB_STATUS_ABORTED to indicate that the job was aborted
by the driver due to e.g. TDR or user context MMU faults.

This will help UMD and tests distinguish if job was aborted by the FW
or the driver.

Signed-off-by: Grzegorz Trzebiatowski <grzegorz.trzebiatowski@intel.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240126122804.2169129-8-jacek.lawrynowicz@linux.intel.com
drivers/accel/ivpu/ivpu_job.c
include/uapi/drm/ivpu_accel.h

index 0440bee3ecafd567da6cbf47584f3daa688b618d..e70cfb8593390e489e9f9868fb6c2420733ae241 100644 (file)
@@ -294,7 +294,7 @@ static int ivpu_job_signal_and_destroy(struct ivpu_device *vdev, u32 job_id, u32
                return -ENOENT;
 
        if (job->file_priv->has_mmu_faults)
-               job_status = VPU_JSM_STATUS_ABORTED;
+               job_status = DRM_IVPU_JOB_STATUS_ABORTED;
 
        job->bos[CMD_BUF_IDX]->job_status = job_status;
        dma_fence_signal(job->done_fence);
@@ -315,7 +315,7 @@ void ivpu_jobs_abort_all(struct ivpu_device *vdev)
        unsigned long id;
 
        xa_for_each(&vdev->submitted_jobs_xa, id, job)
-               ivpu_job_signal_and_destroy(vdev, id, VPU_JSM_STATUS_ABORTED);
+               ivpu_job_signal_and_destroy(vdev, id, DRM_IVPU_JOB_STATUS_ABORTED);
 }
 
 static int ivpu_job_submit(struct ivpu_job *job)
index 63c49318a863076b0861b945c1511d98f9ffffe3..19a13468eca5e4c13cbdf05444604a54567a67ae 100644 (file)
@@ -305,6 +305,7 @@ struct drm_ivpu_submit {
 
 /* drm_ivpu_bo_wait job status codes */
 #define DRM_IVPU_JOB_STATUS_SUCCESS 0
+#define DRM_IVPU_JOB_STATUS_ABORTED 256
 
 /**
  * struct drm_ivpu_bo_wait - Wait for BO to become inactive