[PATCH v3 1/3] drm/amdgpu: Add WARN_ON to the resource clear function

Christian König christian.koenig at amd.com
Tue Jul 8 07:20:52 UTC 2025



On 08.07.25 08:54, 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.
> 
> 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 at amd.com>
> Suggested-by: Christian König <christian.koenig at amd.com>

> Cc: stable at vger.kernel.org
> Fixes: a68c7eaa7a8f ("drm/amdgpu: Enable clear page functionality")

Those two lines should probably be dropped since this here is only adding a warning now.

With that done Reviewed-by: Christian König <christian.koenig at amd.com>

Regards,
Christian.

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



More information about the amd-gfx mailing list