diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-03-21 14:24:41 +0100 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-03-22 17:41:39 +0100 |
commit | 0dc927eb9496ca5dfcde476f00c23b2283f8a5e2 (patch) | |
tree | e15be17a749af6fe3c4e42d061458968e8db84c3 /drivers/gpu/drm/i915/intel_panel.c | |
parent | drm/i915: Really calculate the cursor ddb based on the highest enabled wm level (diff) | |
download | linux-0dc927eb9496ca5dfcde476f00c23b2283f8a5e2.tar.xz linux-0dc927eb9496ca5dfcde476f00c23b2283f8a5e2.zip |
drm/i915: Refactor EDID fixed mode search
Both LVDS and eDP have the same code to look up the preferred mode
from the connector probed_modes list. Move the code to a common
location.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190321132446.22394-1-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_panel.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_panel.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index edd5540639b0..f42137512010 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -99,6 +99,33 @@ intel_find_panel_downclock(struct drm_i915_private *dev_priv, return NULL; } +struct drm_display_mode * +intel_panel_edid_fixed_mode(struct intel_connector *connector) +{ + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + const struct drm_display_mode *scan; + + /* prefer fixed mode from EDID if available */ + list_for_each_entry(scan, &connector->base.probed_modes, head) { + struct drm_display_mode *fixed_mode; + + if ((scan->type & DRM_MODE_TYPE_PREFERRED) == 0) + continue; + + fixed_mode = drm_mode_duplicate(&dev_priv->drm, scan); + if (!fixed_mode) + return NULL; + + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] using preferred mode from EDID: ", + connector->base.base.id, connector->base.name); + drm_mode_debug_printmodeline(fixed_mode); + + return fixed_mode; + } + + return NULL; +} + /* adjusted_mode has been preset to be the panel's fixed mode */ void intel_pch_panel_fitting(struct intel_crtc *intel_crtc, |