All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khaled Almahallawy <khaled.almahallawy@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH] drm/i915: Add enable_lttpr param to select between different LTTPR modes
Date: Wed,  9 Jun 2021 16:11:33 -0700	[thread overview]
Message-ID: <20210609231133.1471989-1-khaled.almahallawy@intel.com> (raw)

As LTTPR usage increases in newer platforms, and because not all LTTPRs (located
on board, Docking, active cables, or Monitors) are created equal. We face
challenges in debugging issues because of it. So we need an easy way to switch
between different LTTPR modes (at least non-LTTPR and non-transparent modes) to
debug. This patch allows us to do that by just setting driver parameters instead
of sending patches to ODMs to switch between LTTPR modes.

Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Khaled Almahallawy <khaled.almahallawy@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp_link_training.c | 7 +++++++
 drivers/gpu/drm/i915/i915_params.c                    | 4 ++++
 drivers/gpu/drm/i915/i915_params.h                    | 1 +
 3 files changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
index 08bceae40aa8..c29c1e005c6f 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -92,6 +92,9 @@ static bool intel_dp_read_lttpr_common_caps(struct intel_dp *intel_dp)
 	if (intel_dp_is_edp(intel_dp))
 		return false;
 
+	if (!i915->params.enable_lttpr)
+		return 0;
+
 	/*
 	 * Detecting LTTPRs must be avoided on platforms with an AUX timeout
 	 * period < 3.2ms. (see DP Standard v2.0, 2.11.2, 3.6.6.1).
@@ -132,6 +135,7 @@ static int intel_dp_init_lttpr(struct intel_dp *intel_dp)
 {
 	int lttpr_count;
 	int i;
+	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
 
 	if (!intel_dp_read_lttpr_common_caps(intel_dp))
 		return 0;
@@ -152,6 +156,9 @@ static int intel_dp_init_lttpr(struct intel_dp *intel_dp)
 	 */
 	intel_dp_set_lttpr_transparent_mode(intel_dp, true);
 
+	if (i915->params.enable_lttpr > 0)
+		return 0;
+
 	/*
 	 * In case of unsupported number of LTTPRs or failing to switch to
 	 * non-transparent mode fall-back to transparent link training mode,
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index e07f4cfea63a..67d030774ced 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -178,6 +178,10 @@ i915_param_named_unsafe(dmc_firmware_path, charp, 0400,
 i915_param_named_unsafe(enable_dp_mst, bool, 0400,
 	"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
 
+i915_param_named_unsafe(enable_lttpr, int, 0400,
+	"Enable LTTPR "
+	"(-1= non-transparent mode [default], 0=Non-LTTPR, 1=transparent-mode)");
+
 #if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
 i915_param_named_unsafe(inject_probe_failure, uint, 0400,
 	"Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)");
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index f27eceb82c0f..40f15a6db153 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -61,6 +61,7 @@ struct drm_printer;
 	param(int, invert_brightness, 0, 0600) \
 	param(int, enable_guc, -1, 0400) \
 	param(int, guc_log_level, -1, 0400) \
+	param(int, enable_lttpr, -1, 0600) \
 	param(char *, guc_firmware_path, NULL, 0400) \
 	param(char *, huc_firmware_path, NULL, 0400) \
 	param(char *, dmc_firmware_path, NULL, 0400) \
-- 
2.25.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2021-06-09 23:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 23:11 Khaled Almahallawy [this message]
2021-06-09 23:34 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add enable_lttpr param to select between different LTTPR modes Patchwork
2021-06-10  0:03 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-06-10  0:03 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
2021-06-10  2:19 ` [Intel-gfx] ✓ Fi.CI.IGT: success " 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=20210609231133.1471989-1-khaled.almahallawy@intel.com \
    --to=khaled.almahallawy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.