Commit 83c0926f authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Rodrigo Vivi

drm/i915/fbc: Limit cfb to the first 256MiB of stolen on g4x+

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).

v2: s/BIT/BIT_ULL/ (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200714201945.18959-1-ville.syrjala@linux.intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 62975d27
...@@ -424,6 +424,14 @@ static void intel_fbc_deactivate(struct drm_i915_private *dev_priv, ...@@ -424,6 +424,14 @@ static void intel_fbc_deactivate(struct drm_i915_private *dev_priv,
fbc->no_fbc_reason = reason; 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_ULL(28);
else
return BIT_ULL(32);
}
static int find_compression_threshold(struct drm_i915_private *dev_priv, static int find_compression_threshold(struct drm_i915_private *dev_priv,
struct drm_mm_node *node, struct drm_mm_node *node,
unsigned int size, unsigned int size,
...@@ -442,6 +450,8 @@ static int find_compression_threshold(struct drm_i915_private *dev_priv, ...@@ -442,6 +450,8 @@ static int find_compression_threshold(struct drm_i915_private *dev_priv,
else else
end = U64_MAX; 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 /* HACK: This code depends on what we will do in *_enable_fbc. If that
* code changes, this code needs to change as well. * code changes, this code needs to change as well.
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment