All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Lang Yu <lang.yu@amd.com>,
	amd-gfx@lists.freedesktop.org,
	Alex Deucher <alexander.deucher@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Subject: Re: [PATCH] drm/amdgpu: Mask out clear/wipe operation if buffer function is unavailable
Date: Mon, 16 Jun 2025 10:23:46 +0200	[thread overview]
Message-ID: <595000a7-9009-4aa2-b4d6-15df58390d87@amd.com> (raw)
In-Reply-To: <20250616082151.28943-1-lang.yu@amd.com>

On 6/16/25 10:21, Lang Yu wrote:
> It makes no sense to use clear/wipe operation if buffer function is
> unavailable. It's useful in bring up phase when SDMA is not ready
> and/or disabled intentionally by amdgpu_ip_block_mask. This avoids
> manually masking out clear/wipe operation repeatedly.

Clear NAK. SDMA can be temporary unavailable during suspend/resume, but that doesn't mean that we can skip that.

Especially ignoring AMDGPU_GEM_CREATE_VRAM_CLEARED will just crash userspace.

Regards,
Christian.

> 
> Signed-off-by: Lang Yu <lang.yu@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 3ac52d9b9d30..467c8a1911bc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -689,6 +689,10 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
>  	if (!amdgpu_bo_support_uswc(bo->flags))
>  		bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC;
>  
> +	if (!adev->mman.buffer_funcs_enabled)
> +		bo->flags &= ~(AMDGPU_GEM_CREATE_VRAM_CLEARED |
> +			       AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE);
> +
>  	bo->tbo.bdev = &adev->mman.bdev;
>  	if (bp->domain & (AMDGPU_GEM_DOMAIN_GWS | AMDGPU_GEM_DOMAIN_OA |
>  			  AMDGPU_GEM_DOMAIN_GDS))


      reply	other threads:[~2025-06-16  8:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16  8:21 [PATCH] drm/amdgpu: Mask out clear/wipe operation if buffer function is unavailable Lang Yu
2025-06-16  8:23 ` 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=595000a7-9009-4aa2-b4d6-15df58390d87@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=lang.yu@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.