Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Matthew Brost <matthew.brost@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH v2] drm/xe: Fix fence reservation accouting
Date: Tue, 12 Sep 2023 15:19:57 +0200	[thread overview]
Message-ID: <46ca9378-e333-1a42-c8ca-0d3434e3a832@linux.intel.com> (raw)
In-Reply-To: <20230911211829.2049126-1-matthew.brost@intel.com>

Hi,

On 9/11/23 23:18, Matthew Brost wrote:
> Both execs and the preempt rebind worker can issue rebinds. Rebinds
> require a fence, per tile, inserted into dma-resv slots of the VM and
> BO (if external). The fence reservation accouting did not take into
> account the number of fences required for rebinds, fix this.
>
> v2: Rebase
>
> Reported-by: Christopher Snowhill <kode54@gmail.com>
> Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/518
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>

Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>


> ---
>   drivers/gpu/drm/xe/xe_exec.c | 6 +++++-
>   drivers/gpu/drm/xe/xe_vm.c   | 7 ++++++-
>   2 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
> index 890fadb0a93e..eaf826f1b2a0 100644
> --- a/drivers/gpu/drm/xe/xe_exec.c
> +++ b/drivers/gpu/drm/xe/xe_exec.c
> @@ -103,7 +103,11 @@ static int xe_exec_begin(struct drm_exec *exec, struct xe_vm *vm)
>   	if (xe_vm_no_dma_fences(vm))
>   		return 0;
>   
> -	err = xe_vm_lock_dma_resv(vm, exec, 1, true);
> +	/*
> +	 * 1 fence for job from exec plus a fence for each tile from a possible
> +	 * rebind
> +	 */
> +	err = xe_vm_lock_dma_resv(vm, exec, 1 + vm->xe->info.tile_count, true);
>   	if (err)
>   		return err;
>   
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index a6a0f17fec1d..03ee6993e7c7 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -515,8 +515,13 @@ static int xe_preempt_work_begin(struct drm_exec *exec, struct xe_vm *vm,
>   	struct xe_vma *vma;
>   	int err;
>   
> +	/*
> +	 * 1 fence for each preempt fence plus a fence for each tile from a
> +	 * possible rebind
> +	 */
>   	err = drm_exec_prepare_obj(exec, &xe_vm_ttm_bo(vm)->base,
> -				   vm->preempt.num_exec_queues);
> +				   vm->preempt.num_exec_queues +
> +				   vm->xe->info.tile_count);
>   	if (err)
>   		return err;
>   

      parent reply	other threads:[~2023-09-12 13:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11 21:18 [Intel-xe] [PATCH v2] drm/xe: Fix fence reservation accouting Matthew Brost
2023-09-11 22:15 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: Fix fence reservation accouting (rev2) Patchwork
2023-09-11 22:15 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-09-11 22:16 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-09-11 22:23 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-09-11 22:24 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-09-11 22:25 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-09-11 22:57 ` [Intel-xe] ✓ CI.BAT: " Patchwork
2023-09-12 13:19 ` Thomas Hellström [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=46ca9378-e333-1a42-c8ca-0d3434e3a832@linux.intel.com \
    --to=thomas.hellstrom@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox