From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Francois Dugast <francois.dugast@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
Matthew Brost <matthew.brost@intel.com>
Subject: Re: [PATCH] drm/xe/sched_job: Promote xe_sched_job_add_deps()
Date: Fri, 14 Jun 2024 16:46:11 -0400 [thread overview]
Message-ID: <ZmysExm-ZB121uuD@intel.com> (raw)
In-Reply-To: <20240614094433.775866-1-francois.dugast@intel.com>
On Fri, Jun 14, 2024 at 11:44:33AM +0200, Francois Dugast wrote:
> Move it out of the xe_migrate compilation unit so it can be re-used in
> other places.
I would call it 'component' instead of 'compilation unit' but anyway,
nothing wrong and the change is good.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(and pushing soon)
>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Francois Dugast <francois.dugast@intel.com>
> ---
> drivers/gpu/drm/xe/xe_exec.c | 6 +++---
> drivers/gpu/drm/xe/xe_migrate.c | 26 ++++++++++----------------
> drivers/gpu/drm/xe/xe_sched_job.c | 6 ++++++
> drivers/gpu/drm/xe/xe_sched_job.h | 3 +++
> 4 files changed, 22 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
> index 4cf6c6ab4866..2d72cdec3a0b 100644
> --- a/drivers/gpu/drm/xe/xe_exec.c
> +++ b/drivers/gpu/drm/xe/xe_exec.c
> @@ -259,9 +259,9 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
>
> /* Wait behind rebinds */
> if (!xe_vm_in_lr_mode(vm)) {
> - err = drm_sched_job_add_resv_dependencies(&job->drm,
> - xe_vm_resv(vm),
> - DMA_RESV_USAGE_KERNEL);
> + err = xe_sched_job_add_deps(job,
> + xe_vm_resv(vm),
> + DMA_RESV_USAGE_KERNEL);
> if (err)
> goto err_put_job;
> }
> diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
> index 7e3fb33110d9..efdf148ae59e 100644
> --- a/drivers/gpu/drm/xe/xe_migrate.c
> +++ b/drivers/gpu/drm/xe/xe_migrate.c
> @@ -647,12 +647,6 @@ static void emit_copy(struct xe_gt *gt, struct xe_bb *bb,
> bb->cs[bb->len++] = upper_32_bits(src_ofs);
> }
>
> -static int job_add_deps(struct xe_sched_job *job, struct dma_resv *resv,
> - enum dma_resv_usage usage)
> -{
> - return drm_sched_job_add_resv_dependencies(&job->drm, resv, usage);
> -}
> -
> static u64 xe_migrate_batch_base(struct xe_migrate *m, bool usm)
> {
> return usm ? m->usm_batch_base_ofs : m->batch_base_ofs;
> @@ -849,11 +843,11 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
>
> xe_sched_job_add_migrate_flush(job, flush_flags);
> if (!fence) {
> - err = job_add_deps(job, src_bo->ttm.base.resv,
> - DMA_RESV_USAGE_BOOKKEEP);
> + err = xe_sched_job_add_deps(job, src_bo->ttm.base.resv,
> + DMA_RESV_USAGE_BOOKKEEP);
> if (!err && src_bo != dst_bo)
> - err = job_add_deps(job, dst_bo->ttm.base.resv,
> - DMA_RESV_USAGE_BOOKKEEP);
> + err = xe_sched_job_add_deps(job, dst_bo->ttm.base.resv,
> + DMA_RESV_USAGE_BOOKKEEP);
> if (err)
> goto err_job;
> }
> @@ -1091,8 +1085,8 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m,
> * fences, which are always tracked as
> * DMA_RESV_USAGE_KERNEL.
> */
> - err = job_add_deps(job, bo->ttm.base.resv,
> - DMA_RESV_USAGE_KERNEL);
> + err = xe_sched_job_add_deps(job, bo->ttm.base.resv,
> + DMA_RESV_USAGE_KERNEL);
> if (err)
> goto err_job;
> }
> @@ -1417,8 +1411,8 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
>
> /* Wait on BO move */
> if (bo) {
> - err = job_add_deps(job, bo->ttm.base.resv,
> - DMA_RESV_USAGE_KERNEL);
> + err = xe_sched_job_add_deps(job, bo->ttm.base.resv,
> + DMA_RESV_USAGE_KERNEL);
> if (err)
> goto err_job;
> }
> @@ -1428,8 +1422,8 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
> * trigger preempts before moving forward
> */
> if (first_munmap_rebind) {
> - err = job_add_deps(job, xe_vm_resv(vm),
> - DMA_RESV_USAGE_BOOKKEEP);
> + err = xe_sched_job_add_deps(job, xe_vm_resv(vm),
> + DMA_RESV_USAGE_BOOKKEEP);
> if (err)
> goto err_job;
> }
> diff --git a/drivers/gpu/drm/xe/xe_sched_job.c b/drivers/gpu/drm/xe/xe_sched_job.c
> index 5c013904877a..44d534e362cd 100644
> --- a/drivers/gpu/drm/xe/xe_sched_job.c
> +++ b/drivers/gpu/drm/xe/xe_sched_job.c
> @@ -363,3 +363,9 @@ xe_sched_job_snapshot_print(struct xe_sched_job_snapshot *snapshot,
> for (i = 0; i < snapshot->batch_addr_len; i++)
> drm_printf(p, "batch_addr[%u]: 0x%016llx\n", i, snapshot->batch_addr[i]);
> }
> +
> +int xe_sched_job_add_deps(struct xe_sched_job *job, struct dma_resv *resv,
> + enum dma_resv_usage usage)
> +{
> + return drm_sched_job_add_resv_dependencies(&job->drm, resv, usage);
> +}
> diff --git a/drivers/gpu/drm/xe/xe_sched_job.h b/drivers/gpu/drm/xe/xe_sched_job.h
> index f362e28455db..3dc72c5c1f13 100644
> --- a/drivers/gpu/drm/xe/xe_sched_job.h
> +++ b/drivers/gpu/drm/xe/xe_sched_job.h
> @@ -90,4 +90,7 @@ struct xe_sched_job_snapshot *xe_sched_job_snapshot_capture(struct xe_sched_job
> void xe_sched_job_snapshot_free(struct xe_sched_job_snapshot *snapshot);
> void xe_sched_job_snapshot_print(struct xe_sched_job_snapshot *snapshot, struct drm_printer *p);
>
> +int xe_sched_job_add_deps(struct xe_sched_job *job, struct dma_resv *resv,
> + enum dma_resv_usage usage);
> +
> #endif
> --
> 2.43.0
>
prev parent reply other threads:[~2024-06-14 20:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-14 9:44 [PATCH] drm/xe/sched_job: Promote xe_sched_job_add_deps() Francois Dugast
2024-06-14 9:49 ` ✓ CI.Patch_applied: success for " Patchwork
2024-06-14 9:49 ` ✓ CI.checkpatch: " Patchwork
2024-06-14 9:50 ` ✓ CI.KUnit: " Patchwork
2024-06-14 10:02 ` ✓ CI.Build: " Patchwork
2024-06-14 10:04 ` ✗ CI.Hooks: failure " Patchwork
2024-06-14 10:05 ` ✓ CI.checksparse: success " Patchwork
2024-06-14 10:28 ` ✓ CI.BAT: " Patchwork
2024-06-14 17:35 ` ✓ CI.FULL: " Patchwork
2024-06-14 20:46 ` Rodrigo Vivi [this message]
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=ZmysExm-ZB121uuD@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=francois.dugast@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.