[PATCH 1/2] drm: add a flag to indicate job is resubmitted
Liu, Monk
Monk.Liu at amd.com
Thu Feb 25 06:03:12 UTC 2021
[AMD Official Use Only - Internal Distribution Only]
Patches are fine by me, reviewed by: Monk Liu <monk.liu at amd.com>
Still need Christian to take a look
Thanks
------------------------------------------
Monk Liu | Cloud-GPU Core team
------------------------------------------
-----Original Message-----
From: Jingwen Chen <Jingwen.Chen2 at amd.com>
Sent: Thursday, February 25, 2021 1:27 PM
To: amd-gfx at lists.freedesktop.org
Cc: Liu, Monk <Monk.Liu at amd.com>; Koenig, Christian <Christian.Koenig at amd.com>; Chen, JingWen <JingWen.Chen2 at amd.com>
Subject: [PATCH 1/2] drm: add a flag to indicate job is resubmitted
Add a flag in drm_sched_job to indicate the job resubmit.
Signed-off-by: Jingwen Chen <Jingwen.Chen2 at amd.com>
---
drivers/gpu/drm/scheduler/sched_main.c | 2 ++
include/drm/gpu_scheduler.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index da24c4e8b9fb..d59ac90f5081 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -517,6 +517,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
if (found_guilty && s_job->s_fence->scheduled.context == guilty_context)
dma_fence_set_error(&s_fence->finished, -ECANCELED);
+ s_job->flags |= DRM_FLAG_RESUBMIT_JOB;
dma_fence_put(s_job->s_fence->parent);
fence = sched->ops->run_job(s_job);
@@ -565,6 +566,7 @@ int drm_sched_job_init(struct drm_sched_job *job,
if (!job->s_fence)
return -ENOMEM;
job->id = atomic64_inc_return(&sched->job_id_count);
+ job->flags = 0;
INIT_LIST_HEAD(&job->node);
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 92436553fd6a..a22122f98c9c 100644
--- a/include/drm/gpu_scheduler.h
+++ b/include/drm/gpu_scheduler.h
@@ -29,6 +29,7 @@
#include <linux/completion.h>
#define MAX_WAIT_SCHED_ENTITY_Q_EMPTY msecs_to_jiffies(1000)
+#define DRM_FLAG_RESUBMIT_JOB (1 << 0)
struct drm_gpu_scheduler;
struct drm_sched_rq;
@@ -198,6 +199,7 @@ struct drm_sched_job {
enum drm_sched_priority s_priority;
struct drm_sched_entity *entity;
struct dma_fence_cb cb;
+ uint32_t flags;
};
static inline bool drm_sched_invalidate_job(struct drm_sched_job *s_job,
--
2.25.1
More information about the amd-gfx
mailing list