@@ -3639,11 +3639,17 @@ static void enabled_bigjoiner_pipes(struct drm_i915_private *dev_priv,
}
}
+static u8 expected_secondary_pipes(u8 primary_pipes)
+{
+ return primary_pipes << 1;
+}
+
static void enabled_joiner_pipes(struct drm_i915_private *dev_priv,
u8 *primary_pipes, u8 *secondary_pipes)
{
u8 primary_uncompressed_joiner_pipes, primary_bigjoiner_pipes;
u8 secondary_uncompressed_joiner_pipes, secondary_bigjoiner_pipes;
+ u8 uncompressed_joiner_pipes, bigjoiner_pipes;
enabled_uncompressed_joiner_pipes(dev_priv, &primary_uncompressed_joiner_pipes,
&secondary_uncompressed_joiner_pipes);
@@ -3651,11 +3657,28 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv,
enabled_bigjoiner_pipes(dev_priv, &primary_bigjoiner_pipes,
&secondary_bigjoiner_pipes);
+ uncompressed_joiner_pipes = primary_uncompressed_joiner_pipes |
+ secondary_uncompressed_joiner_pipes;
+ bigjoiner_pipes = primary_bigjoiner_pipes | secondary_bigjoiner_pipes;
+
+ drm_WARN(&dev_priv->drm, (uncompressed_joiner_pipes & bigjoiner_pipes) != 0,
+ "Uncomressed joiner pipes(%x) and bigjoiner pipes(%x) can't intersect\n",
+ uncompressed_joiner_pipes, bigjoiner_pipes);
+ drm_WARN(&dev_priv->drm, secondary_bigjoiner_pipes !=
+ expected_secondary_pipes(primary_bigjoiner_pipes),
+ "Wrong secondary bigjoiner pipes(expected %x, current %x)\n",
+ expected_secondary_pipes(primary_bigjoiner_pipes),
+ secondary_bigjoiner_pipes);
+ drm_WARN(&dev_priv->drm, secondary_uncompressed_joiner_pipes !=
+ expected_secondary_pipes(primary_uncompressed_joiner_pipes),
+ "Wrong secondary uncompressed joiner pipes(expected %x, current %x)\n",
+ expected_secondary_pipes(primary_uncompressed_joiner_pipes),
+ secondary_uncompressed_joiner_pipes);
+
*primary_pipes = 0;
*secondary_pipes = 0;
*primary_pipes = primary_uncompressed_joiner_pipes | primary_bigjoiner_pipes;
-
*secondary_pipes = secondary_uncompressed_joiner_pipes | secondary_bigjoiner_pipes;
}
Adding sanity checks for primary and secondary bigjoiner/uncompressed bitmasks, should make it easier to spot possible issues. Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> --- drivers/gpu/drm/i915/display/intel_display.c | 25 +++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)