All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: ville.syrjala@linux.intel.com, arun.r.murthy@intel.com,
	jani.nikula@linux.intel.com, suraj.kandpal@intel.com,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Subject: [PATCH v5 10/12] drm/i915/dp: Introduce helpers to enable/disable CMN SDP Transmission line
Date: Tue,  8 Sep 2026 11:52:21 +0530	[thread overview]
Message-ID: <20260908062224.2897987-11-ankit.k.nautiyal@intel.com> (raw)
In-Reply-To: <20260908062224.2897987-1-ankit.k.nautiyal@intel.com>

Introduce helpers to program or disable CMN_SDP_TL and stagger registers
using the state stored in crtc_state.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dip.c | 56 ++++++++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_dip.h |  2 +
 2 files changed, 58 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dip.c b/drivers/gpu/drm/i915/display/intel_dip.c
index d1acc7eb5a39..0c80d6305fec 100644
--- a/drivers/gpu/drm/i915/display/intel_dip.c
+++ b/drivers/gpu/drm/i915/display/intel_dip.c
@@ -4,6 +4,8 @@
  *
  */
 
+#include <drm/drm_print.h>
+
 #include "intel_de.h"
 #include "intel_dip.h"
 #include "intel_dip_regs.h"
@@ -61,3 +63,57 @@ void intel_dip_sdp_transmission_line_get_config(struct intel_crtc_state *crtc_st
 {
 	crtc_state->dip.emp_as_sdp_tl = intel_dip_read_emp_as_sdp_tl(crtc_state);
 }
+
+static int intel_dip_sdp_tl_to_stagger(const struct intel_crtc_state *crtc_state,
+				       u16 sdp_transmission_line)
+{
+	return sdp_transmission_line - crtc_state->dip.cmn_sdp_tl;
+}
+
+void intel_dip_cmn_sdp_transmission_line_enable(const struct intel_crtc_state *crtc_state)
+{
+	struct intel_display *display = to_intel_display(crtc_state);
+	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
+	int gmp_stagger;
+	int pps_stagger;
+	int vsc_ext_stagger;
+
+	if (!crtc_state->dip.cmn_sdp_tl)
+		return;
+
+	gmp_stagger = intel_dip_sdp_tl_to_stagger(crtc_state,
+						  crtc_state->dip.gmp_sdp_tl);
+
+	pps_stagger = intel_dip_sdp_tl_to_stagger(crtc_state,
+						  crtc_state->dip.pps_sdp_tl);
+
+	vsc_ext_stagger = intel_dip_sdp_tl_to_stagger(crtc_state,
+						      crtc_state->dip.vsc_ext_sdp_tl);
+
+	if (drm_WARN_ON(display->drm, gmp_stagger < 0))
+		return;
+	if (drm_WARN_ON(display->drm, pps_stagger < 0))
+		return;
+	if (drm_WARN_ON(display->drm, vsc_ext_stagger < 0))
+		return;
+
+	intel_de_write(display, CMN_SDP_TL_STGR_CTL(display, cpu_transcoder),
+		       GMP_STAGGER(gmp_stagger) |
+		       PPS_STAGGER(pps_stagger) |
+		       VSC_EXT_STAGGER(vsc_ext_stagger));
+
+	intel_de_write(display, CMN_SDP_TL(display, cpu_transcoder),
+		       TRANSMISSION_LINE_ENABLE |
+		       BASE_TRANSMISSION_LINE(crtc_state->dip.cmn_sdp_tl));
+}
+
+void intel_dip_cmn_sdp_transmission_line_disable(const struct intel_crtc_state *old_crtc_state)
+{
+	struct intel_display *display = to_intel_display(old_crtc_state);
+	enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder;
+
+	if (!old_crtc_state->dip.cmn_sdp_tl)
+		return;
+
+	intel_de_write(display, CMN_SDP_TL(display, cpu_transcoder), 0);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_dip.h b/drivers/gpu/drm/i915/display/intel_dip.h
index 03ef749a79ca..24d6228c2f8d 100644
--- a/drivers/gpu/drm/i915/display/intel_dip.h
+++ b/drivers/gpu/drm/i915/display/intel_dip.h
@@ -61,5 +61,7 @@ struct intel_dip {
 
 void intel_dip_sdp_tl_compute_config_late(struct intel_crtc_state *crtc_state);
 void intel_dip_sdp_transmission_line_get_config(struct intel_crtc_state *crtc_state);
+void intel_dip_cmn_sdp_transmission_line_enable(const struct intel_crtc_state *crtc_state);
+void intel_dip_cmn_sdp_transmission_line_disable(const struct intel_crtc_state *old_crtc_state);
 
 #endif /* __INTEL_DIP_H__ */
-- 
2.50.1


  parent reply	other threads:[~2026-09-08  6:39 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08  6:22 [PATCH v5 00/12] Add support for Common SDP Transmission Line Ankit Nautiyal
2026-09-08  6:22 ` [PATCH v5 01/12] drm/i915/dip: Add new file to handle Data Island Packet hardware Ankit Nautiyal
2026-09-08  6:22 ` [PATCH v5 02/12] drm/i915/vrr: Use the helper to write EMP_AS_SDP_TL register Ankit Nautiyal
2026-09-08  6:22 ` [PATCH v5 03/12] drm/i915/intel_dip: Add check for DP encoder Ankit Nautiyal
2026-09-08  6:22 ` [PATCH v5 04/12] drm/i915/dip: Add helper to get AS SDP Transmission Line Ankit Nautiyal
2026-09-08  6:22 ` [PATCH v5 05/12] drm/i915/display: Add crtc state for DIP transmission lines Ankit Nautiyal
2026-09-08  6:22 ` [PATCH v5 06/12] drm/i915/dip: Store and use AS SDP transmission line from crtc state Ankit Nautiyal
2026-09-08  7:09   ` sashiko-bot
2026-09-10  2:47     ` Nautiyal, Ankit K
2026-09-08  6:22 ` [PATCH v5 07/12] drm/i915/dip_regs: Add register definitions for common SDP Transmission Line Ankit Nautiyal
2026-09-08  7:49   ` Kandpal, Suraj
2026-09-08  6:22 ` [PATCH v5 08/12] drm/i915/dip: Add HAS_COMMON_SDP_TL macro Ankit Nautiyal
2026-09-08  6:22 ` [PATCH v5 09/12] drm/i915/dip: Store SDP transmission lines in crtc_state Ankit Nautiyal
2026-09-08  7:50   ` Kandpal, Suraj
2026-09-08  6:22 ` Ankit Nautiyal [this message]
2026-09-08  7:12   ` [PATCH v5 10/12] drm/i915/dp: Introduce helpers to enable/disable CMN SDP Transmission line sashiko-bot
2026-09-10  2:48     ` Nautiyal, Ankit K
2026-09-08  6:22 ` [PATCH v5 11/12] drm/i915/dip: Enable Common " Ankit Nautiyal
2026-09-08  7:11   ` sashiko-bot
2026-09-10  4:49     ` Nautiyal, Ankit K
2026-09-08  8:10   ` Kandpal, Suraj
2026-09-10  4:54     ` Nautiyal, Ankit K
2026-09-08  6:22 ` [PATCH v5 12/12] drm/i915/display: Dump DIP Transmission lines Ankit Nautiyal
2026-09-08  8:03   ` Kandpal, Suraj
2026-09-08  6:57 ` ✗ CI.checkpatch: warning for Add support for Common SDP Transmission Line (rev5) Patchwork
2026-09-08  6:59 ` ✓ CI.KUnit: success " Patchwork
2026-09-08  7:47 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-08  8:57 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-08  9:52 ` ✗ i915.CI.BAT: " 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=20260908062224.2897987-11-ankit.k.nautiyal@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=arun.r.murthy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=suraj.kandpal@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 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.