[RFC PATCH 04/18] drm/ttm: Add driver funcs for uneviction control
Friedrich Vock
friedrich.vock at gmx.de
Wed Apr 24 16:56:54 UTC 2024
Provides fine-grained control for drivers over which buffers should be
considered when attempting to undo evictions.
Signed-off-by: Friedrich Vock <friedrich.vock at gmx.de>
---
include/drm/ttm/ttm_device.h | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h
index baa264efe483d..283795d674189 100644
--- a/include/drm/ttm/ttm_device.h
+++ b/include/drm/ttm/ttm_device.h
@@ -133,6 +133,29 @@ struct ttm_device_funcs {
void (*evict_flags)(struct ttm_buffer_object *bo,
struct ttm_placement *placement);
+ /**
+ * struct ttm_bo_driver member uneviction_valuable
+ *
+ * @bo: the buffer object to be unevicted
+ *
+ * Check with the driver if it is valuable to unevict a BO,
+ * that is to move it back to its placecment before it was
+ * evicted.
+ */
+ bool (*uneviction_valuable)(struct ttm_buffer_object *bo);
+ /**
+ * struct ttm_bo_driver member evict_flags:
+ *
+ * @bo: the buffer object that can be unevicted
+ * @dest: The placement for the unevicted buffer
+ *
+ * This should not cause multihop evictions, and the core will warn
+ * if one is proposed.
+ */
+
+ void (*unevict_flags)(struct ttm_buffer_object *bo,
+ struct ttm_placement *dest);
+
/**
* struct ttm_bo_driver member move:
*
--
2.44.0
More information about the dri-devel
mailing list