Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 10/13] drm/i915/sdvo: Nuke the duplicate sdvo->port
Date: Wed,  5 Jul 2023 23:21:19 +0300	[thread overview]
Message-ID: <20230705202122.17915-11-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20230705202122.17915-1-ville.syrjala@linux.intel.com>

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

We already have encoder->port so get rid of the duplicate
sdvo->port.

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

diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
index e6c558416a6b..383f8b1547a1 100644
--- a/drivers/gpu/drm/i915/display/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
@@ -108,8 +108,6 @@ struct intel_sdvo {
 	 */
 	u16 hotplug_active;
 
-	enum port port;
-
 	/* DDC bus used by this SDVO encoder */
 	u8 ddc_bus;
 
@@ -226,7 +224,7 @@ static void intel_sdvo_write_sdvox(struct intel_sdvo *intel_sdvo, u32 val)
 		return;
 	}
 
-	if (intel_sdvo->port == PORT_B)
+	if (intel_sdvo->base.port == PORT_B)
 		cval = intel_de_read(dev_priv, GEN3_SDVOC);
 	else
 		bval = intel_de_read(dev_priv, GEN3_SDVOB);
@@ -403,7 +401,7 @@ static const char *sdvo_cmd_name(u8 cmd)
 	return NULL;
 }
 
-#define SDVO_NAME(svdo) ((svdo)->port == PORT_B ? "SDVOB" : "SDVOC")
+#define SDVO_NAME(svdo) ((svdo)->base.port == PORT_B ? "SDVOB" : "SDVOC")
 
 static void intel_sdvo_debug_write(struct intel_sdvo *intel_sdvo, u8 cmd,
 				   const void *args, int args_len)
