]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/xe/bo: Add purgeable bo state tracking and field madv to xe_bo
authorArvind Yadav <arvind.yadav@intel.com>
Thu, 26 Mar 2026 13:08:28 +0000 (18:38 +0530)
committerMatthew Brost <matthew.brost@intel.com>
Fri, 27 Mar 2026 02:57:01 +0000 (19:57 -0700)
commitb67427f939ccf038a658badb02dd948c7b516248
treebe2bb82879913cbeb6ea7a7874566c434f6d5217
parentf99a05cc0b85fadd109fb3250fceccc5eaad3830
drm/xe/bo: Add purgeable bo state tracking and field madv to xe_bo

Add infrastructure for tracking purgeable state of buffer objects.
This includes:

Introduce enum xe_madv_purgeable_state with three states:
   - XE_MADV_PURGEABLE_WILLNEED (0): BO is needed and should not be
     purged. This is the default state for all BOs.

   - XE_MADV_PURGEABLE_DONTNEED (1): BO is not currently needed and
     can be purged by the kernel under memory pressure to reclaim
     resources. Only non-shared BOs can be marked as DONTNEED.

   - XE_MADV_PURGEABLE_PURGED (2): BO has been purged by the kernel.
     Accessing a purged BO results in error. Follows i915 semantics
     where once purged, the BO remains permanently invalid ("once
     purged, always purged").

Add madv_purgeable field to struct xe_bo for state tracking
  of purgeable state across concurrent access paths

Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Arvind Yadav <arvind.yadav@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260326130843.3545241-3-arvind.yadav@intel.com
drivers/gpu/drm/xe/xe_bo.h
drivers/gpu/drm/xe/xe_bo_types.h