diff mbox series

[v2,2/4] drm/i915/dp: Disconnect eDP downclock mode from DRRS

Message ID 20180912225719.17574-2-manasi.d.navare@intel.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/4] drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode | expand

Commit Message

Navare, Manasi Sept. 12, 2018, 10:57 p.m. UTC
Downclock mode of the panel needs to be set independently
of DRRS so that the user can set the downclock mode on the panel
without enabling DRRS.
This patch sets the downclock mode in edp_init as opposed to
drrs_init to achieve this.

Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 29 ++++++++++-------------------
 1 file changed, 10 insertions(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index e4de5257cd87..30526c02b343 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -6371,44 +6371,30 @@  void intel_edp_drrs_flush(struct drm_i915_private *dev_priv,
  * This function is  called only once at driver load to initialize basic
  * DRRS stuff.
  *
- * Returns:
- * Downclock mode if panel supports it, else return NULL.
- * DRRS support is determined by the presence of downclock mode (apart
- * from VBT setting).
  */
-static struct drm_display_mode *
+static void
 intel_dp_drrs_init(struct intel_connector *connector,
 		   struct drm_display_mode *fixed_mode)
 {
 	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
-	struct drm_display_mode *downclock_mode = NULL;
 
 	INIT_DELAYED_WORK(&dev_priv->drrs.work, intel_edp_drrs_downclock_work);
 	mutex_init(&dev_priv->drrs.mutex);
 
 	if (INTEL_GEN(dev_priv) <= 6) {
 		DRM_DEBUG_KMS("DRRS supported for Gen7 and above\n");
-		return NULL;
+		return;
 	}
 
 	if (dev_priv->vbt.drrs_type != SEAMLESS_DRRS_SUPPORT) {
 		DRM_DEBUG_KMS("VBT doesn't support DRRS\n");
-		return NULL;
-	}
-
-	downclock_mode = intel_find_panel_downclock(dev_priv, fixed_mode,
-						    &connector->base);
-
-	if (!downclock_mode) {
-		DRM_DEBUG_KMS("Downclock mode is not found. DRRS not supported\n");
-		return NULL;
+		return;
 	}
 
 	dev_priv->drrs.type = dev_priv->vbt.drrs_type;
 
 	dev_priv->drrs.refresh_rate_type = DRRS_HIGH_RR;
 	DRM_DEBUG_KMS("seamless DRRS supported for eDP panel.\n");
-	return downclock_mode;
 }
 
 static bool intel_edp_init_connector(struct intel_dp *intel_dp,
@@ -6476,8 +6462,13 @@  static bool intel_edp_init_connector(struct intel_dp *intel_dp,
 	list_for_each_entry(scan, &connector->probed_modes, head) {
 		if ((scan->type & DRM_MODE_TYPE_PREFERRED)) {
 			fixed_mode = drm_mode_duplicate(dev, scan);
-			downclock_mode = intel_dp_drrs_init(
-						intel_connector, fixed_mode);
+			downclock_mode = intel_find_panel_downclock(dev_priv,
+								    fixed_mode,
+								    connector);
+			if (downclock_mode)
+				intel_dp_drrs_init(intel_connector, fixed_mode);
+			else
+				DRM_DEBUG_KMS("Downclock mode is not found. DRRS not supported\n");
 			break;
 		}
 	}