diff mbox

[1/2,SRU,F] UBUNTU: SAUCE: drm/i915/psr: allow overriding PSR disable param by quirk

Message ID 20200929040852.3852307-2-vicamo.yang@canonical.com
State New
Headers show

Commit Message

You-Sheng Yang Sept. 29, 2020, 4:08 a.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1897501

HP ZBook Studio G7 equips an INX FHD N156HCG-GQ1 panel that renders
corrupted screen when PSR is disabled. This patch allows overriding
the default disabled i915_modparams.enable_psr since LP: #1849947 to
use chip default when a EDID match is on.

Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
---
 drivers/gpu/drm/i915/display/intel_psr.c | 8 ++++++++
 include/drm/drm_dp_helper.h              | 8 ++++++++
 2 files changed, 16 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index e32adbbf4ee4..c0f397c8e1b7 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1219,6 +1219,14 @@  void intel_psr_init(struct drm_i915_private *dev_priv)
 	if (!dev_priv->psr.sink_support)
 		return;
 
+	/*
+	 * PSR was disabled by module parameters but the underlying panel is
+	 * depending on it, so use per-chip default to probe that automatically.
+	 */
+	if ((dev_priv->psr.dp->edid_quirks & BIT(DP_QUIRK_FORCE_PSR_ENABLE)) &&
+	    i915_modparams.enable_psr == 0)
+		i915_modparams.enable_psr = -1;
+
 	if (i915_modparams.enable_psr == -1)
 		if (INTEL_GEN(dev_priv) < 9 || !dev_priv->vbt.psr.enable)
 			i915_modparams.enable_psr = 0;
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 5bcb3f7d5d8e..79633ebe953f 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1447,6 +1447,14 @@  enum drm_dp_quirk {
 	 * capabilities advertised.
 	 */
 	DP_QUIRK_FORCE_DPCD_BACKLIGHT,
+	/**
+	 * @DP_QUIRK_FORCE_PSR_ENABLE
+	 *
+	 * PSR was disabled by default in Ubuntu 5.0 kernels and on, but some
+	 * platforms might be depending on them. If so, use per-chip default to
+	 * probe that automatically.
+	 */
+	DP_QUIRK_FORCE_PSR_ENABLE,
 };
 
 /**