From: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
amd-gfx@lists.freedesktop.org, Marek.Olsak@amd.com,
timur.kristof@gmail.com, Yogesh.Mohanmarimuthu@amd.com
Cc: "Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH 07/10] drm/amdgpu: move setting the job resources
Date: Thu, 14 Jul 2022 14:32:14 -0400 [thread overview]
Message-ID: <e4146d79-7532-1fdd-752f-0213d133fd99@amd.com> (raw)
In-Reply-To: <20220714103902.7084-8-christian.koenig@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Andrey
On 2022-07-14 06:38, Christian König wrote:
> Move setting the job resources into amdgpu_job.c
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 21 ++-------------------
> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 17 +++++++++++++++++
> drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 2 ++
> 3 files changed, 21 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index dfb7b4f46bc3..88f491dc7ca2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -828,9 +828,6 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
> struct amdgpu_vm *vm = &fpriv->vm;
> struct amdgpu_bo_list_entry *e;
> struct list_head duplicates;
> - struct amdgpu_bo *gds;
> - struct amdgpu_bo *gws;
> - struct amdgpu_bo *oa;
> int r;
>
> INIT_LIST_HEAD(&p->validated);
> @@ -947,22 +944,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
> amdgpu_cs_report_moved_bytes(p->adev, p->bytes_moved,
> p->bytes_moved_vis);
>
> - gds = p->bo_list->gds_obj;
> - gws = p->bo_list->gws_obj;
> - oa = p->bo_list->oa_obj;
> -
> - if (gds) {
> - p->job->gds_base = amdgpu_bo_gpu_offset(gds) >> PAGE_SHIFT;
> - p->job->gds_size = amdgpu_bo_size(gds) >> PAGE_SHIFT;
> - }
> - if (gws) {
> - p->job->gws_base = amdgpu_bo_gpu_offset(gws) >> PAGE_SHIFT;
> - p->job->gws_size = amdgpu_bo_size(gws) >> PAGE_SHIFT;
> - }
> - if (oa) {
> - p->job->oa_base = amdgpu_bo_gpu_offset(oa) >> PAGE_SHIFT;
> - p->job->oa_size = amdgpu_bo_size(oa) >> PAGE_SHIFT;
> - }
> + amdgpu_job_set_resources(p->job, p->bo_list->gds_obj,
> + p->bo_list->gws_obj, p->bo_list->oa_obj);
>
> if (p->uf_entry.tv.bo) {
> struct amdgpu_bo *uf = ttm_to_amdgpu_bo(p->uf_entry.tv.bo);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> index 36c1be77bf8f..3255b2fca611 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> @@ -129,6 +129,23 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size,
> return r;
> }
>
> +void amdgpu_job_set_resources(struct amdgpu_job *job, struct amdgpu_bo *gds,
> + struct amdgpu_bo *gws, struct amdgpu_bo *oa)
> +{
> + if (gds) {
> + job->gds_base = amdgpu_bo_gpu_offset(gds) >> PAGE_SHIFT;
> + job->gds_size = amdgpu_bo_size(gds) >> PAGE_SHIFT;
> + }
> + if (gws) {
> + job->gws_base = amdgpu_bo_gpu_offset(gws) >> PAGE_SHIFT;
> + job->gws_size = amdgpu_bo_size(gws) >> PAGE_SHIFT;
> + }
> + if (oa) {
> + job->oa_base = amdgpu_bo_gpu_offset(oa) >> PAGE_SHIFT;
> + job->oa_size = amdgpu_bo_size(oa) >> PAGE_SHIFT;
> + }
> +}
> +
> void amdgpu_job_free_resources(struct amdgpu_job *job)
> {
> struct amdgpu_ring *ring = to_amdgpu_ring(job->base.sched);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
> index d599c0540b46..0bab8fe0d419 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
> @@ -77,6 +77,8 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs,
> struct amdgpu_job **job, struct amdgpu_vm *vm);
> int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size,
> enum amdgpu_ib_pool_type pool, struct amdgpu_job **job);
> +void amdgpu_job_set_resources(struct amdgpu_job *job, struct amdgpu_bo *gds,
> + struct amdgpu_bo *gws, struct amdgpu_bo *oa);
> void amdgpu_job_free_resources(struct amdgpu_job *job);
> void amdgpu_job_free(struct amdgpu_job *job);
> int amdgpu_job_submit(struct amdgpu_job *job, struct drm_sched_entity *entity,
next prev parent reply other threads:[~2022-07-14 18:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 10:38 Gang submit v2 Christian König
2022-07-14 10:38 ` [PATCH 01/10] drm/sched: move calling drm_sched_entity_select_rq Christian König
2022-07-14 15:43 ` Andrey Grodzovsky
2022-07-14 16:26 ` Christian König
2022-07-14 18:25 ` Andrey Grodzovsky
2022-07-14 10:38 ` [PATCH 02/10] drm/amdgpu: Protect the amdgpu_bo_list list with a mutex v2 Christian König
2022-07-14 15:10 ` Alex Deucher
2022-07-14 19:10 ` Luben Tuikov
2022-07-14 10:38 ` [PATCH 03/10] drm/amdgpu: revert "partial revert "remove ctx->lock" v2" Christian König
2022-07-14 10:38 ` [PATCH 04/10] drm/amdgpu: use DMA_RESV_USAGE_BOOKKEEP Christian König
2022-07-14 10:38 ` [PATCH 05/10] drm/amdgpu: cleanup and reorder amdgpu_cs.c Christian König
2022-07-14 10:38 ` [PATCH 06/10] drm/amdgpu: remove SRIOV and MCBP dependencies from the CS Christian König
2022-07-14 10:38 ` [PATCH 07/10] drm/amdgpu: move setting the job resources Christian König
2022-07-14 15:40 ` Luben Tuikov
2022-07-14 18:32 ` Andrey Grodzovsky [this message]
2022-07-14 10:39 ` [PATCH 08/10] drm/amdgpu: revert "fix limiting AV1 to the first instance on VCN3" Christian König
2022-07-14 10:39 ` [PATCH 09/10] drm/amdgpu: add gang submit backend Christian König
2022-07-14 14:36 ` Andrey Grodzovsky
2022-07-14 19:32 ` Luben Tuikov
2022-07-14 10:39 ` [PATCH 10/10] drm/amdgpu: add gang submit frontend v2 Christian König
2022-07-14 19:10 ` Andrey Grodzovsky
-- strict thread matches above, loose matches on Subject: below --
2022-03-03 8:22 Gang submit Christian König
2022-03-03 8:23 ` [PATCH 07/10] drm/amdgpu: move setting the job resources 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=e4146d79-7532-1fdd-752f-0213d133fd99@amd.com \
--to=andrey.grodzovsky@amd.com \
--cc=Marek.Olsak@amd.com \
--cc=Yogesh.Mohanmarimuthu@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=timur.kristof@gmail.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