From: Jani Nikula <jani.nikula@linux.intel.com>
To: Matt Atwood <matthew.s.atwood@intel.com>,
intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: Suraj Kandpal <suraj.kandpal@intel.com>,
Matt Atwood <matthew.s.atwood@intel.com>,
Mika Kahola <mika.kahola@intel.com>
Subject: Re: [PATCH v4 6/7] drm/i915/xe3lpd: Add check to see if edp over type c is allowed
Date: Mon, 21 Oct 2024 15:22:33 +0300 [thread overview]
Message-ID: <875xplzlva.fsf@intel.com> (raw)
In-Reply-To: <20241018200311.67324-7-matthew.s.atwood@intel.com>
On Fri, 18 Oct 2024, Matt Atwood <matthew.s.atwood@intel.com> wrote:
> From: Suraj Kandpal <suraj.kandpal@intel.com>
>
> Read PICA register to see if edp over type C is possible and then
> add the appropriate tables for it.
>
> --v2
> -remove bool from intel_encoder have it in runtime_info [Jani]
> -initialize the bool in runtime_info init [Jani]
> -dont abbreviate the bool [Jani]
>
> Bspec: 68846
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> Signed-off-by: Matt Atwood <matthew.s.atwood@intel.com>
> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_cx0_phy.c | 4 ++++
> .../gpu/drm/i915/display/intel_display_device.c | 4 ++++
> .../gpu/drm/i915/display/intel_display_device.h | 1 +
> drivers/gpu/drm/i915/display/intel_dp.c | 17 ++++++++++++++---
> drivers/gpu/drm/i915/display/intel_dp.h | 5 +++++
> drivers/gpu/drm/i915/i915_reg.h | 3 +++
> 6 files changed, 31 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> index f878ef1a97ec..37c66b32325d 100644
> --- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> +++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> @@ -2256,9 +2256,13 @@ intel_c20_pll_tables_get(struct intel_crtc_state *crtc_state,
> struct intel_encoder *encoder)
> {
> struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> + struct intel_display_runtime_info *display_runtime = DISPLAY_RUNTIME_INFO(i915);
Please add struct intel_display *display = to_intel_display(crtc_state)
and pass that to DISPLAY_RUNTIME_INFO().
Please don't add display_runtime local variables for one time uses like
this. It could be just DISPLAY_RUNTIME_INFO(display)->edp_typec_support.
>
> if (intel_crtc_has_dp_encoder(crtc_state)) {
> if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP)) {
> + if (DISPLAY_VER(i915) >= 30 &&
The version check is redundant. You won't initialize or have
edp_typec_support unless display ver >= 30 anyway.
> + display_runtime->edp_typec_support)
> + return xe3lpd_c20_dp_edp_tables;
> if (DISPLAY_VER_FULL(i915) == IP_VER(14, 1))
> return xe2hpd_c20_edp_tables;
> }
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c
> index aa22189e3853..8583c3529060 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.c
> @@ -15,6 +15,7 @@
> #include "intel_display_params.h"
> #include "intel_display_power.h"
> #include "intel_display_reg_defs.h"
> +#include "intel_dp.h"
Drop.
> #include "intel_fbc.h"
> #include "intel_step.h"
>
> @@ -1685,6 +1686,9 @@ static void __intel_display_device_info_runtime_init(struct drm_i915_private *i9
> }
> }
>
> + if (DISPLAY_VER(i915) >= 30)
> + intel_dp_check_edp_typec_support(display, display_runtime);
> +
Please just read the register directly here like we do for all the other
straps etc. No need to add additional interfaces. We don't pass
display_runtime around in any case.
> display_runtime->rawclk_freq = intel_read_rawclk(display);
> drm_dbg_kms(&i915->drm, "rawclk rate: %d kHz\n", display_runtime->rawclk_freq);
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h
> index 071a36b51f79..410f8b33a8a1 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h
> @@ -232,6 +232,7 @@ struct intel_display_runtime_info {
> bool has_hdcp;
> bool has_dmc;
> bool has_dsc;
> + bool edp_typec_support;
> };
>
> struct intel_display_device_info {
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 7e04913bc2ff..be21e2743801 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -5571,6 +5571,16 @@ intel_dp_detect_sdp_caps(struct intel_dp *intel_dp)
> drm_dp_as_sdp_supported(&intel_dp->aux, intel_dp->dpcd);
> }
>
> +void
> +intel_dp_check_edp_typec_support(struct intel_display *display,
> + struct intel_display_runtime_info *display_runtime)
> +{
> + u32 ret = 0;
> +
> + ret = intel_de_read(display, PICA_PHY_CONFIG_CONTROL);
> + display_runtime->edp_typec_support = ret & EDP_ON_TYPEC;
> +}
> +
This is a completely unnecessary function and interface, just drop it,
and do this in runtime info init.
> static int
> intel_dp_detect(struct drm_connector *connector,
> struct drm_modeset_acquire_ctx *ctx,
> @@ -6440,10 +6450,11 @@ intel_dp_init_connector(struct intel_digital_port *dig_port,
>
> if (_intel_dp_is_port_edp(dev_priv, intel_encoder->devdata, port)) {
> /*
> - * Currently we don't support eDP on TypeC ports, although in
> - * theory it could work on TypeC legacy ports.
> + * Currently we don't support eDP on TypeC ports for DISPLAY_VER < 30,
> + * although in theory it could work on TypeC legacy ports.
> */
> - drm_WARN_ON(dev, intel_encoder_is_tc(intel_encoder));
> + if (DISPLAY_VER(dev_priv) < 30)
> + drm_WARN_ON(dev, intel_encoder_is_tc(intel_encoder));
Just include the version check in the drm_WARN_ON() instead of adding it
inside an if.
drm_WARN_ON(dev, intel_encoder_is_tc(intel_encoder) && DISPLAY_VER(dev_priv) < 30);
> type = DRM_MODE_CONNECTOR_eDP;
> intel_encoder->type = INTEL_OUTPUT_EDP;
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
> index 60baf4072dc9..c6a80c4e2166 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.h
> +++ b/drivers/gpu/drm/i915/display/intel_dp.h
> @@ -20,6 +20,8 @@ struct intel_atomic_state;
> struct intel_connector;
> struct intel_crtc_state;
> struct intel_digital_port;
> +struct intel_display;
> +struct intel_display_runtime_info;
Drop.
> struct intel_dp;
> struct intel_encoder;
>
> @@ -204,5 +206,8 @@ bool intel_dp_link_params_valid(struct intel_dp *intel_dp, int link_rate,
> u8 lane_count);
> bool intel_dp_has_connector(struct intel_dp *intel_dp,
> const struct drm_connector_state *conn_state);
> +void
> +intel_dp_check_edp_typec_support(struct intel_display *display,
> + struct intel_display_runtime_info *display_runtime);
Drop.
>
> #endif /* __INTEL_DP_H__ */
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 8d758947f301..2743a2dd0a3d 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -4575,4 +4575,7 @@ enum skl_power_gate {
>
> #define MTL_MEDIA_GSI_BASE 0x380000
>
> +#define PICA_PHY_CONFIG_CONTROL _MMIO(0x16FE68)
> +#define EDP_ON_TYPEC REG_BIT(31)
> +
We shouldn't be adding new display registers to i915_reg.h anymore...
> #endif /* _I915_REG_H_ */
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-10-21 12:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 20:03 [PATCH v4 0/7] Add xe3lpd edp enabling Matt Atwood
2024-10-18 20:03 ` [PATCH v4 1/7] drm/i915/xe3lpd: Update pmdemand programming Matt Atwood
2024-10-21 12:41 ` Gustavo Sousa
2024-10-18 20:03 ` [PATCH v4 2/7] drm/i915/xe3lpd: Add cdclk changes Matt Atwood
2024-10-21 12:49 ` Gustavo Sousa
2024-10-18 20:03 ` [PATCH v4 3/7] drm/i915/xe3lpd: Disable HDCP Line Rekeying for Xe3 Matt Atwood
2024-10-23 17:52 ` Matt Roper
2024-10-24 2:52 ` Kandpal, Suraj
2024-10-25 18:58 ` Matt Roper
2024-10-28 4:11 ` Kandpal, Suraj
2024-10-30 0:02 ` Matt Roper
2024-11-04 3:44 ` Kandpal, Suraj
2024-10-18 20:03 ` [PATCH v4 4/7] drm/i915/xe3lpd: Add C20 Phy consolidated programming table Matt Atwood
2024-10-18 20:03 ` [PATCH v4 5/7] drm/i915/xe3lpd: Add new bit range of MAX swing setup Matt Atwood
2024-10-18 23:38 ` Matt Roper
2024-10-18 20:03 ` [PATCH v4 6/7] drm/i915/xe3lpd: Add check to see if edp over type c is allowed Matt Atwood
2024-10-21 12:22 ` Jani Nikula [this message]
2024-10-18 20:03 ` [PATCH v4 7/7] drm/i915/xe3lpd: Add condition for EDP to powerdown P2.PG Matt Atwood
2024-10-18 20:08 ` ✓ CI.Patch_applied: success for Add xe3lpd edp enabling (rev4) Patchwork
2024-10-18 20:08 ` ✗ CI.checkpatch: warning " Patchwork
2024-10-18 20:10 ` ✓ CI.KUnit: success " Patchwork
2024-10-18 20:28 ` ✓ CI.Build: " Patchwork
2024-10-18 20:31 ` ✓ CI.Hooks: " Patchwork
2024-10-18 20:32 ` ✗ CI.checksparse: warning " Patchwork
2024-10-18 21:20 ` ✗ CI.BAT: failure " Patchwork
2024-10-19 13:49 ` ✗ CI.FULL: " 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=875xplzlva.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.s.atwood@intel.com \
--cc=mika.kahola@intel.com \
--cc=suraj.kandpal@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