Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Takashi Iwai <tiwai@suse.de>
Subject: Re: [Intel-gfx] [PATCH v2 03/15] drm/i915/audio: Unify get_saved_enc()
Date: Tue, 08 Nov 2022 18:11:07 +0200	[thread overview]
Message-ID: <87bkph8m04.fsf@intel.com> (raw)
In-Reply-To: <20221108151839.31567-4-ville.syrjala@linux.intel.com>

On Tue, 08 Nov 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Make the two branches of get_saved_enc() look alike. Currently
> they look different even though they do exactly the same thing
> apart from == vs. != for the MST comparison.
>
> 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_audio.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> index 0a53731a9272..0ac28d28098f 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.c
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> @@ -1069,10 +1069,10 @@ static int i915_audio_component_get_cdclk_freq(struct device *kdev)
>  static struct intel_encoder *get_saved_enc(struct drm_i915_private *i915,
>  					   int port, int pipe)
>  {
> -	struct intel_encoder *encoder;
> -
>  	/* MST */
>  	if (pipe >= 0) {
> +		struct intel_encoder *encoder;
> +
>  		if (drm_WARN_ON(&i915->drm,
>  				pipe >= ARRAY_SIZE(i915->display.audio.encoder_map)))
>  			return NULL;
> @@ -1083,7 +1083,7 @@ static struct intel_encoder *get_saved_enc(struct drm_i915_private *i915,
>  		 * MST or not. So it will poll all the port & pipe
>  		 * combinations
>  		 */
> -		if (encoder != NULL && encoder->port == port &&
> +		if (encoder && encoder->port == port &&
>  		    encoder->type == INTEL_OUTPUT_DP_MST)
>  			return encoder;
>  	}
> @@ -1093,14 +1093,12 @@ static struct intel_encoder *get_saved_enc(struct drm_i915_private *i915,
>  		return NULL;
>  
>  	for_each_pipe(i915, pipe) {
> +		struct intel_encoder *encoder;
> +
>  		encoder = i915->display.audio.encoder_map[pipe];
> -		if (encoder == NULL)
> -			continue;
>  
> -		if (encoder->type == INTEL_OUTPUT_DP_MST)
> -			continue;
> -
> -		if (port == encoder->port)
> +		if (encoder && encoder->port == port &&
> +		    encoder->type != INTEL_OUTPUT_DP_MST)
>  			return encoder;
>  	}

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-11-08 16:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08 15:18 [Intel-gfx] [PATCH v2 00/15] drm/i915: ELD precompute and readout Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 01/15] drm/i915/audio: Don't program the hardware ELD buffer on ilk+ Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 02/15] drm/i915/audio: Don't program the hardware ELD buffer on hsw+ Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 03/15] drm/i915/audio: Unify get_saved_enc() Ville Syrjala
2022-11-08 16:11   ` Jani Nikula [this message]
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 04/15] drm/i915/audio: Realign some function arguments Ville Syrjala
2022-11-08 16:11   ` Jani Nikula
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 05/15] drm/i915/audio: Introduce a struct for the acomp audio state Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 06/15] drm/i915/audio: Precompute the ELD Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 07/15] drm/i915/audio: Don't enable audio with bogus ELD Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 08/15] drm/i915/audio: Hardware ELD readout Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 09/15] drm/i915/sdvo: Precompute the ELD Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 10/15] drm/i915/sdvo: Only use "presence detect" for has_audio readout Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 11/15] drm/i915/sdvo: Do ELD hardware readout Ville Syrjala
2022-11-10 12:55   ` [Intel-gfx] [PATCH v3 " Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 12/15] drm/i915/audio: Hook up ELD into the state checker Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 13/15] drm/i915/audio: Include ELD in the state dump Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 14/15] drm/i915/audio: s/ilk/ibx/ Ville Syrjala
2022-11-08 15:18 ` [Intel-gfx] [PATCH v2 15/15] drm/i915/audio: Clean up the PCH type checks Ville Syrjala
2022-11-08 17:37 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: ELD precompute and readout (rev3) Patchwork
2022-11-08 17:37 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2022-11-08 17:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-11-08 23:58 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-11-11  2:43 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: ELD precompute and readout (rev4) Patchwork
2022-11-11  2:43 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-11-11  3:39 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-11-11 17:54 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-01-18 19:30 ` [Intel-gfx] [PATCH v2 00/15] drm/i915: ELD precompute and readout Kai Vehmanen

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=87bkph8m04.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tiwai@suse.de \
    --cc=ville.syrjala@linux.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