@@ -1604,7 +1602,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,
 			sdvox |= SDVO_BORDER_ENABLE;
 	} else {
 		sdvox = intel_de_read(dev_priv, intel_sdvo->sdvo_reg);
-		if (intel_sdvo->port == PORT_B)
+		if (intel_sdvo->base.port == PORT_B)
 			sdvox &= SDVOB_PRESERVE_MASK;
 		else
 			sdvox &= SDVOC_PRESERVE_MASK;
@@ -2618,7 +2616,7 @@ intel_sdvo_select_ddc_bus(struct intel_sdvo *sdvo)
 	struct drm_i915_private *dev_priv = to_i915(sdvo->base.base.dev);
 	struct sdvo_device_mapping *mapping;
 
-	if (sdvo->port == PORT_B)
+	if (sdvo->base.port == PORT_B)
 		mapping = &dev_priv->display.vbt.sdvo_mappings[0];
 	else
 		mapping = &dev_priv->display.vbt.sdvo_mappings[1];
@@ -2636,7 +2634,7 @@ intel_sdvo_select_i2c_bus(struct intel_sdvo *sdvo)
 	struct sdvo_device_mapping *mapping;
 	u8 pin;
 
-	if (sdvo->port == PORT_B)
+	if (sdvo->base.port == PORT_B)
 		mapping = &dev_priv->display.vbt.sdvo_mappings[0];
 	else
 		mapping = &dev_priv->display.vbt.sdvo_mappings[1];
@@ -2676,7 +2674,7 @@ intel_sdvo_get_slave_addr(struct intel_sdvo *sdvo)
 	struct drm_i915_private *dev_priv = to_i915(sdvo->base.base.dev);
 	struct sdvo_device_mapping *my_mapping, *other_mapping;
 
-	if (sdvo->port == PORT_B) {
+	if (sdvo->base.port == PORT_B) {
 		my_mapping = &dev_priv->display.vbt.sdvo_mappings[0];
 		other_mapping = &dev_priv->display.vbt.sdvo_mappings[1];
 	} else {
@@ -2703,7 +2701,7 @@ intel_sdvo_get_slave_addr(struct intel_sdvo *sdvo)
 	 * No SDVO device info is found for another DVO port,
 	 * so use mapping assumption we had before BIOS parsing.
 	 */
-	if (sdvo->port == PORT_B)
+	if (sdvo->base.port == PORT_B)
 		return 0x70;
 	else
 		return 0x72;
@@ -3367,7 +3365,6 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,
 			 "SDVO %c", port_name(port));
 
 	intel_sdvo->sdvo_reg = sdvo_reg;
-	intel_sdvo->port = port;
 	intel_sdvo->slave_addr = intel_sdvo_get_slave_addr(intel_sdvo) >> 1;
 	intel_sdvo_select_i2c_bus(intel_sdvo);
 	if (!intel_sdvo_init_ddc_proxy(intel_sdvo))
@@ -3417,7 +3414,7 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,
 	 * hotplug lines.
 	 */
 	if (intel_sdvo->hotplug_active) {
-		if (intel_sdvo->port == PORT_B)
+		if (intel_sdvo->base.port == PORT_B)
 			intel_encoder->hpd_pin = HPD_SDVO_B;
 		else
 			intel_encoder->hpd_pin = HPD_SDVO_C;
-- 
2.39.3


  parent reply	other threads:[~2023-07-05 20:21 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 20:21 [Intel-gfx] [PATCH 00/13] drm/i915/sdvo: DDC rework and fixes Ville Syrjala
2023-07-05 20:21 ` [Intel-gfx] [PATCH 01/13] drm/i915/sdvo: Issue SetTargetOutput prior ot GetAttachedDisplays Ville Syrjala
2023-07-06  7:20   ` Jani Nikula
2023-07-05 20:21 ` [Intel-gfx] [PATCH 02/13] drm/i915/sdvo: Protect macro args Ville Syrjala
2023-07-06  7:20   ` Jani Nikula
2023-07-05 20:21 ` [Intel-gfx] [PATCH 03/13] drm/i915/sdvo: s/sdvo_inputs_mask/sdvo_num_inputs/ Ville Syrjala
2023-07-06  7:24   ` Jani Nikula
2023-07-05 20:21 ` [Intel-gfx] [PATCH 04/13] drm/i915: Don't warn about zero N/P in *_calc_dpll_params() Ville Syrjala
2023-07-06  8:17   ` Jani Nikula
2023-07-05 20:21 ` [Intel-gfx] [PATCH 05/13] drm/i915: Fully populate crtc_state->dpll Ville Syrjala
2023-07-06  8:41   ` Jani Nikula
2023-07-05 20:21 ` [Intel-gfx] [PATCH 06/13] drm/i915/sdvo: Pick the TV dotclock from adjusted_mode Ville Syrjala
2023-07-06  8:22   ` Jani Nikula
2023-07-05 20:21 ` [Intel-gfx] [PATCH 07/13] drm/i915/sdvo: Fail gracefully if the TV dotclock is out of range Ville Syrjala
2023-07-06  8:22   ` Jani Nikula
2023-07-05 20:21 ` [Intel-gfx] [PATCH 08/13] drm/i915/sdvo: Nuke attached_output tracking Ville Syrjala
2023-07-06  8:24   ` Jani Nikula
2023-07-05 20:21 ` [Intel-gfx] [PATCH 09/13] drm/i915/sdvo: Initialize the encoder ealier Ville Syrjala
2023-07-06  8:28   ` Jani Nikula
2023-07-05 20:21 ` Ville Syrjala [this message]
2023-07-06  8:29   ` [Intel-gfx] [PATCH 10/13] drm/i915/sdvo: Nuke the duplicate sdvo->port Jani Nikula
2023-07-05 20:21 ` [Intel-gfx] [PATCH 11/13] drm/i915/sdvo: Get rid of the per-connector i2c symlink Ville Syrjala
2023-07-06  8:30   ` Jani Nikula
2023-07-05 20:21 ` [Intel-gfx] [PATCH 12/13] drm/i915/sdvo: Rework DDC bus handling Ville Syrjala
2023-07-06  8:38   ` Jani Nikula
2023-07-05 20:21 ` [Intel-gfx] [PATCH 13/13] drm/i915/sdvo: Print out the i2c pin and slave address Ville Syrjala
2023-07-06  8:38   ` Jani Nikula
2023-07-05 21:24 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/sdvo: DDC rework and fixes Patchwork
2023-07-05 21:38 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-07-06  1:17 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-07-06  8:45 ` [Intel-gfx] [PATCH 00/13] " Jani Nikula

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=20230705202122.17915-11-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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