AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Kuehling, Felix" <felix.kuehling@amd.com>
To: Philip Yang <Philip.Yang@amd.com>, amd-gfx@lists.freedesktop.org
Cc: christian.koenig@amd.com, david.yatsin@amd.com
Subject: Re: [PATCH v2 1/4] drm/amdkfd: Bind gfx9 MQD in GART with mtype RW
Date: Wed, 3 Dec 2025 12:40:59 -0500	[thread overview]
Message-ID: <026f82e1-be99-4a16-bf3f-dd6950c15cc7@amd.com> (raw)
In-Reply-To: <20251201142838.1516452-2-Philip.Yang@amd.com>

On 2025-12-01 09:28, Philip Yang wrote:
> For gfx9, bind MQD in GART with mtype RW to enable caching, to
> reduce queue switch latency.
>
> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h  | 1 +
>   2 files changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index e553cf411191..5f58cff2c28b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -841,6 +841,8 @@ static void amdgpu_ttm_gart_bind_gfx9_mqd(struct amdgpu_device *adev,
>   	int i;
>   	uint64_t ctrl_flags = AMDGPU_PTE_MTYPE_VG10(flags, AMDGPU_MTYPE_NC);
>   
> +	flags = AMDGPU_PTE_MTYPE_VG10(flags, AMDGPU_MTYPE_RW);
> +
>   	pages_per_xcc = total_pages;
>   	do_div(pages_per_xcc, num_xcc);
>   
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> index 139642eacdd0..4dd15767a722 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> @@ -101,6 +101,7 @@ struct amdgpu_bo_vm;
>   	  AMDGPU_PTE_MTYPE_VG10_SHIFT(mtype))
>   
>   #define AMDGPU_MTYPE_NC 0
> +#define AMDGPU_MTYPE_RW 1

This is probably not the right place to define this. MTYPE_RW is not 
universally available on all our GPUs. Not even on all GFX9 GPUs. This 
MTYPE definition needs to be in an ASIC-specific header file, and 
probably already exists somewhere.

Also, we can't use MTYPE_RW on GPUs that don't support it. I believe it 
was added in MI300.

Regards,
   Felix


>   #define AMDGPU_MTYPE_CC 2
>   
>   #define AMDGPU_PTE_DEFAULT_ATC  (AMDGPU_PTE_SYSTEM      \

  reply	other threads:[~2025-12-03 17:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 14:28 [PATCH v2 0/4] drm/amdkfd: Move gfx9 MQD to HBM Philip Yang
2025-12-01 14:28 ` [PATCH v2 1/4] drm/amdkfd: Bind gfx9 MQD in GART with mtype RW Philip Yang
2025-12-03 17:40   ` Kuehling, Felix [this message]
2025-12-04 15:10     ` Philip Yang
2025-12-01 14:28 ` [PATCH v2 2/4] drm/amdkfd: Add domain parameter to alloc kernel BO Philip Yang
2025-12-01 17:38   ` Russell, Kent
2025-12-01 20:31     ` Philip Yang
2025-12-01 22:48       ` Russell, Kent
2025-12-03 17:45       ` Kuehling, Felix
2025-12-01 14:28 ` [PATCH v2 3/4] drm/amdkfd: Move gfx9 MQD to VRAM domain Philip Yang
2025-12-03 17:55   ` Kuehling, Felix
2025-12-04 19:28     ` Philip Yang
2025-12-04 22:51     ` Philip Yang
2025-12-05 19:46       ` Felix Kuehling
2025-12-05 21:22         ` Philip Yang
2025-12-01 14:28 ` [PATCH v2 4/4] drm/amdkfd: Map VRAM MQD on GART Philip Yang
2025-12-03 16:06   ` Christian König
2025-12-04 22:43     ` Philip Yang
2025-12-05  9:30       ` Christian König
2025-12-03 15:52 ` [PATCH v2 0/4] drm/amdkfd: Move gfx9 MQD to HBM Philip Yang

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=026f82e1-be99-4a16-bf3f-dd6950c15cc7@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=Philip.Yang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=david.yatsin@amd.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