Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Vinod Govindapillai <vinod.govindapillai@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: vinod.govindapillai@intel.com, ville.syrjala@intel.com,
	kai.vehmanen@intel.com, jani.saarinen@intel.com
Subject: Re: [PATCH 1/9] drm/i915/display: get rid of encoder param  in intel_audio_compute_config
Date: Tue, 08 Oct 2024 15:19:34 +0300	[thread overview]
Message-ID: <87ploardm1.fsf@intel.com> (raw)
In-Reply-To: <20241008082327.342020-2-vinod.govindapillai@intel.com>

On Tue, 08 Oct 2024, Vinod Govindapillai <vinod.govindapillai@intel.com> wrote:
> The parameter "encoder" is used only to get the drm_i915_private
> object. As we could get the drm_i915_private from connector, we
> dont need this encoder to be passed to this function. So get
> rid of the encoder parametet and update all the corrsponding
> intel_audio_compute_config calls. In the followup patches, we
> don't even need the drm_i915_private object in this function.

I've got mixed feelings about this. On the one hand, removing extra
params is good. On the other hand, I'm thinking we should just pass
along all the encoder->compute_config hook parameters all the way to all
functions named _compute_config(), because we just keep removing and
adding these parameters as the driver evolves. We go in circles with
this.

BR,
Jani.



>
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_audio.c | 5 ++---
>  drivers/gpu/drm/i915/display/intel_audio.h | 3 +--
>  drivers/gpu/drm/i915/display/intel_dp.c    | 2 +-
>  drivers/gpu/drm/i915/display/intel_hdmi.c  | 2 +-
>  drivers/gpu/drm/i915/display/intel_sdvo.c  | 2 +-
>  5 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> index 32aa9ec1a204..1afd3b99e3ea 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.c
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> @@ -690,12 +690,11 @@ void intel_audio_sdp_split_update(const struct intel_crtc_state *crtc_state)
>  			     crtc_state->sdp_split_enable ? AUD_ENABLE_SDP_SPLIT : 0);
>  }
>  
> -bool intel_audio_compute_config(struct intel_encoder *encoder,
> -				struct intel_crtc_state *crtc_state,
> +bool intel_audio_compute_config(struct intel_crtc_state *crtc_state,
>  				struct drm_connector_state *conn_state)
>  {
> -	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
>  	struct drm_connector *connector = conn_state->connector;
> +	struct drm_i915_private *i915 = to_i915(connector->dev);
>  	const struct drm_display_mode *adjusted_mode =
>  		&crtc_state->hw.adjusted_mode;
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.h b/drivers/gpu/drm/i915/display/intel_audio.h
> index 576c061d72a4..9b327b677d89 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.h
> +++ b/drivers/gpu/drm/i915/display/intel_audio.h
> @@ -14,8 +14,7 @@ struct intel_crtc_state;
>  struct intel_encoder;
>  
>  void intel_audio_hooks_init(struct drm_i915_private *dev_priv);
> -bool intel_audio_compute_config(struct intel_encoder *encoder,
> -				struct intel_crtc_state *crtc_state,
> +bool intel_audio_compute_config(struct intel_crtc_state *crtc_state,
>  				struct drm_connector_state *conn_state);
>  void intel_audio_codec_enable(struct intel_encoder *encoder,
>  			      const struct intel_crtc_state *crtc_state,
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index fbb096be02ad..0fd9c1c51a43 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -3001,7 +3001,7 @@ intel_dp_audio_compute_config(struct intel_encoder *encoder,
>  {
>  	pipe_config->has_audio =
>  		intel_dp_has_audio(encoder, conn_state) &&
> -		intel_audio_compute_config(encoder, pipe_config, conn_state);
> +		intel_audio_compute_config(pipe_config, conn_state);
>  
>  	pipe_config->sdp_split_enable = pipe_config->has_audio &&
>  					intel_dp_is_uhbr(pipe_config);
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 72ac910bf6ec..45ff2ee7cb70 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -2333,7 +2333,7 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder,
>  
>  	pipe_config->has_audio =
>  		intel_hdmi_has_audio(encoder, pipe_config, conn_state) &&
> -		intel_audio_compute_config(encoder, pipe_config, conn_state);
> +		intel_audio_compute_config(pipe_config, conn_state);
>  
>  	/*
>  	 * Try to respect downstream TMDS clock limits first, if
> diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
> index b83bf813677d..2fbb69ee7b45 100644
> --- a/drivers/gpu/drm/i915/display/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
> @@ -1430,7 +1430,7 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
>  
>  	pipe_config->has_audio =
>  		intel_sdvo_has_audio(encoder, pipe_config, conn_state) &&
> -		intel_audio_compute_config(encoder, pipe_config, conn_state);
> +		intel_audio_compute_config(pipe_config, conn_state);
>  
>  	pipe_config->limited_color_range =
>  		intel_sdvo_limited_color_range(encoder, pipe_config,

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-10-08 12:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  8:23 [PATCH 0/9] prunue audio frequencies based on bw limits for DP2 Vinod Govindapillai
2024-10-08  8:23 ` [PATCH 1/9] drm/i915/display: get rid of encoder param in intel_audio_compute_config Vinod Govindapillai
2024-10-08 12:19   ` Jani Nikula [this message]
2024-10-08  8:23 ` [PATCH 2/9] drm/i915/display: create a common function to check validity of ELD Vinod Govindapillai
2024-10-08 12:26   ` Jani Nikula
2024-11-11 12:29   ` Kai Vehmanen
2024-10-08  8:23 ` [PATCH 3/9] drm/i915/display: update call to intel_dp_audio_compute_config Vinod Govindapillai
2024-11-11 12:11   ` Kai Vehmanen
2024-10-08  8:23 ` [PATCH 4/9] drm/i915/display: update logic to determine crtcstate has audio support Vinod Govindapillai
2024-11-11 12:37   ` Kai Vehmanen
2024-10-08  8:23 ` [PATCH 5/9] drm/i915/display: check and prune audio frequencies based on bw limits Vinod Govindapillai
2024-11-11 11:52   ` Kai Vehmanen
2024-10-08  8:23 ` [PATCH 6/9] drm/i915/display: iterare through channels if no feasible frequencies Vinod Govindapillai
2024-10-09 13:32   ` Kai Vehmanen
2024-10-10  6:49   ` Dan Carpenter
2024-10-08  8:23 ` [PATCH 7/9] drm/i915/display: update audio support based on the available frequencies Vinod Govindapillai
2024-10-08 12:24   ` Jani Nikula
2024-10-09 13:38   ` Kai Vehmanen
2024-10-08  8:23 ` [PATCH 8/9] drm/i815/disaply: limit the audio bw check with DP2 config Vinod Govindapillai
2024-11-11 12:35   ` Kai Vehmanen
2024-10-08  8:23 ` [PATCH 9/9] drm/i915/display: update audio bw calculations for MTL Vinod Govindapillai
2024-10-09 13:33   ` Kai Vehmanen
2024-10-08 11:47 ` ✗ Fi.CI.CHECKPATCH: warning for prunue audio frequencies based on bw limits for DP2 Patchwork
2024-10-08 11:47 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-10-08 12:13 ` ✓ Fi.CI.BAT: success " Patchwork
2024-10-09 15:55 ` ✗ Fi.CI.IGT: failure " 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=87ploardm1.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.saarinen@intel.com \
    --cc=kai.vehmanen@intel.com \
    --cc=ville.syrjala@intel.com \
    --cc=vinod.govindapillai@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