From: "Christian König" <christian.koenig@amd.com>
To: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
matthew.auld@intel.com, matthew.brost@intel.com
Cc: alexander.deucher@amd.com, stable@vger.kernel.org
Subject: Re: [PATCH v2 1/3] drm/amdgpu: Dirty cleared blocks on free
Date: Wed, 2 Jul 2025 09:57:29 +0200 [thread overview]
Message-ID: <39ff4d7d-d8eb-4c2d-9330-2bb8a5a04964@amd.com> (raw)
In-Reply-To: <20250701190822.5272-1-Arunpravin.PaneerSelvam@amd.com>
On 01.07.25 21:08, Arunpravin Paneer Selvam wrote:
> Set the dirty bit when the memory resource is not cleared
> during BO release.
>
> v2(Christian):
> - Drop the cleared flag set to false.
> - Improve the amdgpu_vram_mgr_set_clear_state() function.
>
> Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
> Suggested-by: Christian König <christian.koenig@amd.com>
> Cc: stable@vger.kernel.org
> Fixes: a68c7eaa7a8f ("drm/amdgpu: Enable clear page functionality")
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h | 5 ++++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 9c5df35f05b7..86eb6d47dcc5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -409,7 +409,6 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
> if (r) {
> goto error;
> } else if (wipe_fence) {
> - amdgpu_vram_mgr_set_cleared(bo->resource);
Mhm, that looks incorrect to me.
Why don't we consider the resource cleared after it go wiped during eviction?
Regards,
Christian.
> dma_fence_put(fence);
> fence = wipe_fence;
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h
> index b256cbc2bc27..2c88d5fd87da 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h
> @@ -66,7 +66,10 @@ to_amdgpu_vram_mgr_resource(struct ttm_resource *res)
>
> static inline void amdgpu_vram_mgr_set_cleared(struct ttm_resource *res)
> {
> - to_amdgpu_vram_mgr_resource(res)->flags |= DRM_BUDDY_CLEARED;
> + struct amdgpu_vram_mgr_resource *ares = to_amdgpu_vram_mgr_resource(res);
> +
> + WARN_ON(ares->flags & DRM_BUDDY_CLEARED);
> + ares->flags |= DRM_BUDDY_CLEARED;
> }
>
> #endif
next prev parent reply other threads:[~2025-07-02 7:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 19:08 [PATCH v2 1/3] drm/amdgpu: Dirty cleared blocks on free Arunpravin Paneer Selvam
2025-07-01 19:08 ` [PATCH v2 2/3] drm/amdgpu: Reset the clear flag in buddy during resume Arunpravin Paneer Selvam
2025-07-04 8:52 ` Matthew Auld
2025-07-08 6:10 ` Arunpravin Paneer Selvam
2025-07-02 7:57 ` Christian König [this message]
[not found] ` <eebf740c-2a96-434a-a114-2d168f51f774@amd.com>
2025-07-02 13:41 ` [PATCH v2 1/3] drm/amdgpu: Dirty cleared blocks on free Christian König
2025-07-03 7:13 ` Arunpravin Paneer Selvam
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=39ff4d7d-d8eb-4c2d-9330-2bb8a5a04964@amd.com \
--to=christian.koenig@amd.com \
--cc=Arunpravin.PaneerSelvam@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=stable@vger.kernel.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