Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: jani.nikula@linux.intel.com, suraj.kandpal@intel.com,
	ville.syrjala@linux.intel.com
Subject: [PATCH 03/12] drm/i915/dss: Move to struct intel_display
Date: Mon, 26 Aug 2024 16:45:17 +0530	[thread overview]
Message-ID: <20240826111527.1113622-4-ankit.k.nautiyal@intel.com> (raw)
In-Reply-To: <20240826111527.1113622-1-ankit.k.nautiyal@intel.com>

Use struct intel_display instead of struct drm_i915_private.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c |  2 +-
 drivers/gpu/drm/i915/display/intel_dss.c | 22 +++++++++++-----------
 drivers/gpu/drm/i915/display/intel_dss.h |  4 ++--
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 28ef6814c56c..de7db5a028db 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -5115,7 +5115,7 @@ void intel_ddi_init(struct intel_display *display,
 		dig_port->hpd_pulse = intel_dp_hpd_pulse;
 
 		if (dig_port->dp.mso_link_count)
-			encoder->pipe_mask = intel_dss_splitter_pipe_mask(dev_priv);
+			encoder->pipe_mask = intel_dss_splitter_pipe_mask(display);
 	}
 
 	/*
diff --git a/drivers/gpu/drm/i915/display/intel_dss.c b/drivers/gpu/drm/i915/display/intel_dss.c
index 41ea42d234f9..9cb89fe656cb 100644
--- a/drivers/gpu/drm/i915/display/intel_dss.c
+++ b/drivers/gpu/drm/i915/display/intel_dss.c
@@ -14,11 +14,11 @@
  * Splitter enable for eDP MSO is limited to certain pipes, on certain
  * platforms.
  */
