drm/i915: Polish intel_get_lvds_encoder()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 18 Mar 2019 20:26:52 +0000 (22:26 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 19 Mar 2019 14:36:54 +0000 (16:36 +0200)
Pass dev_priv to intel_get_lvds_encoder() and polish the
implementation a bit.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190318202653.15217-2-ville.syrjala@linux.intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_lvds.c

index 35962a84b9101737b1242afb4b3b95a39f30d1a6..7c043e8f6298f3a4f994ae39d626601558fcb6c7 100644 (file)
@@ -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
         * 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)));
                DRM_INFO("LVDS was detected, not registering eDP\n");
 
index 484754c06ed435397915aa5532b4e3a2ef5b0147..f58b4ce40452bced452cf7f225ae26c0945edd68 100644 (file)
@@ -2116,7 +2116,7 @@ void intel_read_infoframe(struct intel_encoder *encoder,
 bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv,
                             i915_reg_t lvds_reg, enum pipe *pipe);
 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);
 
 /* intel_overlay.c */
index 6e3cf1c4ad007728f18d77db0f9662abb7443cb5..306bc321fdaa16f4561ed0ad1a4d28b9f29db355 100644 (file)
@@ -742,20 +742,21 @@ static const struct dmi_system_id intel_dual_link_lvds[] = {
        { }     /* 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)
-               if (intel_encoder->type == INTEL_OUTPUT_LVDS)
-                       return intel_encoder;
+       for_each_intel_encoder(&dev_priv->drm, encoder) {
+               if (encoder->type == INTEL_OUTPUT_LVDS)
+                       return encoder;
+       }
 
        return NULL;
 }
 
 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;
 }