AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
	amd-gfx@lists.freedesktop.org, Marek.Olsak@amd.com
Cc: "Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH 06/10] drm/amdgpu: properly imbed the IBs into the job
Date: Thu, 3 Mar 2022 15:25:34 -0500	[thread overview]
Message-ID: <9ee58322-d842-eca9-6d16-c3efcc525483@amd.com> (raw)
In-Reply-To: <20220303082308.38217-7-christian.koenig@amd.com>

Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>

Andrey

On 2022-03-03 03:23, Christian König wrote:
> We now have standard macros for that.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 7 +------
>   drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 6 ++++--
>   2 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> index 38c9fd7b7ad4..e4ca62225996 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> @@ -78,14 +78,10 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job)
>   int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs,
>   		     struct amdgpu_job **job, struct amdgpu_vm *vm)
>   {
> -	size_t size = sizeof(struct amdgpu_job);
> -
>   	if (num_ibs == 0)
>   		return -EINVAL;
>   
> -	size += sizeof(struct amdgpu_ib) * num_ibs;
> -
> -	*job = kzalloc(size, GFP_KERNEL);
> +	*job = kzalloc(struct_size(*job, ibs, num_ibs), GFP_KERNEL);
>   	if (!*job)
>   		return -ENOMEM;
>   
> @@ -95,7 +91,6 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs,
>   	 */
>   	(*job)->base.sched = &adev->rings[0]->sched;
>   	(*job)->vm = vm;
> -	(*job)->ibs = (void *)&(*job)[1];
>   	(*job)->num_ibs = num_ibs;
>   
>   	amdgpu_sync_create(&(*job)->sync);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
> index 6d704772ff42..d599c0540b46 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
> @@ -25,6 +25,7 @@
>   
>   #include <drm/gpu_scheduler.h>
>   #include "amdgpu_sync.h"
> +#include "amdgpu_ring.h"
>   
>   /* bit set means command submit involves a preamble IB */
>   #define AMDGPU_PREAMBLE_IB_PRESENT          (1 << 0)
> @@ -48,12 +49,10 @@ struct amdgpu_job {
>   	struct amdgpu_vm	*vm;
>   	struct amdgpu_sync	sync;
>   	struct amdgpu_sync	sched_sync;
> -	struct amdgpu_ib	*ibs;
>   	struct dma_fence	hw_fence;
>   	struct dma_fence	*external_hw_fence;
>   	uint32_t		preamble_status;
>   	uint32_t                preemption_status;
> -	uint32_t		num_ibs;
>   	bool                    vm_needs_flush;
>   	uint64_t		vm_pd_addr;
>   	unsigned		vmid;
> @@ -69,6 +68,9 @@ struct amdgpu_job {
>   
>   	/* job_run_counter >= 1 means a resubmit job */
>   	uint32_t		job_run_counter;
> +
> +	uint32_t		num_ibs;
> +	struct amdgpu_ib	ibs[];
>   };
>   
>   int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs,

  reply	other threads:[~2022-03-03 20:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03  8:22 Gang submit Christian König
2022-03-03  8:22 ` [PATCH 01/10] drm/amdgpu: install ctx entities with cmpxchg Christian König
2022-03-03 19:52   ` Andrey Grodzovsky
2022-03-03  8:23 ` [PATCH 02/10] drm/amdgpu: header cleanup Christian König
2022-03-03 19:56   ` Andrey Grodzovsky
2022-03-03  8:23 ` [PATCH 03/10] drm/amdgpu: cleanup and reorder amdgpu_cs.c Christian König
2022-03-03  8:23 ` [PATCH 04/10] drm/amdgpu: remove SRIOV and MCBP dependencies from the CS Christian König
2022-03-03  8:23 ` [PATCH 05/10] drm/amdgpu: use job and ib structures directly in CS parsers Christian König
2022-03-03 20:16   ` Andrey Grodzovsky
2022-03-03  8:23 ` [PATCH 06/10] drm/amdgpu: properly imbed the IBs into the job Christian König
2022-03-03 20:25   ` Andrey Grodzovsky [this message]
2022-03-03  8:23 ` [PATCH 07/10] drm/amdgpu: move setting the job resources Christian König
2022-03-03  8:23 ` [PATCH 08/10] drm/amdgpu: initialize the vmid_wait with the stub fence Christian König
2022-03-03 20:31   ` Andrey Grodzovsky
2022-03-03  8:23 ` [PATCH 09/10] drm/amdgpu: add gang submit backend Christian König
2022-03-04 17:10   ` Andrey Grodzovsky
2022-03-05 18:40     ` Christian König
2022-03-07 15:40       ` Andrey Grodzovsky
2022-03-07 15:59         ` Christian König
2022-03-07 16:02           ` Andrey Grodzovsky
2022-03-03  8:23 ` [PATCH 10/10] drm/amdgpu: add gang submit frontend Christian König
2022-03-07 17:02   ` Andrey Grodzovsky
2022-06-01 12:09   ` Mohan Marimuthu, Yogesh
2022-06-01 12:11     ` Christian König
2022-06-01 13:21       ` Mohan Marimuthu, Yogesh
2022-09-06  1:43 ` Gang submit Liu, Monk
2022-09-06  9:02   ` 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=9ee58322-d842-eca9-6d16-c3efcc525483@amd.com \
    --to=andrey.grodzovsky@amd.com \
    --cc=Marek.Olsak@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=ckoenig.leichtzumerken@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