AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Prike Liang <Prike.Liang@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Alexander.Deucher@amd.com
Subject: Re: [PATCH 1/3] drm/amdgpu: add user queue vm identifier
Date: Wed, 5 Nov 2025 09:28:40 +0100	[thread overview]
Message-ID: <82d641b2-3941-4b3e-9fc6-b571f3f96b13@amd.com> (raw)
In-Reply-To: <20251105061630.4146604-1-Prike.Liang@amd.com>

On 11/5/25 07:16, Prike Liang wrote:
> Add a user queue vm identifier for each userqueue
> kms opt accessing.

Clear NAK to that approach, we don't want any specialized handling in the VM if userqueues are enabled.

Christian.

> 
> Signed-off-by: Prike Liang <Prike.Liang@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 5 +++++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c    | 2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h    | 2 +-
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> index 8888be4e758c..a8bb3f1b8649 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> @@ -1249,10 +1249,13 @@ amdgpu_userq_evict(struct amdgpu_userq_mgr *uq_mgr,
>  int amdgpu_userq_mgr_init(struct amdgpu_userq_mgr *userq_mgr, struct drm_file *file_priv,
>  			  struct amdgpu_device *adev)
>  {
> +	struct amdgpu_fpriv *fpriv = uq_mgr_to_fpriv(userq_mgr);
> +
>  	mutex_init(&userq_mgr->userq_mutex);
>  	xa_init_flags(&userq_mgr->userq_mgr_xa, XA_FLAGS_ALLOC);
>  	userq_mgr->adev = adev;
>  	userq_mgr->file = file_priv;
> +	fpriv->vm.is_userq_context = true;
>  
>  	INIT_DELAYED_WORK(&userq_mgr->resume_work, amdgpu_userq_restore_worker);
>  	return 0;
> @@ -1262,6 +1265,7 @@ void amdgpu_userq_mgr_fini(struct amdgpu_userq_mgr *userq_mgr)
>  {
>  	struct amdgpu_usermode_queue *queue;
>  	unsigned long queue_id;
> +	struct amdgpu_fpriv *fpriv = uq_mgr_to_fpriv(userq_mgr);
>  
>  	cancel_delayed_work_sync(&userq_mgr->resume_work);
>  
> @@ -1276,6 +1280,7 @@ void amdgpu_userq_mgr_fini(struct amdgpu_userq_mgr *userq_mgr)
>  	xa_destroy(&userq_mgr->userq_mgr_xa);
>  	mutex_unlock(&userq_mgr->userq_mutex);
>  	mutex_destroy(&userq_mgr->userq_mutex);
> +	fpriv->vm.is_userq_context = false;
>  }
>  
>  int amdgpu_userq_suspend(struct amdgpu_device *adev)
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index db66b4232de0..48a64d828eb8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -2591,7 +2591,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
>  	ttm_lru_bulk_move_init(&vm->lru_bulk_move);
>  
>  	vm->is_compute_context = false;
> -
> +	vm->is_userq_context = false;
>  	vm->use_cpu_for_update = !!(adev->vm_manager.vm_update_mode &
>  				    AMDGPU_VM_USE_CPU_FOR_GFX);
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> index 77207f4e448e..cbe7dfa4ffcb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> @@ -439,7 +439,7 @@ struct amdgpu_vm {
>  	struct ttm_lru_bulk_move lru_bulk_move;
>  	/* Flag to indicate if VM is used for compute */
>  	bool			is_compute_context;
> -
> +	bool			is_userq_context;
>  	/* Memory partition number, -1 means any partition */
>  	int8_t			mem_id;
>  


      parent reply	other threads:[~2025-11-05  8:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05  6:16 [PATCH 1/3] drm/amdgpu: add user queue vm identifier Prike Liang
2025-11-05  6:16 ` [PATCH 2/3] drm/amdgpu: rework the userq tlb flush Prike Liang
2025-11-05  8:31   ` Christian König
2025-11-05  6:16 ` [PATCH 3/3] drm/amdgpu: fix the vm update tlb sequence Prike Liang
2025-11-05  8:32   ` Christian König
2025-11-05  8:28 ` Christian König [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=82d641b2-3941-4b3e-9fc6-b571f3f96b13@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Prike.Liang@amd.com \
    --cc=amd-gfx@lists.freedesktop.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