All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/fbc: Limit cfb to the first 256MiB of stolen on g4x+
@ 2020-07-14 18:51 Ville Syrjala
  2020-07-14 19:13 ` Chris Wilson
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Ville Syrjala @ 2020-07-14 18:51 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Since g4x the CFB base only takes a 28bit offset into stolen.
Not sure if the CFB is allowed to start below that limit but
then extend beyond it. Let's assume not and just restrict the
allocation to the first 256MiB (in the unlikely case
we have more stolen than that).

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 85723fba6002..448e966bad11 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -424,6 +424,14 @@ static void intel_fbc_deactivate(struct drm_i915_private *dev_priv,
 	fbc->no_fbc_reason = reason;
 }
 
+static u64 intel_fbc_cfb_base_max(struct drm_i915_private *i915)
+{
+	if (INTEL_GEN(i915) >= 5 || IS_G4X(i915))
+		return BIT(28);
+	else
+		return BIT(32);
+}
+
 static int find_compression_threshold(struct drm_i915_private *dev_priv,
 				      struct drm_mm_node *node,
 				      unsigned int size,
@@ -442,6 +450,8 @@ static int find_compression_threshold(struct drm_i915_private *dev_priv,
 	else
 		end = U64_MAX;
 
+	end = min(end, intel_fbc_cfb_base_max(dev_priv));
+
 	/* HACK: This code depends on what we will do in *_enable_fbc. If that
 	 * code changes, this code needs to change as well.
 	 *
-- 
2.26.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-07-15 15:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-14 18:51 [Intel-gfx] [PATCH] drm/i915/fbc: Limit cfb to the first 256MiB of stolen on g4x+ Ville Syrjala
2020-07-14 19:13 ` Chris Wilson
2020-07-14 19:50   ` Ville Syrjälä
2020-07-14 19:56 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2020-07-14 19:56 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
2020-07-14 20:19 ` [Intel-gfx] [PATCH v2] " Ville Syrjala
2020-07-14 20:32   ` Chris Wilson
2020-07-15 14:22     ` Ville Syrjälä
2020-07-15 15:17       ` Chris Wilson
2020-07-14 21:36 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/fbc: Limit cfb to the first 256MiB of stolen on g4x+ (rev2) Patchwork
2020-07-14 21:37 ` [Intel-gfx] [PATCH] drm/i915/fbc: Limit cfb to the first 256MiB of stolen on g4x+ kernel test robot
2020-07-14 21:37   ` kernel test robot
2020-07-15  1:41 ` [Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/fbc: Limit cfb to the first 256MiB of stolen on g4x+ (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.