All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 1/3] drm/amdgpu: Add WARN_ON to the resource clear function
@ 2025-07-16  7:51 Arunpravin Paneer Selvam
  2025-07-16  7:51 ` [PATCH v5 2/3] drm/amdgpu: Reset the clear flag in buddy during resume Arunpravin Paneer Selvam
  2025-07-16  7:51 ` [PATCH v5 3/3] drm/buddy: Add a new unit test case for buffer clearance issue Arunpravin Paneer Selvam
  0 siblings, 2 replies; 8+ messages in thread
From: Arunpravin Paneer Selvam @ 2025-07-16  7:51 UTC (permalink / raw)
  To: dri-devel, amd-gfx, christian.koenig, matthew.auld, matthew.brost
  Cc: alexander.deucher, Arunpravin Paneer Selvam

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.

v3:
  - Add back the resource clear flag set function call after
    being wiped during eviction (Christian).
  - Modified the patch subject name.

Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-07-16 11:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16  7:51 [PATCH v5 1/3] drm/amdgpu: Add WARN_ON to the resource clear function Arunpravin Paneer Selvam
2025-07-16  7:51 ` [PATCH v5 2/3] drm/amdgpu: Reset the clear flag in buddy during resume Arunpravin Paneer Selvam
2025-07-16 10:28   ` Arunpravin Paneer Selvam
2025-07-16 10:47     ` Christian König
2025-07-16 11:00       ` Arunpravin Paneer Selvam
2025-07-16 11:01       ` Christian König
2025-07-16 11:37         ` Arunpravin Paneer Selvam
2025-07-16  7:51 ` [PATCH v5 3/3] drm/buddy: Add a new unit test case for buffer clearance issue Arunpravin Paneer Selvam

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.