diff mbox series

[07/12] drm/i915: Add bigjoiner and uncompressed joiner hw readout sanity checks

Message ID 20240718081803.3338564-8-ankit.k.nautiyal@intel.com (mailing list archive)
State New, archived
Headers show
Series Ultrajoiner basic functionality series | expand

Commit Message

Nautiyal, Ankit K July 18, 2024, 8:17 a.m. UTC
From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>

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

Comments

Kandpal, Suraj July 31, 2024, 8:25 a.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Ankit
> Nautiyal
> Sent: Thursday, July 18, 2024 1:48 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: Lisovskiy, Stanislav <stanislav.lisovskiy@intel.com>; Saarinen, Jani
> <jani.saarinen@intel.com>; ville.syrjala@linux.intel.com
> Subject: [PATCH 07/12] drm/i915: Add bigjoiner and uncompressed joiner
> hw readout sanity checks
> 
> From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> 
> Adding sanity checks for primary and secondary bigjoiner/uncompressed
> bitmasks, should make it easier to spot possible issues.
> 

Use imperative here in commit meesgae  some thing like " add sanity checks..."
Other than that everything else LGTM.
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>

> 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(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> b/drivers/gpu/drm/i915/display/intel_display.c
> index 4aed8117f614..59cb0d2f773b 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -3648,11 +3648,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);
> @@ -3660,11 +3666,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;  }
> 
> --
> 2.45.2
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 4aed8117f614..59cb0d2f773b 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -3648,11 +3648,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);
@@ -3660,11 +3666,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;
 }