[Intel-xe] [RFC PATCH 14/20] drm/xe: Add function to clear scanout flag

Jouni Högander jouni.hogander at intel.com
Fri May 5 08:29:50 UTC 2023


Add function to clear scanout flag. This will be called by frontbuffer
tracking code.

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
index c40bb27ac72a..dec11721ef6a 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
@@ -4,11 +4,22 @@
 #include <uapi/drm/i915_drm.h>
 #include <drm/drm_mm.h>
 
-struct xe_bo;
+#include <xe_bo.h>
+#include <xe_bo_types.h>
 
 struct i915_vma {
 	struct xe_bo *bo, *dpt;
 	struct drm_mm_node node;
 };
 
+static inline void i915_ggtt_clear_scanout(struct xe_bo *bo)
+{
+	int ret;
+
+	ret = ttm_bo_reserve(&bo->ttm, true, false, NULL);
+	XE_WARN_ON(ret);
+	bo->flags &= ~XE_BO_SCANOUT_BIT;
+	ttm_bo_unreserve(&bo->ttm);
+}
+
 #endif
-- 
2.34.1



More information about the Intel-xe mailing list