diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2022-03-23 21:29:33 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2022-03-29 16:35:33 +0300 |
commit | 5248cc781d2f4a087cf20ee3c806e2945af03725 (patch) | |
tree | a10d8e80805c2169773b975e5fb09988d65de23c /drivers/gpu/drm/i915/display/intel_panel.c | |
parent | 14daee248f0102359898e21706f570c274c11948 (diff) | |
download | linux-5248cc781d2f4a087cf20ee3c806e2945af03725.tar.xz |
drm/i915: Extract intel_panel_encoder_fixed_mode()
Apart from the EDID and VBT based mechanism we also sometimes
use the encoder's current mode as the panel fixed mode. We
currently have the same code for that duplicated in two places.
Let's unify.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-8-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_panel.c')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_panel.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 7f59db8b9ede..882e424973d4 100644 --- a/drivers/gpu/drm/i915/display/intel_panel.c +++ b/drivers/gpu/drm/i915/display/intel_panel.c @@ -292,6 +292,26 @@ intel_panel_vbt_sdvo_fixed_mode(struct intel_connector *connector) return fixed_mode; } +struct drm_display_mode * +intel_panel_encoder_fixed_mode(struct intel_connector *connector, + struct intel_encoder *encoder) +{ + struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct drm_display_mode *fixed_mode; + + fixed_mode = intel_encoder_current_mode(encoder); + if (!fixed_mode) + return NULL; + + drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] using current (BIOS) mode: " DRM_MODE_FMT "\n", + connector->base.base.id, connector->base.name, + DRM_MODE_ARG(fixed_mode)); + + fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; + + return fixed_mode; +} + /* adjusted_mode has been preset to be the panel's fixed mode */ static int pch_panel_fitting(struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) |