Re: [PATCH 7/9] drm/i915/display: update audio support based on the available frequencies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 08 Oct 2024, Vinod Govindapillai <vinod.govindapillai@xxxxxxxxx> wrote:
> After pruning the sad audio frequency list, if there are no
> supported audio frequencies left, audio cannot be supported.
> So mark has_audio accordingly.
>
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/display/intel_audio.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> index 14fabbcbf5da..bd135c1f2c07 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.c
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> @@ -796,6 +796,7 @@ bool intel_audio_compute_eld_config(struct drm_connector_state *conn_state,
>  {
>  	struct drm_connector *connector = conn_state->connector;
>  	struct drm_i915_private *i915 = to_i915(connector->dev);
> +	bool audio_supported = false;
>  	u8 *eld;
>  
>  	if (!intel_audio_eld_valid(conn_state))
> @@ -823,9 +824,13 @@ bool intel_audio_compute_eld_config(struct drm_connector_state *conn_state,
>  				    "SAD updated. Freq: 0x%x(0x%x) Channels: %d(%d)\n",
>  				    sad.freq, sad_freq, sad.channels, sad_channels);
>  		}
> +
> +		/* If no supported freq in any sads, make audio support to false */
> +		audio_supported |= sad.freq;

Please don't do bitwise operations on booleans.

>  	}
>  
> -	return true;
> +	drm_dbg_kms(&i915->drm, "audio supported: %d\n", audio_supported);

Having the encoder here would be great for [ENCODER...] logging.

Please don't use %d for bools. Maybe str_yes_no().

> +	return audio_supported;
>  }
>  
>  bool intel_audio_compute_config(struct intel_crtc_state *crtc_state,

-- 
Jani Nikula, Intel



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux