Commit f6d39f56 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Use intel_panel_preferred_fixed_mode() more

Use intel_panel_preferred_fixed_mode() for all the orientation
quirk setup and compute_is_dual_link_lvds()). All of these
happen after intel_panel_init() so the panel fixed_mode list
is already in place.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-5-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent e9ebf135
...@@ -1965,9 +1965,10 @@ static void icl_dphy_param_init(struct intel_dsi *intel_dsi) ...@@ -1965,9 +1965,10 @@ static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
intel_dsi_log_params(intel_dsi); intel_dsi_log_params(intel_dsi);
} }
static void icl_dsi_add_properties(struct intel_connector *connector, static void icl_dsi_add_properties(struct intel_connector *connector)
const struct drm_display_mode *fixed_mode)
{ {
const struct drm_display_mode *fixed_mode =
intel_panel_preferred_fixed_mode(connector);
u32 allowed_scalers; u32 allowed_scalers;
allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) |
...@@ -2085,7 +2086,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv) ...@@ -2085,7 +2086,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
icl_dphy_param_init(intel_dsi); icl_dphy_param_init(intel_dsi);
icl_dsi_add_properties(intel_connector, fixed_mode); icl_dsi_add_properties(intel_connector);
return; return;
err: err:
......
...@@ -4955,11 +4955,12 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect ...@@ -4955,11 +4955,12 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect
} }
static void static void
intel_edp_add_properties(struct intel_dp *intel_dp, intel_edp_add_properties(struct intel_dp *intel_dp)
const struct drm_display_mode *fixed_mode)
{ {
struct intel_connector *connector = intel_dp->attached_connector; struct intel_connector *connector = intel_dp->attached_connector;
struct drm_i915_private *i915 = to_i915(connector->base.dev); struct drm_i915_private *i915 = to_i915(connector->base.dev);
const struct drm_display_mode *fixed_mode =
intel_panel_preferred_fixed_mode(connector);
if (!fixed_mode) if (!fixed_mode)
return; return;
...@@ -5074,7 +5075,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, ...@@ -5074,7 +5075,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
intel_connector->panel.backlight.power = intel_pps_backlight_power; intel_connector->panel.backlight.power = intel_pps_backlight_power;
intel_backlight_setup(intel_connector, pipe); intel_backlight_setup(intel_connector, pipe);
intel_edp_add_properties(intel_dp, fixed_mode); intel_edp_add_properties(intel_dp);
return true; return true;
......
...@@ -778,12 +778,13 @@ bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv) ...@@ -778,12 +778,13 @@ bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv)
return encoder && to_lvds_encoder(&encoder->base)->is_dual_link; return encoder && to_lvds_encoder(&encoder->base)->is_dual_link;
} }
static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder, static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
const struct drm_display_mode *fixed_mode)
{ {
struct drm_device *dev = lvds_encoder->base.base.dev; struct drm_i915_private *dev_priv = to_i915(lvds_encoder->base.base.dev);
struct intel_connector *connector = lvds_encoder->attached_connector;
const struct drm_display_mode *fixed_mode =
intel_panel_preferred_fixed_mode(connector);
unsigned int val; unsigned int val;
struct drm_i915_private *dev_priv = to_i915(dev);
/* use the module option value if specified */ /* use the module option value if specified */
if (dev_priv->params.lvds_channel_mode > 0) if (dev_priv->params.lvds_channel_mode > 0)
...@@ -999,7 +1000,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) ...@@ -999,7 +1000,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
intel_panel_init(intel_connector, fixed_mode, downclock_mode); intel_panel_init(intel_connector, fixed_mode, downclock_mode);
intel_backlight_setup(intel_connector, INVALID_PIPE); intel_backlight_setup(intel_connector, INVALID_PIPE);
lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder, fixed_mode); lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder);
drm_dbg_kms(&dev_priv->drm, "detected %s-link lvds configuration\n", drm_dbg_kms(&dev_priv->drm, "detected %s-link lvds configuration\n",
lvds_encoder->is_dual_link ? "dual" : "single"); lvds_encoder->is_dual_link ? "dual" : "single");
......
...@@ -1657,10 +1657,11 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = { ...@@ -1657,10 +1657,11 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = {
.atomic_duplicate_state = intel_digital_connector_duplicate_state, .atomic_duplicate_state = intel_digital_connector_duplicate_state,
}; };
static void vlv_dsi_add_properties(struct intel_connector *connector, static void vlv_dsi_add_properties(struct intel_connector *connector)
const struct drm_display_mode *fixed_mode)
{ {
struct drm_i915_private *dev_priv = to_i915(connector->base.dev); struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
const struct drm_display_mode *fixed_mode =
intel_panel_preferred_fixed_mode(connector);
u32 allowed_scalers; u32 allowed_scalers;
allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | BIT(DRM_MODE_SCALE_FULLSCREEN); allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | BIT(DRM_MODE_SCALE_FULLSCREEN);
...@@ -1990,7 +1991,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) ...@@ -1990,7 +1991,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
intel_panel_init(intel_connector, fixed_mode, NULL); intel_panel_init(intel_connector, fixed_mode, NULL);
intel_backlight_setup(intel_connector, INVALID_PIPE); intel_backlight_setup(intel_connector, INVALID_PIPE);
vlv_dsi_add_properties(intel_connector, fixed_mode); vlv_dsi_add_properties(intel_connector);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment