From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: uma.shankar@intel.com, ville.syrjala@linux.intel.com,
Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Subject: Re: [PATCH 5/9] drm/i915/display: Add bits for link_n_exended for DISPLAY >= 14
Date: Tue, 29 Jul 2025 14:08:38 +0300 [thread overview]
Message-ID: <a345b688ad4e61bc296a11a82d04b7fc1b70622e@intel.com> (raw)
In-Reply-To: <20250721091529.3864004-6-ankit.k.nautiyal@intel.com>
On Mon, 21 Jul 2025, Ankit Nautiyal <ankit.k.nautiyal@intel.com> wrote:
> LINK_N register has bits 31:24 for extended link N value used for
> HDMI2.1 and for an alternate mode of operation of DP TG DDA
> (Bspec:50488).
>
> Add support for these extra bits.
>
> For displays with version 14 or higher, the `PIPE_LINK_N1_EXTENDED_MASK`
> (bits 31:24) is used to handle the extended link N bits.
> For older platforms, the `DATA_LINK_M_N_MASK` (bits 23:0) is used to
> handle the standard link N bits. This distinction ensures clarity and
> maintains the semantics for platforms that support the extended bits.
> In subsequent changes the logic is updated to conditionally apply the
> extended link N bits.
>
> v2: Drop extra link_n_ext member. (Jani)
> v3: Avoid link_n_ext in set_m_n helper. (Jani)
> v4: Rebase, and update commit message.
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 18 ++++++++++++++++--
> .../gpu/drm/i915/display/intel_display_regs.h | 2 ++
> 2 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index f32a4956c926..5232478613aa 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -2578,14 +2578,22 @@ void intel_set_m_n(struct intel_display *display,
> i915_reg_t data_m_reg, i915_reg_t data_n_reg,
> i915_reg_t link_m_reg, i915_reg_t link_n_reg)
> {
> + u32 link_n = m_n->link_n;
> +
> intel_de_write(display, data_m_reg, TU_SIZE(m_n->tu) | m_n->data_m);
> intel_de_write(display, data_n_reg, m_n->data_n);
> intel_de_write(display, link_m_reg, m_n->link_m);
> +
> + if (DISPLAY_VER(display) >= 14)
> + link_n &= ~PIPE_LINK_N1_EXTENDED_MASK;
> + else
> + link_n &= DATA_LINK_M_N_MASK;
> +
> /*
> * On BDW+ writing LINK_N arms the double buffered update
> * of all the M/N registers, so it must be written last.
> */
> - intel_de_write(display, link_n_reg, m_n->link_n);
> + intel_de_write(display, link_n_reg, link_n);
> }
>
> bool intel_cpu_transcoder_has_m2_n2(struct intel_display *display,
> @@ -3321,7 +3329,13 @@ void intel_get_m_n(struct intel_display *display,
> i915_reg_t link_m_reg, i915_reg_t link_n_reg)
> {
> m_n->link_m = intel_de_read(display, link_m_reg) & DATA_LINK_M_N_MASK;
> - m_n->link_n = intel_de_read(display, link_n_reg) & DATA_LINK_M_N_MASK;
> + m_n->link_n = intel_de_read(display, link_n_reg);
> +
> + if (DISPLAY_VER(display) >= 14)
> + m_n->link_n &= ~PIPE_LINK_N1_EXTENDED_MASK;
> + else
> + m_n->link_n &= DATA_LINK_M_N_MASK;
> +
> m_n->data_m = intel_de_read(display, data_m_reg) & DATA_LINK_M_N_MASK;
> m_n->data_n = intel_de_read(display, data_n_reg) & DATA_LINK_M_N_MASK;
> m_n->tu = REG_FIELD_GET(TU_SIZE_MASK, intel_de_read(display, data_m_reg)) + 1;
> diff --git a/drivers/gpu/drm/i915/display/intel_display_regs.h b/drivers/gpu/drm/i915/display/intel_display_regs.h
> index 7bd09d981cd2..9248561aec5f 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_regs.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_regs.h
> @@ -1027,6 +1027,8 @@
>
> #define _PIPEA_LINK_N1 0x60044
> #define _PIPEB_LINK_N1 0x61044
> +#define PIPE_LINK_N1_EXTENDED_MASK REG_GENMASK(31, 24)
> +#define PIPE_LINK_N1_EXTENDED(val) REG_FIELD_PREP(PIPE_LINK_N1_EXTENDED_MASK, (val))
Please read the comment near the top of i915_reg.h, and send patches to
amend the comment if there's something unclear.
BR,
Jani.
> #define PIPE_LINK_N1(dev_priv, tran) _MMIO_TRANS2(dev_priv, tran, _PIPEA_LINK_N1)
>
> #define _PIPEA_LINK_M2 0x60048
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-07-29 11:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 9:15 [PATCH 0/4] Implement Wa_14021768792 to bypass m_n ratio limit Ankit Nautiyal
2025-07-21 9:15 ` [PATCH 1/9] drm/i915: Add helper to compute link M/N ratio for reuse Ankit Nautiyal
2025-07-21 9:15 ` [PATCH 2/9] drm/i915/dp: Limit m/n ratio to 10 for DP SST Ankit Nautiyal
2025-07-21 11:41 ` Imre Deak
2025-07-22 5:55 ` Nautiyal, Ankit K
2025-07-22 9:22 ` Imre Deak
2025-07-22 15:15 ` Nautiyal, Ankit K
2025-07-21 9:15 ` [PATCH 3/9] drm/i915/dp_mst: Limit m/n ratio to 10 for MST Ankit Nautiyal
2025-07-21 9:15 ` [PATCH 4/9] drm/i915/dp: Add M/N ratio check with warning for DP link config Ankit Nautiyal
2025-07-21 9:15 ` [PATCH 5/9] drm/i915/display: Add bits for link_n_exended for DISPLAY >= 14 Ankit Nautiyal
2025-07-29 11:08 ` Jani Nikula [this message]
2025-07-21 9:15 ` [PATCH 6/9] drm/i915/display_wa: Add support for Wa_14021768792 Ankit Nautiyal
2025-07-29 11:10 ` Jani Nikula
2025-07-21 9:15 ` [PATCH 7/9] drm/i915/display: Add bits for Wa_14021768792 for linkm/n ratio > 10 Ankit Nautiyal
2025-07-21 9:15 ` [PATCH 8/9] drm/i915/display: Implement Wa_14021768792 for BMG DP for link_m/n " Ankit Nautiyal
2025-07-21 9:15 ` [PATCH 9/9] drm/i915/dp: Extend intel_dp_can_support_m_n() for BMG M/N bypass Ankit Nautiyal
2025-07-21 9:34 ` ✗ CI.checkpatch: warning for Implement Wa_14021768792 to bypass m_n ratio limit (rev5) Patchwork
2025-07-21 9:35 ` ✓ CI.KUnit: success " Patchwork
2025-07-21 9:50 ` ✗ CI.checksparse: warning " Patchwork
2025-07-21 17:27 ` ✓ Xe.CI.BAT: success " Patchwork
2025-07-21 18:17 ` ✗ Xe.CI.Full: failure " 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=a345b688ad4e61bc296a11a82d04b7fc1b70622e@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=uma.shankar@intel.com \
--cc=ville.syrjala@linux.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