summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_dp.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2022-03-31 14:28:12 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2022-03-31 14:28:12 +0300
commit1c05183a3709fbef6aea66cd50002e718aec2e95 (patch)
treed152521733d1c17695ab23f2850298dd9a0178f2 /drivers/gpu/drm/i915/display/intel_dp.c
parentaeb9f0a4a3dc001b2ce382820d26fdf805cf0f9b (diff)
drm/i915: Extract intel_edp_has_drrs()
Pull all the eDP specific platform/port checks out from intel_drrs_init() into intel_edp_has_drrs(). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_dp.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_dp.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 56c36c9ef173..2c23ec0a880a 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -4976,6 +4976,39 @@ intel_edp_add_properties(struct intel_dp *intel_dp)
fixed_mode->vdisplay);
}
+static bool
+intel_edp_has_drrs(struct intel_dp *intel_dp)
+{
+ struct intel_connector *connector = intel_dp->attached_connector;
+ struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
+ struct drm_i915_private *i915 = to_i915(connector->base.dev);
+
+ if (DISPLAY_VER(i915) < 5) {
+ drm_dbg_kms(&i915->drm,
+ "[CONNECTOR:%d:%s] DRRS not supported on platform\n",
+ connector->base.base.id, connector->base.name);
+ return false;
+ }
+
+ if ((DISPLAY_VER(i915) < 8 && !HAS_GMCH(i915)) &&
+ encoder->port != PORT_A) {
+ drm_dbg_kms(&i915->drm,
+ "[CONNECTOR:%d:%s] DRRS not supported on [ENCODER:%d:%s]\n",
+ connector->base.base.id, connector->base.name,
+ encoder->base.base.id, encoder->base.name);
+ return false;
+ }
+
+ if (i915->vbt.drrs_type == DRRS_TYPE_NONE) {
+ drm_dbg_kms(&i915->drm,
+ "[CONNECTOR:%d:%s] DRRS not supported according to VBT\n",
+ connector->base.base.id, connector->base.name);
+ return false;
+ }
+
+ return true;
+}
+
static bool intel_edp_init_connector(struct intel_dp *intel_dp,
struct intel_connector *intel_connector)
{
@@ -5041,7 +5074,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
intel_connector->edid = edid;
fixed_mode = intel_panel_edid_fixed_mode(intel_connector);
- if (fixed_mode)
+ if (fixed_mode && intel_edp_has_drrs(intel_dp))
downclock_mode = intel_drrs_init(intel_connector, fixed_mode);
/* MSO requires information from the EDID */