From: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
To: Nirmoy Das <nirmoy.aiemd@gmail.com>, amd-gfx@lists.freedesktop.org
Cc: Boyuan.Zhang@amd.com, nirmoy.das@amd.com,
alexander.deucher@amd.com, James.Zhu@amd.com, Leo.Liu@amd.com,
christian.koenig@amd.com
Subject: Re: [RFC PATCH 1/2] drm/sched: implement drm_sched_entity_num_jobs
Date: Wed, 11 Mar 2020 13:23:51 -0400 [thread overview]
Message-ID: <98391772-ecca-035e-73ff-26a3d5c8286b@amd.com> (raw)
In-Reply-To: <20200311171809.7115-1-nirmoy.das@amd.com>
On 3/11/20 1:18 PM, Nirmoy Das wrote:
> Implement drm_sched_entity_num_jobs() so that drm drivers can
> query number of jobs in an entity.
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
> drivers/gpu/drm/scheduler/sched_entity.c | 15 +++++++++++++++
> include/drm/gpu_scheduler.h | 1 +
> 2 files changed, 16 insertions(+)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
> index 90fd9c30ae5a..dfe8216f2d52 100644
> --- a/drivers/gpu/drm/scheduler/sched_entity.c
> +++ b/drivers/gpu/drm/scheduler/sched_entity.c
> @@ -119,6 +119,21 @@ static bool drm_sched_entity_is_idle(struct drm_sched_entity *entity)
> return false;
> }
>
> +/**
> + * drm_sched_entity_num_job - Get number of jobs in the entity
> + *
> + * @entity: scheduler entity
> + *
> + * Returns number of jobs in the entity
> + */
> +int drm_sched_entity_num_jobs(struct drm_sched_entity *entity)
> +{
> + if (drm_sched_entity_is_idle(entity))
> + return 0;
> +
> + return spsc_queue_count(&entity->job_queue);
> +}
What about the jobs which already have been dequeued from job_queue and
are in progress in the HW ring but yet to complete - don't they count ?
Andrey
> +EXPORT_SYMBOL(drm_sched_entity_num_jobs);
> /**
> * drm_sched_entity_is_ready - Check if entity is ready
> *
> diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
> index d8972836d248..b5ceff75cbbe 100644
> --- a/include/drm/gpu_scheduler.h
> +++ b/include/drm/gpu_scheduler.h
> @@ -341,5 +341,6 @@ void drm_sched_fence_finished(struct drm_sched_fence *fence);
> unsigned long drm_sched_suspend_timeout(struct drm_gpu_scheduler *sched);
> void drm_sched_resume_timeout(struct drm_gpu_scheduler *sched,
> unsigned long remaining);
> +int drm_sched_entity_num_jobs(struct drm_sched_entity *entity);
>
> #endif
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-03-11 17:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 17:18 [RFC PATCH 1/2] drm/sched: implement drm_sched_entity_num_jobs Nirmoy Das
2020-03-11 17:18 ` [RFC PATCH 2/2] drm/amdgpu: disable gpu load balancer for vcn jobs Nirmoy Das
2020-03-11 18:03 ` Christian König
2020-03-11 18:47 ` Nirmoy
2020-03-11 17:23 ` Andrey Grodzovsky [this message]
2020-03-11 17:58 ` [RFC PATCH 1/2] drm/sched: implement drm_sched_entity_num_jobs Nirmoy
2020-03-11 17:57 ` Christian König
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=98391772-ecca-035e-73ff-26a3d5c8286b@amd.com \
--to=andrey.grodzovsky@amd.com \
--cc=Boyuan.Zhang@amd.com \
--cc=James.Zhu@amd.com \
--cc=Leo.Liu@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=nirmoy.aiemd@gmail.com \
--cc=nirmoy.das@amd.com \
/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