All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Kevin Wang <kevin1.wang@amd.com>, amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, lijo.lazar@amd.com, frank.min@amd.com,
	hawking.zhang@amd.com
Subject: Re: [RFC PATCH 2/3] drm/amdgpu/ttm: replace duplicate code with exiting function
Date: Thu, 15 Jul 2021 11:26:16 +0200	[thread overview]
Message-ID: <0606dabf-3558-d263-fa88-e6d6fff47047@amd.com> (raw)
In-Reply-To: <20210715082439.678512-2-kevin1.wang@amd.com>

Am 15.07.21 um 10:24 schrieb Kevin Wang:
> using exiting function to replace duplicate code blocks in
> amdgpu_ttm_vram_write().

NAK, this should intentionally only use the MM path and not the aper path.

But you could use amdgpu_device_mm_access() here now.

Christian.

>
> Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 2aa2eb5de37a..2c98e4345ad3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2207,7 +2207,6 @@ static ssize_t amdgpu_ttm_vram_write(struct file *f, const char __user *buf,
>   		return -ENXIO;
>   
>   	while (size) {
> -		unsigned long flags;
>   		uint32_t value;
>   
>   		if (*pos >= adev->gmc.mc_vram_size)
> @@ -2217,11 +2216,7 @@ static ssize_t amdgpu_ttm_vram_write(struct file *f, const char __user *buf,
>   		if (r)
>   			return r;
>   
> -		spin_lock_irqsave(&adev->mmio_idx_lock, flags);
> -		WREG32_NO_KIQ(mmMM_INDEX, ((uint32_t)*pos) | 0x80000000);
> -		WREG32_NO_KIQ(mmMM_INDEX_HI, *pos >> 31);
> -		WREG32_NO_KIQ(mmMM_DATA, value);
> -		spin_unlock_irqrestore(&adev->mmio_idx_lock, flags);
> +		amdgpu_device_vram_access(adev, *pos, &value, 4, true);
>   
>   		result += 4;
>   		buf += 4;

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2021-07-15  9:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15  8:24 [RFC PATCH 1/3] drm/amdgpu: split amdgpu_device_access_vram() into two small parts Kevin Wang
2021-07-15  8:24 ` [RFC PATCH 2/3] drm/amdgpu/ttm: replace duplicate code with exiting function Kevin Wang
2021-07-15  9:26   ` Christian König [this message]
2021-07-15  9:29     ` Lazar, Lijo
2021-07-15  9:31       ` Christian König
2021-07-15  8:24 ` [RFC PATCH 3/3] drm/amdgpu/ttm: optimize vram access in amdgpu_ttm_access_memory() Kevin Wang
2021-07-15  9:23 ` [RFC PATCH 1/3] drm/amdgpu: split amdgpu_device_access_vram() into two small parts 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=0606dabf-3558-d263-fa88-e6d6fff47047@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=frank.min@amd.com \
    --cc=hawking.zhang@amd.com \
    --cc=kevin1.wang@amd.com \
    --cc=lijo.lazar@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 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.