Commit 17be4942 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Polish intel_get_lvds_encoder()

Pass dev_priv to intel_get_lvds_encoder() and polish the
implementation a bit.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190318202653.15217-2-ville.syrjala@linux.intel.comReviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 27b680f9
...@@ -7073,7 +7073,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, ...@@ -7073,7 +7073,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
* eDP and LVDS bail out early in this case to prevent interfering * eDP and LVDS bail out early in this case to prevent interfering
* with an already powered-on LVDS power sequencer. * with an already powered-on LVDS power sequencer.
*/ */
if (intel_get_lvds_encoder(&dev_priv->drm)) { if (intel_get_lvds_encoder(dev_priv)) {
WARN_ON(!(HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv))); WARN_ON(!(HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv)));
DRM_INFO("LVDS was detected, not registering eDP\n"); DRM_INFO("LVDS was detected, not registering eDP\n");
......
...@@ -2116,7 +2116,7 @@ void intel_read_infoframe(struct intel_encoder *encoder, ...@@ -2116,7 +2116,7 @@ void intel_read_infoframe(struct intel_encoder *encoder,
bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv, bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv,
i915_reg_t lvds_reg, enum pipe *pipe); i915_reg_t lvds_reg, enum pipe *pipe);
void intel_lvds_init(struct drm_i915_private *dev_priv); void intel_lvds_init(struct drm_i915_private *dev_priv);
struct intel_encoder *intel_get_lvds_encoder(struct drm_device *dev); struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *dev_priv);
bool intel_is_dual_link_lvds(struct drm_device *dev); bool intel_is_dual_link_lvds(struct drm_device *dev);
/* intel_overlay.c */ /* intel_overlay.c */
......
...@@ -742,20 +742,21 @@ static const struct dmi_system_id intel_dual_link_lvds[] = { ...@@ -742,20 +742,21 @@ static const struct dmi_system_id intel_dual_link_lvds[] = {
{ } /* terminating entry */ { } /* terminating entry */
}; };
struct intel_encoder *intel_get_lvds_encoder(struct drm_device *dev) struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *dev_priv)
{ {
struct intel_encoder *intel_encoder; struct intel_encoder *encoder;
for_each_intel_encoder(dev, intel_encoder) for_each_intel_encoder(&dev_priv->drm, encoder) {
if (intel_encoder->type == INTEL_OUTPUT_LVDS) if (encoder->type == INTEL_OUTPUT_LVDS)
return intel_encoder; return encoder;
}
return NULL; return NULL;
} }
bool intel_is_dual_link_lvds(struct drm_device *dev) bool intel_is_dual_link_lvds(struct drm_device *dev)
{ {
struct intel_encoder *encoder = intel_get_lvds_encoder(dev); struct intel_encoder *encoder = intel_get_lvds_encoder(to_i915(dev));
return encoder && to_lvds_encoder(&encoder->base)->is_dual_link; return encoder && to_lvds_encoder(&encoder->base)->is_dual_link;
} }
......
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