AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: YuBiao Wang <YuBiao.Wang@amd.com>,
	amd-gfx@lists.freedesktop.org, "Kuehling,
	Felix" <Felix.Kuehling@amd.com>,
	"Sharma, Shashank" <Shashank.Sharma@amd.com>
Cc: Feifei Xu <Feifei.Xu@amd.com>,
	horace.chen@amd.com, Kevin Wang <Kevin1.Wang@amd.com>,
	Tuikov Luben <Luben.Tuikov@amd.com>,
	Deucher Alexander <Alexander.Deucher@amd.com>,
	Monk Liu <Monk.Liu@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>
Subject: Re: [PATCH] drm/amdkfd: Use gpu_offset for user queue's wptr
Date: Fri, 15 Sep 2023 08:50:01 +0200	[thread overview]
Message-ID: <81a73442-2d27-eab8-4dec-cb1a6d179ab3@amd.com> (raw)
In-Reply-To: <20230915025213.2463291-1-YuBiao.Wang@amd.com>

Am 15.09.23 um 04:52 schrieb YuBiao Wang:
> Directly use tbo's start address will miss the domain start offset. Need
> to use gpu_offset instead.
>
> Signed-off-by: YuBiao Wang <YuBiao.Wang@amd.com>

Felix and/or Shashank should probably take a look as well, but of hand 
that looks like the correct fix.

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> index 77159b03a422..36e7171ad9a7 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> @@ -216,7 +216,7 @@ static int add_queue_mes(struct device_queue_manager *dqm, struct queue *q,
>   
>   	if (q->wptr_bo) {
>   		wptr_addr_off = (uint64_t)q->properties.write_ptr & (PAGE_SIZE - 1);
> -		queue_input.wptr_mc_addr = ((uint64_t)q->wptr_bo->tbo.resource->start << PAGE_SHIFT) + wptr_addr_off;
> +		queue_input.wptr_mc_addr = amdgpu_bo_gpu_offset(q->wptr_bo) + wptr_addr_off;
>   	}
>   
>   	queue_input.is_kfd_process = 1;


  reply	other threads:[~2023-09-15  6:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15  2:52 [PATCH] drm/amdkfd: Use gpu_offset for user queue's wptr YuBiao Wang
2023-09-15  6:50 ` Christian König [this message]
2023-09-15 14:53   ` Felix Kuehling
2023-09-18  2:14     ` Wang, YuBiao
2023-09-18 16:11       ` Felix Kuehling
2023-09-18  8:23     ` 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=81a73442-2d27-eab8-4dec-cb1a6d179ab3@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Feifei.Xu@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Kevin1.Wang@amd.com \
    --cc=Luben.Tuikov@amd.com \
    --cc=Monk.Liu@amd.com \
    --cc=Shashank.Sharma@amd.com \
    --cc=YuBiao.Wang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=horace.chen@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