-u8 intel_dss_splitter_pipe_mask(struct drm_i915_private *i915)
+u8 intel_dss_splitter_pipe_mask(struct intel_display *display)
 {
-	if (DISPLAY_VER(i915) > 20)
+	if (DISPLAY_VER(display) > 20)
 		return ~0;
-	else if (IS_ALDERLAKE_P(i915))
+	else if (IS_ALDERLAKE_P(to_i915(display->drm)))
 		return BIT(PIPE_A) | BIT(PIPE_B);
 	else
 		return BIT(PIPE_A);
@@ -27,28 +27,28 @@ u8 intel_dss_splitter_pipe_mask(struct drm_i915_private *i915)
 void intel_dss_get_mso_config(struct intel_encoder *encoder,
 			      struct intel_crtc_state *pipe_config)
 {
+	struct intel_display *display = to_intel_display(pipe_config);
 	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
-	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
 	enum pipe pipe = crtc->pipe;
 	u32 dss1;
 
-	if (!HAS_MSO(i915))
+	if (!HAS_MSO(display))
 		return;
 
-	dss1 = intel_de_read(i915, ICL_PIPE_DSS_CTL1(pipe));
+	dss1 = intel_de_read(display, ICL_PIPE_DSS_CTL1(pipe));
 
 	pipe_config->splitter.enable = dss1 & SPLITTER_ENABLE;
 	if (!pipe_config->splitter.enable)
 		return;
 
-	if (drm_WARN_ON(&i915->drm, !(intel_dss_splitter_pipe_mask(i915) & BIT(pipe)))) {
+	if (drm_WARN_ON(crtc->base.dev, !(intel_dss_splitter_pipe_mask(display) & BIT(pipe)))) {
 		pipe_config->splitter.enable = false;
 		return;
 	}
 
 	switch (dss1 & SPLITTER_CONFIGURATION_MASK) {
 	default:
-		drm_WARN(&i915->drm, true,
+		drm_WARN(crtc->base.dev, true,
 			 "Invalid splitter configuration, dss1=0x%08x\n", dss1);
 		fallthrough;
 	case SPLITTER_CONFIGURATION_2_SEGMENT:
@@ -64,12 +64,12 @@ void intel_dss_get_mso_config(struct intel_encoder *encoder,
 
 void intel_dss_configure_mso(const struct intel_crtc_state *crtc_state)
 {
+	struct intel_display *display = to_intel_display(crtc_state);
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
-	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
 	enum pipe pipe = crtc->pipe;
 	u32 dss1 = 0;
 
-	if (!HAS_MSO(i915))
+	if (!HAS_MSO(display))
 		return;
 
 	if (crtc_state->splitter.enable) {
@@ -81,7 +81,7 @@ void intel_dss_configure_mso(const struct intel_crtc_state *crtc_state)
 			dss1 |= SPLITTER_CONFIGURATION_4_SEGMENT;
 	}
 
-	intel_de_rmw(i915, ICL_PIPE_DSS_CTL1(pipe),
+	intel_de_rmw(display, ICL_PIPE_DSS_CTL1(pipe),
 		     SPLITTER_ENABLE | SPLITTER_CONFIGURATION_MASK |
 		     OVERLAP_PIXELS_MASK, dss1);
 }
diff --git a/drivers/gpu/drm/i915/display/intel_dss.h b/drivers/gpu/drm/i915/display/intel_dss.h
index 632a00f0ebc1..0571ee2a19f9 100644
--- a/drivers/gpu/drm/i915/display/intel_dss.h
+++ b/drivers/gpu/drm/i915/display/intel_dss.h
@@ -8,11 +8,11 @@
 
 #include "linux/types.h"
 
-struct drm_i915_private;
 struct intel_crtc_state;
+struct intel_display;
 struct intel_encoder;
 
-u8 intel_dss_splitter_pipe_mask(struct drm_i915_private *i915);
+u8 intel_dss_splitter_pipe_mask(struct intel_display *display);
 void intel_dss_get_mso_config(struct intel_encoder *encoder,
 			      struct intel_crtc_state *pipe_config);
 void intel_dss_configure_mso(const struct intel_crtc_state *crtc_state);
-- 
2.45.2


  parent reply	other threads:[~2024-08-26 11:14 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-26 11:15 [PATCH 00/12] Consolidation of DSS Control in Separate Files Ankit Nautiyal
2024-08-26 11:15 ` [PATCH 01/12] drm/i915/display: Move all DSS control registers to a new file Ankit Nautiyal
2024-08-26 11:46   ` Jani Nikula
2024-08-26 11:15 ` [PATCH 02/12] drm/i915/ddi: Move all mso related helpers " Ankit Nautiyal
2024-08-26 11:52   ` Jani Nikula
2024-08-26 11:15 ` Ankit Nautiyal [this message]
2024-08-26 11:55   ` [PATCH 03/12] drm/i915/dss: Move to struct intel_display Jani Nikula
2024-08-26 11:15 ` [PATCH 04/12] drm/i915/icl_dsi: Move helpers to configure dsi dual link to intel_dss Ankit Nautiyal
2024-08-26 11:58   ` Jani Nikula
2024-08-26 11:15 ` [PATCH 05/12] drm/i915/vdsc: Rename helper to check if the pipe supports dsc Ankit Nautiyal
2024-08-26 12:41   ` Jani Nikula
2024-08-29 14:19     ` Nautiyal, Ankit K
2024-08-26 11:15 ` [PATCH 06/12] drm/i915/vdsc: Move all dss stuff in dss files Ankit Nautiyal
2024-08-26 12:09   ` Jani Nikula
2024-08-26 11:15 ` [PATCH 07/12] drm/i915/display: Move dss stuff in intel_dss files Ankit Nautiyal
2024-08-26 12:11   ` Jani Nikula
2024-08-26 11:15 ` [PATCH 08/12] drm/i915/display: Move helper to get joined pipe mask to intel_dss Ankit Nautiyal
2024-08-26 12:20   ` Jani Nikula
2024-08-26 11:15 ` [PATCH 09/12] drm/i915/display: Move helpers for primary joiner " Ankit Nautiyal
2024-08-26 11:15 ` [PATCH 10/12] drm/i915/display: Move helper to check for secondary joiner pipe Ankit Nautiyal
2024-08-26 11:15 ` [PATCH 11/12] drm/i915/display: Move helper to get all secondary pipes Ankit Nautiyal
2024-08-26 11:15 ` [PATCH 12/12] drm/i915/display: Move intel_joiner_num_pipes to intel dss Ankit Nautiyal
2024-08-26 11:20 ` ✓ CI.Patch_applied: success for Consolidation of DSS Control in Separate Files Patchwork
2024-08-26 11:21 ` ✗ CI.checkpatch: warning " Patchwork
2024-08-26 11:22 ` ✓ CI.KUnit: success " Patchwork
2024-08-26 11:34 ` ✓ CI.Build: " Patchwork
2024-08-26 11:36 ` ✓ CI.Hooks: " Patchwork
2024-08-26 11:37 ` ✗ CI.checksparse: warning " Patchwork
2024-08-26 11:56 ` ✓ CI.BAT: success " Patchwork
2024-08-26 12:34 ` [PATCH 00/12] " Jani Nikula
2024-08-27 12:20   ` Nautiyal, Ankit K
2024-08-26 15:20 ` ✓ CI.FULL: success for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240826111527.1113622-4-ankit.k.nautiyal@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=suraj.kandpal@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox