From: Sharat Masetty <smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
Sharat Masetty <smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH 11/13] drm/scheduler: Add a timeout_start_notify function op
Date: Mon, 1 Oct 2018 18:01:43 +0530 [thread overview]
Message-ID: <1538397105-19581-12-git-send-email-smasetty@codeaurora.org> (raw)
In-Reply-To: <1538397105-19581-1-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Add an optional backend function op which will let the scheduler clients
know when the timeout work got scheduled for a job. This will help
drivers with multiple schedulers(one per ring) measure time spent on the
ring accurately, eventually helping with better timeout detection.
Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>
---
drivers/gpu/drm/scheduler/gpu_scheduler.c | 16 +++++++++++++---
include/drm/gpu_scheduler.h | 6 ++++++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c
index bf0e0c9..f5534ff 100644
--- a/drivers/gpu/drm/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c
@@ -69,6 +69,16 @@ static void drm_sched_rq_remove_entity(struct drm_sched_rq *rq,
spin_unlock(&rq->lock);
}
+static void drm_sched_queue_delayed_work(struct drm_sched_job *s_job)
+{
+ struct drm_gpu_scheduler *sched = s_job->sched;
+
+ schedule_delayed_work(&s_job->work_tdr, sched->timeout);
+
+ if (sched->ops->timeout_start_notify)
+ sched->ops->timeout_start_notify(s_job);
+}
+
/**
* Select an entity which could provide a job to run
*
@@ -467,7 +477,7 @@ static void drm_sched_job_finish(struct work_struct *work)
struct drm_sched_job, node);
if (next)
- schedule_delayed_work(&next->work_tdr, sched->timeout);
+ drm_sched_queue_delayed_work(next);
}
spin_unlock(&sched->job_list_lock);
dma_fence_put(&s_job->s_fence->finished);
@@ -494,7 +504,7 @@ static void drm_sched_job_begin(struct drm_sched_job *s_job)
if (sched->timeout != MAX_SCHEDULE_TIMEOUT &&
list_first_entry_or_null(&sched->ring_mirror_list,
struct drm_sched_job, node) == s_job)
- schedule_delayed_work(&s_job->work_tdr, sched->timeout);
+ drm_sched_queue_delayed_work(s_job);
spin_unlock(&sched->job_list_lock);
}
@@ -560,7 +570,7 @@ void drm_sched_job_recovery(struct drm_gpu_scheduler *sched)
s_job = list_first_entry_or_null(&sched->ring_mirror_list,
struct drm_sched_job, node);
if (s_job && sched->timeout != MAX_SCHEDULE_TIMEOUT)
- schedule_delayed_work(&s_job->work_tdr, sched->timeout);
+ drm_sched_queue_delayed_work(s_job);
list_for_each_entry_safe(s_job, tmp, &sched->ring_mirror_list, node) {
struct drm_sched_fence *s_fence = s_job->s_fence;
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
index dec6558..5c59c38 100644
--- a/include/drm/gpu_scheduler.h
+++ b/include/drm/gpu_scheduler.h
@@ -157,6 +157,12 @@ struct drm_sched_backend_ops {
* it's time to clean it up.
*/
void (*free_job)(struct drm_sched_job *sched_job);
+
+ /*
+ * (Optional) Called to let the driver know that a timeout detection
+ * timer has been started for this job.
+ */
+ void (*timeout_start_notify)(struct drm_sched_job *sched_job);
};
/**
--
1.9.1
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2018-10-01 12:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-01 12:31 [PATCH 00/13] drm/msm: Hook up the DRM gpu scheduler Sharat Masetty
[not found] ` <1538397105-19581-1-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 12:31 ` [PATCH 01/13] drm/msm: Track GPU fences with idr Sharat Masetty
[not found] ` <1538397105-19581-2-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 19:03 ` Jordan Crouse
[not found] ` <20181001190333.GE31641-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
2018-10-01 21:49 ` Rob Clark
2018-10-01 12:31 ` [PATCH 02/13] drm/msm: Change msm_gpu_submit() API Sharat Masetty
[not found] ` <1538397105-19581-3-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 18:00 ` Jordan Crouse
2018-10-01 12:31 ` [PATCH 03/13] drm/msm: Save the ring name in the ring structure Sharat Masetty
[not found] ` <1538397105-19581-4-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 18:01 ` Jordan Crouse
2018-10-01 12:31 ` [PATCH 04/13] drm/msm: Change the name of the fence to hw_fence Sharat Masetty
2018-10-01 12:31 ` [PATCH 05/13] drm/msm: rearrange submit buffer objects clean up Sharat Masetty
2018-10-01 12:31 ` [PATCH 06/13] drm/msm: Use kzalloc for submit struct allocation Sharat Masetty
[not found] ` <1538397105-19581-7-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 18:13 ` Jordan Crouse
2018-10-03 10:50 ` [Freedreno] " Sharat Masetty
2018-10-01 12:31 ` [PATCH 07/13] drm/msm: Fix leak in submitqueue create Sharat Masetty
2018-10-01 12:31 ` [PATCH 08/13] drm/scheduler: set sched->thread to NULL in failure Sharat Masetty
2018-10-01 12:31 ` [PATCH 09/13] drm/msm: Use the DRM common Scheduler Sharat Masetty
[not found] ` <1538397105-19581-10-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 19:02 ` Jordan Crouse
2018-10-03 10:43 ` Sharat Masetty
2018-10-01 12:31 ` [PATCH 10/13] msm/drm: Remove unused code Sharat Masetty
2018-10-01 12:31 ` Sharat Masetty [this message]
2018-10-01 12:31 ` [PATCH 12/13] jiffies: add utility function to calculate delta in ms Sharat Masetty
2018-10-01 12:31 ` [PATCH 13/13] drm/msm: Implement better timeout detection Sharat Masetty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1538397105-19581-12-git-send-email-smasetty@codeaurora.org \
--to=smasetty-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox