diff mbox series

[08/22] drm/i915/audio: Nuke intel_eld_uptodate()

Message ID 20221011170011.17198-9-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: ELD precompute and readout | expand

Commit Message

Ville Syrjälä Oct. 11, 2022, 4:59 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

No idea why we do this ELD comparions on g4x before loading
the new ELD. Seems entirely pointless so just get rid of it.

Cc: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_audio.c | 33 ----------------------
 1 file changed, 33 deletions(-)

Comments

Jani Nikula Oct. 12, 2022, 2:40 p.m. UTC | #1
On Tue, 11 Oct 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> No idea why we do this ELD comparions on g4x before loading
> the new ELD. Seems entirely pointless so just get rid of it.
>
> Cc: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
> Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> Cc: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

A lot of this is there for hysterical raisins, dating back to before I
grouped all of this in this file. And that was eight years ago... I just
wasn't brave enough to modify it. *shrug*

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_audio.c | 33 ----------------------
>  1 file changed, 33 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> index 9a286d70e281..3f328913fc90 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.c
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> @@ -304,33 +304,6 @@ static int audio_config_hdmi_get_n(const struct intel_crtc_state *crtc_state,
>  	return 0;
>  }
>  
> -static bool intel_eld_uptodate(struct drm_connector *connector,
> -			       i915_reg_t reg_eldv, u32 bits_eldv,
> -			       i915_reg_t reg_elda, u32 bits_elda,
> -			       i915_reg_t reg_edid)
> -{
> -	struct drm_i915_private *i915 = to_i915(connector->dev);
> -	const u8 *eld = connector->eld;
> -	u32 tmp;
> -	int i;
> -
> -	tmp = intel_de_read(i915, reg_eldv);
> -	tmp &= bits_eldv;
> -
> -	if (!tmp)
> -		return false;
> -
> -	tmp = intel_de_read(i915, reg_elda);
> -	tmp &= ~bits_elda;
> -	intel_de_write(i915, reg_elda, tmp);
> -
> -	for (i = 0; i < drm_eld_size(eld) / 4; i++)
> -		if (intel_de_read(i915, reg_edid) != *((const u32 *)eld + i))
> -			return false;
> -
> -	return true;
> -}
> -
>  static void g4x_audio_codec_disable(struct intel_encoder *encoder,
>  				    const struct intel_crtc_state *old_crtc_state,
>  				    const struct drm_connector_state *old_conn_state)
> @@ -354,12 +327,6 @@ static void g4x_audio_codec_enable(struct intel_encoder *encoder,
>  	u32 tmp;
>  	int len, i;
>  
> -	if (intel_eld_uptodate(connector,
> -			       G4X_AUD_CNTL_ST, G4X_ELD_VALID,
> -			       G4X_AUD_CNTL_ST, G4X_ELD_ADDRESS_MASK,
> -			       G4X_HDMIW_HDMIEDID))
> -		return;
> -
>  	tmp = intel_de_read(i915, G4X_AUD_CNTL_ST);
>  	tmp &= ~(G4X_ELD_VALID | G4X_ELD_ADDRESS_MASK);
>  	len = REG_FIELD_GET(G4X_ELD_BUFFER_SIZE_MASK, tmp);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
index 9a286d70e281..3f328913fc90 100644
--- a/drivers/gpu/drm/i915/display/intel_audio.c
+++ b/drivers/gpu/drm/i915/display/intel_audio.c
@@ -304,33 +304,6 @@  static int audio_config_hdmi_get_n(const struct intel_crtc_state *crtc_state,
 	return 0;
 }
 
-static bool intel_eld_uptodate(struct drm_connector *connector,
-			       i915_reg_t reg_eldv, u32 bits_eldv,
-			       i915_reg_t reg_elda, u32 bits_elda,
-			       i915_reg_t reg_edid)
-{
-	struct drm_i915_private *i915 = to_i915(connector->dev);
-	const u8 *eld = connector->eld;
-	u32 tmp;
-	int i;
-
-	tmp = intel_de_read(i915, reg_eldv);
-	tmp &= bits_eldv;
-
-	if (!tmp)
-		return false;
-
-	tmp = intel_de_read(i915, reg_elda);
-	tmp &= ~bits_elda;
-	intel_de_write(i915, reg_elda, tmp);
-
-	for (i = 0; i < drm_eld_size(eld) / 4; i++)
-		if (intel_de_read(i915, reg_edid) != *((const u32 *)eld + i))
-			return false;
-
-	return true;
-}
-
 static void g4x_audio_codec_disable(struct intel_encoder *encoder,
 				    const struct intel_crtc_state *old_crtc_state,
 				    const struct drm_connector_state *old_conn_state)
@@ -354,12 +327,6 @@  static void g4x_audio_codec_enable(struct intel_encoder *encoder,
 	u32 tmp;
 	int len, i;
 
-	if (intel_eld_uptodate(connector,
-			       G4X_AUD_CNTL_ST, G4X_ELD_VALID,
-			       G4X_AUD_CNTL_ST, G4X_ELD_ADDRESS_MASK,
-			       G4X_HDMIW_HDMIEDID))
-		return;
-
 	tmp = intel_de_read(i915, G4X_AUD_CNTL_ST);
 	tmp &= ~(G4X_ELD_VALID | G4X_ELD_ADDRESS_MASK);
 	len = REG_FIELD_GET(G4X_ELD_BUFFER_SIZE_MASK, tmp);