From 83a35b68f45cebc70152e55ed3f99db485c9a7cd Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 11 Nov 2009 13:04:38 +0000 Subject: intel: Export madvise Wrap the madvise ioctl for use in APPLE_object_purgeable. Signed-off-by: Chris Wilson Acked-by: Jesse Barnes --- libdrm/intel/intel_bufmgr_priv.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libdrm/intel/intel_bufmgr_priv.h') diff --git a/libdrm/intel/intel_bufmgr_priv.h b/libdrm/intel/intel_bufmgr_priv.h index 475c402f..febee0f7 100644 --- a/libdrm/intel/intel_bufmgr_priv.h +++ b/libdrm/intel/intel_bufmgr_priv.h @@ -216,6 +216,20 @@ struct _drm_intel_bufmgr { */ int (*bo_busy) (drm_intel_bo *bo); + /** + * Specify the volatility of the buffer. + * \param bo Buffer to create a name for + * \param madv The purgeable status + * + * Use I915_MADV_DONTNEED to mark the buffer as purgeable, and it will be + * reclaimed under memory pressure. If you subsequently require the buffer, + * then you must pass I915_MADV_WILLNEED to mark the buffer as required. + * + * Returns 1 if the buffer was retained, or 0 if it was discarded whilst + * marked as I915_MADV_DONTNEED. + */ + int (*bo_madvise) (drm_intel_bo *bo, int madv); + int (*check_aperture_space) (drm_intel_bo ** bo_array, int count); /** -- cgit v1.2.3