Skip to content

Commit 81df6bf

Browse files
arunpravin24alexdeucher
authored andcommitted
drm/amdgpu: Add WARN_ON to the resource clear function
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 cleared during eviction (Christian). - Modified the patch subject name. Signed-off-by: Arunpravin Paneer Selvam <[email protected]> Suggested-by: Christian König <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e678e75 commit 81df6bf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ to_amdgpu_vram_mgr_resource(struct ttm_resource *res)
6666

6767
static inline void amdgpu_vram_mgr_set_cleared(struct ttm_resource *res)
6868
{
69-
to_amdgpu_vram_mgr_resource(res)->flags |= DRM_BUDDY_CLEARED;
69+
struct amdgpu_vram_mgr_resource *ares = to_amdgpu_vram_mgr_resource(res);
70+
71+
WARN_ON(ares->flags & DRM_BUDDY_CLEARED);
72+
ares->flags |= DRM_BUDDY_CLEARED;
7073
}
7174

7275
#endif

0 commit comments

Comments
 (0)