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 2/4] drm/i915/display: combine has_audio check for DP and DP-MST
Date: Tue, 15 Aug 2023 20:29:59 +0300 [thread overview]
Message-ID: <87r0o4b4dk.fsf@intel.com> (raw)
In-Reply-To: <20230815142921.404127-3-vinod.govindapillai@intel.com>
On Tue, 15 Aug 2023, Vinod Govindapillai <vinod.govindapillai@intel.com> wrote:
> Combine has_audio check for both DP and DP-MST into a single
> function.
I tried to explain the first step should be combining these two steps in
intel_dp_compute_config():
1)
pipe_config->has_audio =
intel_dp_has_audio(encoder, conn_state) &&
intel_audio_compute_config(encoder, pipe_config, conn_state);
2)
intel_dp_audio_compute_config(encoder, pipe_config, conn_state);
The latter function should include step 1.
Simplify first, only add the MST complication afterwards. Not vice
versa.
>
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_dp.c | 18 +++++++++---------
> drivers/gpu/drm/i915/display/intel_dp.h | 3 +++
> drivers/gpu/drm/i915/display/intel_dp_mst.c | 15 +--------------
> 3 files changed, 13 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 12bd2f322e62..97a14afbcfe8 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2170,16 +2170,17 @@ intel_dp_drrs_compute_config(struct intel_connector *connector,
> pipe_config->dp_m2_n2.data_m *= pipe_config->splitter.link_count;
> }
>
> -static bool intel_dp_has_audio(struct intel_encoder *encoder,
> - const struct drm_connector_state *conn_state)
> +bool intel_dp_has_audio(struct intel_encoder *encoder,
Now you've created an intermediate step that requires this to be
non-static, but you also don't add static back afterwards.
> + const struct drm_connector_state *conn_state,
> + struct intel_dp *intel_dp)
There should be no need to pass intel_dp as parameter.
BR,
Jani.
> {
> struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> - struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> - struct intel_connector *connector = intel_dp->attached_connector;
> const struct intel_digital_connector_state *intel_conn_state =
> to_intel_digital_connector_state(conn_state);
> + struct intel_connector *connector =
> + to_intel_connector(conn_state->connector);
>
> - if (!intel_dp_port_has_audio(i915, encoder->port))
> + if (!intel_dp->is_mst && !intel_dp_port_has_audio(i915, encoder->port))
> return false;
>
> if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO)
> @@ -2240,9 +2241,8 @@ intel_dp_audio_compute_config(struct intel_encoder *encoder,
> 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, conn_state) &&
> - intel_dp_is_uhbr(pipe_config);
> + pipe_config->sdp_split_enable = pipe_config->has_audio &&
> + intel_dp_is_uhbr(pipe_config);
>
> drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] SDP split enable: %s\n",
> connector->base.id, connector->name,
> @@ -2265,7 +2265,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
> pipe_config->has_pch_encoder = true;
>
> pipe_config->has_audio =
> - intel_dp_has_audio(encoder, conn_state) &&
> + intel_dp_has_audio(encoder, conn_state, intel_dp) &&
> intel_audio_compute_config(encoder, pipe_config, conn_state);
>
> fixed_mode = intel_panel_fixed_mode(connector, adjusted_mode);
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
> index 22099de3ca45..e7b515b685ac 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.h
> +++ b/drivers/gpu/drm/i915/display/intel_dp.h
> @@ -69,6 +69,9 @@ bool intel_dp_has_hdmi_sink(struct intel_dp *intel_dp);
> bool intel_dp_is_edp(struct intel_dp *intel_dp);
> bool intel_dp_is_uhbr(const struct intel_crtc_state *crtc_state);
> bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
> +bool intel_dp_has_audio(struct intel_encoder *encoder,
> + const struct drm_connector_state *conn_state,
> + struct intel_dp *intel_dp);
> enum irqreturn intel_dp_hpd_pulse(struct intel_digital_port *dig_port,
> bool long_hpd);
> void intel_edp_backlight_on(const struct intel_crtc_state *crtc_state,
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index e3f176a093d2..8881cfd41ee7 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -290,19 +290,6 @@ static int intel_dp_mst_update_slots(struct intel_encoder *encoder,
> return 0;
> }
>
> -static bool intel_dp_mst_has_audio(const struct drm_connector_state *conn_state)
> -{
> - const struct intel_digital_connector_state *intel_conn_state =
> - to_intel_digital_connector_state(conn_state);
> - struct intel_connector *connector =
> - to_intel_connector(conn_state->connector);
> -
> - if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO)
> - return connector->base.display_info.has_audio;
> - else
> - return intel_conn_state->force_audio == HDMI_AUDIO_ON;
> -}
> -
> static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
> struct intel_crtc_state *pipe_config,
> struct drm_connector_state *conn_state)
> @@ -323,7 +310,7 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
> pipe_config->has_pch_encoder = false;
>
> pipe_config->has_audio =
> - intel_dp_mst_has_audio(conn_state) &&
> + intel_dp_has_audio(encoder, conn_state, intel_dp) &&
> intel_audio_compute_config(encoder, pipe_config, conn_state);
>
> /*
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2023-08-15 17:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 14:29 [Intel-gfx] [PATCH v2 0/4] SDP split for DP-MST Vinod Govindapillai
2023-08-15 14:29 ` [Intel-gfx] [PATCH v2 1/4] drm/i915/display: remove redundant parameter from sdp split update Vinod Govindapillai
2023-08-15 17:20 ` Jani Nikula
2023-08-15 14:29 ` [Intel-gfx] [PATCH v2 2/4] drm/i915/display: combine has_audio check for DP and DP-MST Vinod Govindapillai
2023-08-15 17:29 ` Jani Nikula [this message]
2023-08-15 14:29 ` [Intel-gfx] [PATCH v2 3/4] drm/i915/display: combine DP audio compute config steps Vinod Govindapillai
2023-08-15 17:32 ` Jani Nikula
2023-08-15 14:29 ` [Intel-gfx] [PATCH v2 4/4] drm/915/display: configure SDP split for DP-MST Vinod Govindapillai
2023-08-15 17:34 ` Jani Nikula
2023-08-15 15:18 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2023-08-15 15:18 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-08-15 15:36 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-08-15 16:52 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=87r0o4b4dk.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 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.