drm/i915: take a power domain ref only when needed during HDMI detect
authorImre Deak <imre.deak@intel.com>
Thu, 19 Nov 2015 18:55:00 +0000 (20:55 +0200)
committerImre Deak <imre.deak@intel.com>
Fri, 20 Nov 2015 09:48:57 +0000 (11:48 +0200)
Suggested by Ville.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1447959301-1263-1-git-send-email-imre.deak@intel.com
drivers/gpu/drm/i915/intel_hdmi.c

index fd86cef35a2c2b12660a0ffa347402a4c1ce23cf..17ced03f1b60a5fa8a5cd164bd0857c0e15de044 100644 (file)
@@ -1351,14 +1351,15 @@ intel_hdmi_set_edid(struct drm_connector *connector, bool force)
        struct edid *edid = NULL;
        bool connected = false;
 
-       intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS);
+       if (force) {
+               intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS);
 
-       if (force)
                edid = drm_get_edid(connector,
                                    intel_gmbus_get_adapter(dev_priv,
                                    intel_hdmi->ddc_bus));
 
-       intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
+               intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
+       }
 
        to_intel_connector(connector)->detect_edid = edid;
        if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) {