Commit 81df6bfa authored by Arunpravin Paneer Selvam's avatar Arunpravin Paneer Selvam Committed by Alex Deucher
Browse files

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: default avatarArunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Suggested-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e678e75d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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