[Intel-xe] [PATCH v3 03/10] Revert "drm/i915/display: Implement FBC support"
Jouni Högander
jouni.hogander at intel.com
Fri Jun 2 10:42:30 UTC 2023
This reverts commit 6cd92ad14e89f2327aacf1c346874fb7db13925b.
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 | 81 ++++++------------------
1 file changed, 20 insertions(+), 61 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 3dc9620552e9..2b00b7373c08 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -57,64 +57,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) \
@@ -157,11 +120,8 @@ struct intel_fbc {
struct mutex lock;
unsigned int busy_bits;
-#ifdef I915
- struct drm_mm_node compressed_fb, compressed_llb;
-#else
- struct xe_bo *compressed_fb, *compressed_llb;
-#endif
+ struct drm_mm_node compressed_fb;
+ struct drm_mm_node compressed_llb;
enum intel_fbc_id id;
@@ -515,8 +475,7 @@ static void g4x_fbc_program_cfb(struct intel_fbc *fbc)
{
struct drm_i915_private *i915 = fbc->i915;
- intel_de_write(i915, DPFC_CB_BASE,
- i915_gem_stolen_compressed_offset(fbc->compressed_fb));
+ intel_de_write(i915, DPFC_CB_BASE, fbc->compressed_fb.start);
}
static const struct intel_fbc_funcs g4x_fbc_funcs = {
@@ -567,8 +526,7 @@ static void ilk_fbc_program_cfb(struct intel_fbc *fbc)
{
struct drm_i915_private *i915 = fbc->i915;
- intel_de_write(i915, ILK_DPFC_CB_BASE(fbc->id),
- i915_gem_stolen_compressed_offset(fbc->compressed_fb));
+ intel_de_write(i915, ILK_DPFC_CB_BASE(fbc->id), fbc->compressed_fb.start);
}
static const struct intel_fbc_funcs ilk_fbc_funcs = {
@@ -788,6 +746,8 @@ static u64 intel_fbc_stolen_end(struct drm_i915_private *i915)
(DISPLAY_VER(i915) == 9 && !IS_BROXTON(i915)))
end = resource_size(&i915->dsm.stolen) - 8 * 1024 * 1024;
else
+#else
+ /* TODO */
#endif
end = U64_MAX;
@@ -844,9 +804,9 @@ static int intel_fbc_alloc_cfb(struct intel_fbc *fbc,
int ret;
drm_WARN_ON(&i915->drm,
- i915_gem_stolen_allocated(fbc->compressed_fb));
+ drm_mm_node_allocated(&fbc->compressed_fb));
drm_WARN_ON(&i915->drm,
- i915_gem_stolen_allocated(fbc->compressed_llb));
+ drm_mm_node_allocated(&fbc->compressed_llb));
if (DISPLAY_VER(i915) < 5 && !IS_G4X(i915)) {
ret = i915_gem_stolen_insert_node(i915, &fbc->compressed_llb,
@@ -866,12 +826,12 @@ static int intel_fbc_alloc_cfb(struct intel_fbc *fbc,
drm_dbg_kms(&i915->drm,
"reserved %llu bytes of contiguous stolen space for FBC, limit: %d\n",
- i915_gem_stolen_compressed_size(fbc->compressed_fb), fbc->limit);
+ fbc->compressed_fb.size, fbc->limit);
return 0;
err_llb:
- if (i915_gem_stolen_allocated(fbc->compressed_llb))
+ if (drm_mm_node_allocated(&fbc->compressed_llb))
i915_gem_stolen_remove_node(i915, &fbc->compressed_llb);
err:
if (i915_gem_stolen_initialized(i915))
@@ -899,9 +859,9 @@ static void __intel_fbc_cleanup_cfb(struct intel_fbc *fbc)
if (WARN_ON(intel_fbc_hw_is_active(fbc)))
return;
- if (i915_gem_stolen_allocated(fbc->compressed_llb))
+ if (drm_mm_node_allocated(&fbc->compressed_llb))
i915_gem_stolen_remove_node(i915, &fbc->compressed_llb);
- if (i915_gem_stolen_allocated(fbc->compressed_fb))
+ if (drm_mm_node_allocated(&fbc->compressed_fb))
i915_gem_stolen_remove_node(i915, &fbc->compressed_fb);
}
@@ -1109,8 +1069,7 @@ static bool intel_fbc_is_cfb_ok(const struct intel_plane_state *plane_state)
struct intel_fbc *fbc = plane->fbc;
return intel_fbc_min_limit(plane_state) <= fbc->limit &&
- intel_fbc_cfb_size(plane_state) <= fbc->limit *
- i915_gem_stolen_compressed_size(fbc->compressed_fb);
+ intel_fbc_cfb_size(plane_state) <= fbc->compressed_fb.size * fbc->limit;
}
static bool intel_fbc_is_ok(const struct intel_plane_state *plane_state)
--
2.34.1
More information about the Intel-xe
mailing list