Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Suraj Kandpal <suraj.kandpal@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH] drm/i915/display: PCH display HPD IRQ is not detected with default filter value
Date: Fri, 14 Apr 2023 12:53:45 +0530	[thread overview]
Message-ID: <20230414072345.1041605-1-suraj.kandpal@intel.com> (raw)

On TGP, the RTC (always running) was reduced from 3MHz to 32KHz.
As a result of this change, when HPD active going low pulse or HPD IRQ
is presented and the refclk (19.2MHz) is not toggling already toggling,
there is a 60 to 90us synchronization delay which effectively reduces
the duration of the IRQ pulse to less than the programmed 500us filter
value and the hot plug interrupt is NOT registered.
Program 0xC7204 (PP_CONTROL) bit #0 to '1' to enable workaround and clear
to disable it.
Driver shall enable this WA when external display is connected and
remove WA when display is unplugged or before going into sleep to allow
CS entry.
Driver shall not enable WA when eDP is connected.
Wa_1508796671:adls

Cc: Arun Murthy <arun.r.murthy@intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c  | 19 +++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_pps.c |  1 +
 drivers/gpu/drm/i915/i915_drv.h          |  2 ++
 3 files changed, 22 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 8e16745275f6..f93895d99fd1 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -4689,6 +4689,7 @@ intel_dp_detect(struct drm_connector *connector,
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
 	struct intel_encoder *encoder = &dig_port->base;
 	enum drm_connector_status status;
+	int32_t pp;
 
 	drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s]\n",
 		    connector->base.id, connector->name);
@@ -4792,6 +4793,22 @@ intel_dp_detect(struct drm_connector *connector,
 						 status,
 						 intel_dp->dpcd,
 						 intel_dp->downstream_ports);
+
+	/*
+	 * WA_150879661:adls
+	 * Driver shall enable this WA when external display is connected
+	 * and remove WA when display is unplugged
+	 */
+	if (IS_ALDERLAKE_S(dev_priv)) {
+		if (status == connector_status_connected &&
+		    !dev_priv->edp_present)
+			pp = PANEL_POWER_ON;
+		else if (status == connector_status_disconnected)
+			pp = 0;
+
+		intel_de_rmw(dev_priv, _MMIO(PCH_PPS_BASE + 4), 1, pp);
+	}
+
 	return status;
 }
 
@@ -5489,6 +5506,8 @@ intel_dp_init_connector(struct intel_digital_port *dig_port,
 	if (!intel_edp_init_connector(intel_dp, intel_connector)) {
 		intel_dp_aux_fini(intel_dp);
 		goto fail;
+	} else {
+		dev_priv->edp_present = true;
 	}
 
 	intel_dp_set_source_rates(intel_dp);
diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
index 24b5b12f7732..21538338af3d 100644
--- a/drivers/gpu/drm/i915/display/intel_pps.c
+++ b/drivers/gpu/drm/i915/display/intel_pps.c
@@ -1726,4 +1726,5 @@ void assert_pps_unlocked(struct drm_i915_private *dev_priv, enum pipe pipe)
 	I915_STATE_WARN(panel_pipe == pipe && locked,
 			"panel assertion failure, pipe %c regs locked\n",
 			pipe_name(pipe));
+
 }
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 6254aa977398..ebe16aee0ca8 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -352,6 +352,8 @@ struct drm_i915_private {
 	/* The TTM device structure. */
 	struct ttm_device bdev;
 
+	bool edp_present;
+
 	I915_SELFTEST_DECLARE(struct i915_selftest_stash selftest;)
 
 	/*
-- 
2.25.1


             reply	other threads:[~2023-04-14  7:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14  7:23 Suraj Kandpal [this message]
2023-04-14  8:06 ` [Intel-gfx] [PATCH] drm/i915/display: PCH display HPD IRQ is not detected with default filter value Ville Syrjälä
2023-04-14  8:12   ` Kandpal, Suraj
2023-04-14  8:19 ` Jani Nikula
2023-04-14  8:47   ` Kandpal, Suraj
2023-04-14  8:58     ` Jani Nikula
2023-04-14  9:04       ` Kandpal, Suraj
2023-04-14  8:37 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
2023-04-14  9:35 ` [Intel-gfx] [PATCH] " kernel test robot
2023-04-14 10:06 ` kernel test robot

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=20230414072345.1041605-1-suraj.kandpal@intel.com \
    --to=suraj.kandpal@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox