From: Jani Nikula <jani.nikula@intel.com>
To: Vinod Govindapillai <vinod.govindapillai@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: Enable SDP split for DP2.0
Date: Mon, 21 Nov 2022 15:15:48 +0200 [thread overview]
Message-ID: <87pmdgzbwb.fsf@intel.com> (raw)
In-Reply-To: <20221101112120.1138595-1-vinod.govindapillai@intel.com>
On Tue, 01 Nov 2022, Vinod Govindapillai <vinod.govindapillai@intel.com> wrote:
> Enable the SDP split configuration for DP2.0.
>
> v2: Move the register handling out of compute config function (JaniN)
>
> v3: Patch styling and register access based on platform support (JaniN)
>
> v4: Rebased
>
> Bspec: 67768
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_audio.c | 12 ++++++++++++
> drivers/gpu/drm/i915/display/intel_audio.h | 2 ++
> drivers/gpu/drm/i915/display/intel_ddi.c | 3 +++
> .../drm/i915/display/intel_display_types.h | 2 ++
> drivers/gpu/drm/i915/display/intel_dp.c | 19 +++++++++++++++++++
> 5 files changed, 38 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> index c3176c9c89a6..415ac3960272 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.c
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> @@ -798,6 +798,18 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder,
> mutex_unlock(&i915->display.audio.mutex);
> }
>
> +void intel_audio_sdp_split_update(struct intel_encoder *encoder,
> + const struct intel_crtc_state *crtc_state)
> +{
> + struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> + enum transcoder trans = crtc_state->cpu_transcoder;
> + u32 clear = crtc_state->sdp_split_enable ? 0 : AUD_ENABLE_SDP_SPLIT;
> + u32 set = crtc_state->sdp_split_enable ? AUD_ENABLE_SDP_SPLIT : 0;
> +
> + if (HAS_DP20(i915))
> + intel_de_rmw(i915, AUD_DP_2DOT0_CTRL(trans), clear, set);
It's customary to unconditionally set the clear mask.
intel_de_rmw(i915, AUD_DP_2DOT0_CTRL(trans), AUD_ENABLE_SDP_SPLIT,
crtc_state->sdp_split_enable ? AUD_ENABLE_SDP_SPLIT : 0);
With that fixed,
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> +}
I'm still not entirely happy about adding this very specific function to
intel_audio.[ch] interfaces, but I guess it's simple enough to change if
we find a nicer place for it.
> +
> /**
> * intel_audio_codec_enable - Enable the audio codec for HD audio
> * @encoder: encoder on which to enable audio
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.h b/drivers/gpu/drm/i915/display/intel_audio.h
> index 63b22131dc45..1b87257c6a17 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.h
> +++ b/drivers/gpu/drm/i915/display/intel_audio.h
> @@ -22,5 +22,7 @@ void intel_audio_cdclk_change_pre(struct drm_i915_private *dev_priv);
> void intel_audio_cdclk_change_post(struct drm_i915_private *dev_priv);
> void intel_audio_init(struct drm_i915_private *dev_priv);
> void intel_audio_deinit(struct drm_i915_private *dev_priv);
> +void intel_audio_sdp_split_update(struct intel_encoder *encoder,
> + const struct intel_crtc_state *crtc_state);
>
> #endif /* __INTEL_AUDIO_H__ */
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index e95bde5cf060..c84b7b0e4c19 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -2917,6 +2917,9 @@ static void intel_enable_ddi(struct intel_atomic_state *state,
>
> intel_vrr_enable(encoder, crtc_state);
>
> + /* Enable/Disable DP2.0 SDP split config before transcoder */
> + intel_audio_sdp_split_update(encoder, crtc_state);
> +
> intel_enable_transcoder(crtc_state);
>
> intel_crtc_vblank_on(crtc_state);
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 7f18c052ec16..07eab71d3fc2 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1286,6 +1286,8 @@ struct intel_crtc_state {
> /* Forward Error correction State */
> bool fec_enable;
>
> + bool sdp_split_enable;
> +
> /* Pointer to master transcoder in case of tiled displays */
> enum transcoder master_transcoder;
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 7400d6b4c587..8a1af1294c6a 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2008,6 +2008,23 @@ intel_dp_compute_output_format(struct intel_encoder *encoder,
> return ret;
> }
>
> +static void
> +intel_dp_audio_compute_config(struct intel_encoder *encoder,
> + struct intel_crtc_state *pipe_config,
> + struct drm_connector_state *conn_state)
> +{
> + struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> + struct drm_connector *connector = conn_state->connector;
> +
> + pipe_config->sdp_split_enable =
> + intel_dp_has_audio(encoder, pipe_config, conn_state) &&
> + intel_dp_is_uhbr(pipe_config);
The indentation is probably off here.
> +
> + drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] SDP split enable: %s\n",
> + connector->base.id, connector->name,
> + str_yes_no(pipe_config->sdp_split_enable));
> +}
> +
> int
> intel_dp_compute_config(struct intel_encoder *encoder,
> struct intel_crtc_state *pipe_config,
> @@ -2091,6 +2108,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
> adjusted_mode->crtc_clock /= n;
> }
>
> + intel_dp_audio_compute_config(encoder, pipe_config, conn_state);
> +
> intel_link_compute_m_n(output_bpp,
> pipe_config->lane_count,
> adjusted_mode->crtc_clock,
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2022-11-21 13:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 11:21 [Intel-gfx] [PATCH v2] drm/i915: Enable SDP split for DP2.0 Vinod Govindapillai
2022-11-01 13:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Enable SDP split for DP2.0 (rev2) Patchwork
2022-11-01 17:36 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-11-21 13:15 ` Jani Nikula [this message]
2022-11-21 15:14 ` [Intel-gfx] [PATCH v2] drm/i915: Enable SDP split for DP2.0 Govindapillai, Vinod
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=87pmdgzbwb.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--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