diff mbox series

[18/22] drm/i915/sdvo: Precompute the ELD

Message ID 20221011170011.17198-19-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, 5 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Use the precomputed crtc_state->eld for audio setup on SDVO
just like we do with native HDMI.

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_sdvo.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Jani Nikula Oct. 12, 2022, 3:16 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>
>
> Use the precomputed crtc_state->eld for audio setup on SDVO
> just like we do with native HDMI.
>
> 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>

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

> ---
>  drivers/gpu/drm/i915/display/intel_sdvo.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
> index 8852564b5fbf..d9a54ed4623a 100644
> --- a/drivers/gpu/drm/i915/display/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
> @@ -38,6 +38,7 @@
>  
>  #include "i915_drv.h"
>  #include "intel_atomic.h"
> +#include "intel_audio.h"
>  #include "intel_connector.h"
>  #include "intel_crtc.h"
>  #include "intel_de.h"
> @@ -1377,7 +1378,9 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
>  
>  	pipe_config->has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo, conn_state);
>  
> -	pipe_config->has_audio = intel_sdvo_has_audio(encoder, pipe_config, conn_state);
> +	pipe_config->has_audio =
> +		intel_sdvo_has_audio(encoder, pipe_config, conn_state) &&
> +		intel_audio_compute_config(encoder, pipe_config, conn_state);
>  
>  	pipe_config->limited_color_range =
>  		intel_sdvo_limited_color_range(encoder, pipe_config,
> @@ -1752,12 +1755,7 @@ static void intel_sdvo_enable_audio(struct intel_sdvo *intel_sdvo,
>  				    const struct intel_crtc_state *crtc_state,
>  				    const struct drm_connector_state *conn_state)
>  {
> -	const struct drm_display_mode *adjusted_mode =
> -		&crtc_state->hw.adjusted_mode;
> -	struct drm_connector *connector = conn_state->connector;
> -	u8 *eld = connector->eld;
> -
> -	eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2;
> +	const u8 *eld = crtc_state->eld;
>  
>  	intel_sdvo_set_audio_state(intel_sdvo, 0);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
index 8852564b5fbf..d9a54ed4623a 100644
--- a/drivers/gpu/drm/i915/display/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
@@ -38,6 +38,7 @@ 
 
 #include "i915_drv.h"
 #include "intel_atomic.h"
+#include "intel_audio.h"
 #include "intel_connector.h"
 #include "intel_crtc.h"
 #include "intel_de.h"
@@ -1377,7 +1378,9 @@  static int intel_sdvo_compute_config(struct intel_encoder *encoder,
 
 	pipe_config->has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo, conn_state);
 
-	pipe_config->has_audio = intel_sdvo_has_audio(encoder, pipe_config, conn_state);
+	pipe_config->has_audio =
+		intel_sdvo_has_audio(encoder, pipe_config, conn_state) &&
+		intel_audio_compute_config(encoder, pipe_config, conn_state);
 
 	pipe_config->limited_color_range =
 		intel_sdvo_limited_color_range(encoder, pipe_config,
@@ -1752,12 +1755,7 @@  static void intel_sdvo_enable_audio(struct intel_sdvo *intel_sdvo,
 				    const struct intel_crtc_state *crtc_state,
 				    const struct drm_connector_state *conn_state)
 {
-	const struct drm_display_mode *adjusted_mode =
-		&crtc_state->hw.adjusted_mode;
-	struct drm_connector *connector = conn_state->connector;
-	u8 *eld = connector->eld;
-
-	eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2;
+	const u8 *eld = crtc_state->eld;
 
 	intel_sdvo_set_audio_state(intel_sdvo, 0);