[PATCH] drm/i915: Remove reserved stolen range ristriction from gen12.5
Nirmoy Das
nirmoy.das at intel.com
Fri Mar 1 14:03:19 UTC 2024
HW spec lifted the requirement for 1st stolen page from
gem12.5 so adjust stolen code.
Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 20 ++++++++++++++++++--
drivers/gpu/drm/i915/gt/selftest_reset.c | 10 +++++++---
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
index ad6dd7f3259b..254d64ca5f10 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
@@ -63,10 +63,26 @@ int i915_gem_stolen_insert_node(struct drm_i915_private *i915,
struct drm_mm_node *node, u64 size,
unsigned alignment)
{
+ /*
+ * Exclude 128KiB of stolen as this is found to be clobbered
+ * by the HW on reset.
+ */
+ u64 start = I915_GEM_STOLEN_BIAS;
+
+ /*
+ * Lift I915_GEM_STOLEN_BIAS restriction from gen12.5 onwards
+ * as HW spec explicitly suggested usability of whole stolen
+ * memory range except the 1st page of stolen which prohibited for
+ * any platform with display + FBC. Exclude the 1st page for all
+ * platforms even when no display is present to keep the
+ * code simple here.
+ */
+ if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
+ start = 4096;
+
return i915_gem_stolen_insert_node_in_range(i915, node,
size, alignment,
- I915_GEM_STOLEN_BIAS,
- U64_MAX);
+ start, U64_MAX);
}
void i915_gem_stolen_remove_node(struct drm_i915_private *i915,
diff --git a/drivers/gpu/drm/i915/gt/selftest_reset.c b/drivers/gpu/drm/i915/gt/selftest_reset.c
index f40de408cd3a..0b3670c91b72 100644
--- a/drivers/gpu/drm/i915/gt/selftest_reset.c
+++ b/drivers/gpu/drm/i915/gt/selftest_reset.c
@@ -27,6 +27,7 @@ __igt_reset_stolen(struct intel_gt *gt,
enum intel_engine_id id;
struct igt_spinner spin;
long max, count;
+ long reserved = 4096; /* see i915_gem_stolen_insert_node() */
void *tmp;
u32 *crc;
int err;
@@ -48,6 +49,9 @@ __igt_reset_stolen(struct intel_gt *gt,
goto err_crc;
}
+ if (GRAPHICS_VER_FULL(gt->i915) < IP_VER(12, 50))
+ reserved = I915_GEM_STOLEN_BIAS;
+
igt_global_reset_lock(gt);
wakeref = intel_runtime_pm_get(gt->uncore->rpm);
@@ -163,9 +167,9 @@ __igt_reset_stolen(struct intel_gt *gt,
pr_info("%s reset clobbered %ld pages of stolen, last clobber at page %ld\n",
msg, count, max);
}
- if (max >= I915_GEM_STOLEN_BIAS >> PAGE_SHIFT) {
- pr_err("%s reset clobbered unreserved area [above %x] of stolen; may cause severe faults\n",
- msg, I915_GEM_STOLEN_BIAS);
+ if (max >= reserved >> PAGE_SHIFT) {
+ pr_err("%s reset clobbered unreserved area [above %lx] of stolen; may cause severe faults\n",
+ msg, reserved);
err = -EINVAL;
}
--
2.42.0
More information about the Intel-gfx-trybot
mailing list