<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi Jani</div>
<div id="appendonsend"></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size: 11pt; color: rgb(0, 0, 0);"><b>From:</b> Jani Nikula <jani.nikula@linux.intel.com><br>
<b>Sent:</b> Tuesday, August 8, 2023 4:23 PM<br>
<b>To:</b> Govindapillai, Vinod <vinod.govindapillai@intel.com>; intel-gfx@lists.freedesktop.org <intel-gfx@lists.freedesktop.org><br>
<b>Subject:</b> Re: [Intel-gfx] [PATCH 1/2] drm/i915/display: optimize DP 2.0 sdp split update config</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">On Fri, 04 Aug 2023, Vinod Govindapillai <vinod.govindapillai@intel.com> wrote:<br>
> Optimize DP 2 SDP split config update so that DP-MST code<br>
> path can be supported as well.<br>
<br>
What's the optimization?</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">I meant refactoring!</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">Okay I will have a  look at updating this  as per your comments</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">BR</div>
<div class="PlainText">vinod</div>
<div class="PlainText"><br>
><br>
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com><br>
> ---<br>
>  drivers/gpu/drm/i915/display/intel_audio.c   |  6 +++---<br>
>  drivers/gpu/drm/i915/display/intel_audio.h   |  3 +--<br>
>  drivers/gpu/drm/i915/display/intel_ddi.c     |  3 ---<br>
>  drivers/gpu/drm/i915/display/intel_display.c |  3 +++<br>
>  drivers/gpu/drm/i915/display/intel_dp.c      | 16 +++++++---------<br>
>  drivers/gpu/drm/i915/display/intel_dp.h      |  2 ++<br>
>  6 files changed, 16 insertions(+), 17 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c<br>
> index 3d9c9b4f27f8..19605264a35c 100644<br>
> --- a/drivers/gpu/drm/i915/display/intel_audio.c<br>
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c<br>
> @@ -759,10 +759,10 @@ static void ibx_audio_codec_enable(struct intel_encoder *encoder,<br>
>        mutex_unlock(&i915->display.audio.mutex);<br>
>  }<br>
>  <br>
> -void intel_audio_sdp_split_update(struct intel_encoder *encoder,<br>
> -                               const struct intel_crtc_state *crtc_state)<br>
> +void intel_audio_sdp_split_update(const struct intel_crtc_state *crtc_state)<br>
>  {<br>
> -     struct drm_i915_private *i915 = to_i915(encoder->base.dev);<br>
> +     struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);<br>
> +     struct drm_i915_private *i915 = to_i915(crtc->base.dev);<br>
>        enum transcoder trans = crtc_state->cpu_transcoder;<br>
>  <br>
>        if (HAS_DP20(i915))<br>
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.h b/drivers/gpu/drm/i915/display/intel_audio.h<br>
> index 07d034a981e9..9327954b801e 100644<br>
> --- a/drivers/gpu/drm/i915/display/intel_audio.h<br>
> +++ b/drivers/gpu/drm/i915/display/intel_audio.h<br>
> @@ -29,7 +29,6 @@ void intel_audio_cdclk_change_pre(struct drm_i915_private *dev_priv);<br>
>  void intel_audio_cdclk_change_post(struct drm_i915_private *dev_priv);<br>
>  void intel_audio_init(struct drm_i915_private *dev_priv);<br>
>  void intel_audio_deinit(struct drm_i915_private *dev_priv);<br>
> -void intel_audio_sdp_split_update(struct intel_encoder *encoder,<br>
> -                               const struct intel_crtc_state *crtc_state);<br>
> +void intel_audio_sdp_split_update(const struct intel_crtc_state *crtc_state);<br>
>  <br>
>  #endif /* __INTEL_AUDIO_H__ */<br>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c<br>
> index 3cd2191fa794..542bc521669a 100644<br>
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c<br>
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c<br>
> @@ -3247,9 +3247,6 @@ static void intel_enable_ddi(struct intel_atomic_state *state,<br>
>        if (!intel_crtc_is_bigjoiner_slave(crtc_state))<br>
>                intel_ddi_enable_transcoder_func(encoder, crtc_state);<br>
>  <br>
> -     /* Enable/Disable DP2.0 SDP split config before transcoder */<br>
> -     intel_audio_sdp_split_update(encoder, crtc_state);<br>
> -<br>
>        intel_enable_transcoder(crtc_state);<br>
>  <br>
>        intel_crtc_vblank_on(crtc_state);<br>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c<br>
> index 43cba98f7753..54afc559f522 100644<br>
> --- a/drivers/gpu/drm/i915/display/intel_display.c<br>
> +++ b/drivers/gpu/drm/i915/display/intel_display.c<br>
> @@ -402,6 +402,9 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state)<br>
>  <br>
>        assert_planes_disabled(crtc);<br>
>  <br>
> +     /* Enable/Disable DP2.0 SDP split config before transcoder */<br>
> +     intel_audio_sdp_split_update(new_crtc_state);<br>
<br>
The call belongs in the encoder code. Search for "audio" in<br>
intel_display.c; there's almost nothing.<br>
<br>
> +<br>
>        /*<br>
>         * A pipe without a PLL won't actually be able to drive bits from<br>
>         * a plane.  On ILK+ the pipe PLLs are integrated, so we don't<br>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c<br>
> index 03675620e3ea..4a5be800715c 100644<br>
> --- a/drivers/gpu/drm/i915/display/intel_dp.c<br>
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c<br>
> @@ -2232,17 +2232,15 @@ intel_dp_compute_output_format(struct intel_encoder *encoder,<br>
>        return ret;<br>
>  }<br>
>  <br>
> -static void<br>
> -intel_dp_audio_compute_config(struct intel_encoder *encoder,<br>
> -                           struct intel_crtc_state *pipe_config,<br>
> -                           struct drm_connector_state *conn_state)<br>
> +void intel_dp_audio_compute_config(struct intel_crtc_state *pipe_config,<br>
> +                                struct drm_connector_state *conn_state)<br>
>  {<br>
> -     struct drm_i915_private *i915 = to_i915(encoder->base.dev);<br>
> +     struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);<br>
> +     struct drm_i915_private *i915 = to_i915(crtc->base.dev);<br>
>        struct drm_connector *connector = conn_state->connector;<br>
>  <br>
> -     pipe_config->sdp_split_enable =<br>
> -             intel_dp_has_audio(encoder, conn_state) &&<br>
> -             intel_dp_is_uhbr(pipe_config);<br>
> +     pipe_config->sdp_split_enable = pipe_config->has_audio &&<br>
> +                                     intel_dp_is_uhbr(pipe_config);<br>
<br>
Hmmh, I don't get this.<br>
<br>
I guess the neatest thing to do would be to have a single<br>
intel_dp_audio_compute_config() that would do everything needed for DP<br>
and DP MST, as well as call intel_audio_compute_config().<br>
<br>
It think it's somewhat confusing that the compute config hooks call both<br>
intel_audio_compute_config() and intel_dp_audio_compute_config(). Seems<br>
like the latter should call the former.<br>
<br>
BR,<br>
Jani.<br>
<br>
<br>
<br>
>  <br>
>        drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] SDP split enable: %s\n",<br>
>                    connector->base.id, connector->name,<br>
> @@ -2334,7 +2332,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,<br>
>                adjusted_mode->crtc_clock /= n;<br>
>        }<br>
>  <br>
> -     intel_dp_audio_compute_config(encoder, pipe_config, conn_state);<br>
> +     intel_dp_audio_compute_config(pipe_config, conn_state);<br>
>  <br>
>        intel_link_compute_m_n(output_bpp,<br>
>                               pipe_config->lane_count,<br>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h<br>
> index 22099de3ca45..1a73820204ae 100644<br>
> --- a/drivers/gpu/drm/i915/display/intel_dp.h<br>
> +++ b/drivers/gpu/drm/i915/display/intel_dp.h<br>
> @@ -65,6 +65,8 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,<br>
>                                struct link_config_limits *limits,<br>
>                                int timeslots,<br>
>                                bool recompute_pipe_bpp);<br>
> +void intel_dp_audio_compute_config(struct intel_crtc_state *pipe_config,<br>
> +                                struct drm_connector_state *conn_state);<br>
>  bool intel_dp_has_hdmi_sink(struct intel_dp *intel_dp);<br>
>  bool intel_dp_is_edp(struct intel_dp *intel_dp);<br>
>  bool intel_dp_is_uhbr(const struct intel_crtc_state *crtc_state);<br>
<br>
-- <br>
Jani Nikula, Intel Open Source Graphics Center<br>
</div>
</span></font></div>
</body>
</html>