From: Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
Nayan Deshmukh
<nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
christian.koenig-5C7GfCeVMHo@public.gmane.org,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
l.stach-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org
Subject: Re: [PATCH 1/2] drm/scheduler: modify API to avoid redundancy
Date: Fri, 20 Jul 2018 11:13:31 -0700 [thread overview]
Message-ID: <874lgtbws4.fsf@anholt.net> (raw)
In-Reply-To: <20180720122106.10344-1-nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 2551 bytes --]
Nayan Deshmukh <nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> entity has a scheduler field and we don't need the sched argument
> in any of the functions where entity is provided.
>
> Signed-off-by: Nayan Deshmukh <nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 13 +++++--------
> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 +--
> drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 +--
> drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 3 +--
> drivers/gpu/drm/etnaviv/etnaviv_sched.c | 4 ++--
> drivers/gpu/drm/scheduler/gpu_scheduler.c | 20 +++++++++++---------
> drivers/gpu/drm/v3d/v3d_drv.c | 4 +---
> drivers/gpu/drm/v3d/v3d_gem.c | 2 --
> include/drm/gpu_scheduler.h | 10 +++-------
> 13 files changed, 30 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c
> index dac71e3b4514..a3b55c542025 100644
> --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c
> +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c
> @@ -273,11 +273,12 @@ static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f,
> *
> * Returns the remaining time in jiffies left from the input timeout
> */
> -long drm_sched_entity_flush(struct drm_gpu_scheduler *sched,
> - struct drm_sched_entity *entity, long timeout)
> +long drm_sched_entity_flush(struct drm_sched_entity *entity, long timeout)
> {
> + struct drm_gpu_scheduler *sched;
> long ret = timeout;
>
> + sched = entity->sched;
> if (!drm_sched_entity_is_initialized(sched, entity))
> return ret;
> /**
> @@ -312,10 +313,11 @@ EXPORT_SYMBOL(drm_sched_entity_flush);
> * entity and signals all jobs with an error code if the process was killed.
> *
> */
> -void drm_sched_entity_fini(struct drm_gpu_scheduler *sched,
> - struct drm_sched_entity *entity)
> +void drm_sched_entity_fini(struct drm_sched_entity *entity)
> {
> + struct drm_gpu_scheduler *sched;
>
> + sched = entity->sched;
Maybe fold the initialization into the declaration above, like you did
elsewhere?
Regardless, this is a wonderful cleanup of the API.
Reviewed-by: Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-07-20 18:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-20 12:21 [PATCH 1/2] drm/scheduler: modify API to avoid redundancy Nayan Deshmukh
2018-07-20 14:47 ` Christian König
[not found] ` <20180720122106.10344-1-nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-07-20 12:21 ` [PATCH 2/2] drm/scheduler: remove sched field from the entity Nayan Deshmukh
[not found] ` <20180720122106.10344-2-nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-07-20 18:14 ` Eric Anholt
2018-07-20 18:13 ` Eric Anholt [this message]
2018-08-09 8:57 ` [PATCH 1/2] drm/scheduler: modify API to avoid redundancy Daniel Vetter
[not found] ` <CAKMK7uHNEqh0Z+Wh7ZCPNvHHs6+yd+kywZFHvryAzipuTD0XAw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-08-09 8:59 ` Nayan Deshmukh
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=874lgtbws4.fsf@anholt.net \
--to=eric-whkq6xtqapystnjn9+bgxg@public.gmane.org \
--cc=alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=l.stach-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=nayan26deshmukh-Re5JQEeQqe8AvxtiuMwx3w@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