[Intel-xe] [PATCH v2 1/5] Revert "drm/i915/display: Implement FBC support"

Jouni Högander jouni.hogander at intel.com
Thu Aug 31 09:51:50 UTC 2023


This reverts commit 62074302224cee194f642a811a2b70687fe2e6cc.

As a part of clean-up we want to revert this patch and introduce required
changes as a set of patches.

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbc.c | 57 ++++--------------------
 1 file changed, 9 insertions(+), 48 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 66c8aed07bbc..b0e676069677 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -59,64 +59,27 @@
 #ifdef I915
 
 #define i915_gem_stolen_initialized(i915) (drm_mm_initialized(&(i915)->mm.stolen))
-#define i915_gem_stolen_allocated(node) drm_mm_node_allocated(&(node))
-#define i915_gem_stolen_compressed_offset(node) ((node).start)
-#define i915_gem_stolen_compressed_size(node) ((node).size)
 
 #else
 
-#include "xe_ttm_stolen_mgr.h"
-#include "xe_res_cursor.h"
-
-static int i915_gem_stolen_insert_node_in_range(struct xe_device *xe, struct xe_bo **bo, u32 size, u32 align, u32 start, u32 end)
+/* No stolen memory support in xe yet */
+static int i915_gem_stolen_insert_node_in_range(struct xe_device *xe, void *ptr, u32 size, u32 align, u32 start, u32 end)
 {
-	int err;
-	u32 flags = XE_BO_CREATE_PINNED_BIT | XE_BO_CREATE_STOLEN_BIT;
-
-	*bo = xe_bo_create_locked_range(xe, xe_device_get_root_tile(xe),
-					NULL, size, start, end,
-					ttm_bo_type_kernel, flags);
-	if (IS_ERR(*bo)) {
-		err = PTR_ERR(*bo);
-		*bo = NULL;
-		return err;
-	}
-	err = xe_bo_pin(*bo);
-	xe_bo_unlock_vm_held(*bo);
-
-	if (err) {
-		xe_bo_put(*bo);
-		*bo = NULL;
-	}
-
-	return err;
+	return -ENODEV;
 }
 
-static int i915_gem_stolen_insert_node(struct xe_device *xe, struct xe_bo **bo, u32 size, u32 align)
+static int i915_gem_stolen_insert_node(struct xe_device *xe, void *ptr, u32 size, u32 align)
 {
-	/* Not used on xe */
-	BUG_ON(1);
+	XE_WARN_ON(1);
 	return -ENODEV;
 }
 
-static void i915_gem_stolen_remove_node(struct xe_device *xe, struct xe_bo **bo)
+static void i915_gem_stolen_remove_node(struct xe_device *xe, void *ptr)
 {
-	xe_bo_unpin_map_no_vm(*bo);
-	*bo = NULL;
 }
 
-#define i915_gem_stolen_initialized(xe) (!!ttm_manager_type(&(xe)->ttm, XE_PL_STOLEN))
-#define i915_gem_stolen_allocated(bo) (!!(bo))
+#define i915_gem_stolen_initialized(xe) ((xe) && 0)
 
-static u32 i915_gem_stolen_compressed_offset(struct xe_bo *bo)
-{
-	struct xe_res_cursor res;
-
-	xe_res_first(bo->ttm.resource, 0, 4096, &res);
-	return res.start;
-}
-
-#define i915_gem_stolen_compressed_size(fb) ((u64)((fb)->ttm.base.size))
 #endif
 
 #define for_each_fbc_id(__dev_priv, __fbc_id) \
@@ -159,11 +122,7 @@ struct intel_fbc {
 	struct mutex lock;
 	unsigned int busy_bits;
 
-#ifdef I915
 	struct i915_stolen_fb compressed_fb, compressed_llb;
-#else
-	struct xe_bo *compressed_fb, *compressed_llb;
-#endif
 
 	enum intel_fbc_id id;
 
@@ -791,6 +750,8 @@ static u64 intel_fbc_stolen_end(struct drm_i915_private *i915)
 	    (DISPLAY_VER(i915) == 9 && !IS_BROXTON(i915)))
 		end = i915_gem_stolen_area_size(i915) - 8 * 1024 * 1024;
 	else
+#else
+	/* TODO */
 #endif
 		end = U64_MAX;
 
-- 
2.34.1



More information about the Intel-xe mailing list