All of 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 2/9] drm/i915/display: create a common function to check validity of ELD
Date: Tue, 08 Oct 2024 15:26:17 +0300	[thread overview]
Message-ID: <87jzeirdau.fsf@intel.com> (raw)
In-Reply-To: <20241008082327.342020-3-vinod.govindapillai@intel.com>

On Tue, 08 Oct 2024, Vinod Govindapillai <vinod.govindapillai@intel.com> wrote:
> We would need to check the validity of connector ELD from multiple
> places in the follow up patches. So create a separate function to
> check the validity for ELD.
>
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_audio.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> index 1afd3b99e3ea..6946f3b0f8c9 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.c
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> @@ -690,13 +690,10 @@ 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_crtc_state *crtc_state,
> -				struct drm_connector_state *conn_state)
> +static bool intel_audio_eld_valid(struct drm_connector_state *conn_state)
>  {
>  	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;
>  
>  	if (!connector->eld[0]) {
>  		drm_dbg_kms(&i915->drm,
> @@ -705,6 +702,19 @@ bool intel_audio_compute_config(struct intel_crtc_state *crtc_state,
>  		return false;
>  	}
>  
> +	return true;
> +}
> +
> +bool intel_audio_compute_config(struct intel_crtc_state *crtc_state,
> +				struct drm_connector_state *conn_state)
> +{
> +	struct drm_connector *connector = conn_state->connector;

We should stop adding new drm_connector local vars and use struct
intel_connector instead.

> +	const struct drm_display_mode *adjusted_mode =
> +		&crtc_state->hw.adjusted_mode;
> +
> +	if (!intel_audio_eld_valid(conn_state))
> +		return false;
> +
>  	BUILD_BUG_ON(sizeof(crtc_state->eld) != sizeof(connector->eld));
>  	memcpy(crtc_state->eld, connector->eld, sizeof(crtc_state->eld));

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-10-08 12:26 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
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 [this message]
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=87jzeirdau.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.