drm/i915: take a power domain reference while checking the HDMI live status
authorImre Deak <imre.deak@intel.com>
Thu, 19 Nov 2015 18:55:01 +0000 (20:55 +0200)
committerImre Deak <imre.deak@intel.com>
Fri, 20 Nov 2015 09:48:57 +0000 (11:48 +0200)
There are platforms that don't need the full GMBUS power domain (BXT)
while others do (PCH, VLV/CHV). For optimizing this we would need to add
a new power domain, but it's not clear how much we would benefit given
the short time we hold the reference. So for now let's keep things
simple.

v2:
- fix commit message, PCH won't take any redundant power resource after
this change (Ville)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[fix commit message in v2 (Imre)]
Link: http://patchwork.freedesktop.org/patch/msgid/1447959301-1263-2-git-send-email-imre.deak@intel.com
drivers/gpu/drm/i915/intel_hdmi.c

index 17ced03f1b60a5fa8a5cd164bd0857c0e15de044..bdd462e7c69088088d3d855f9bb51a0b9d29b2eb 100644 (file)
@@ -1393,6 +1393,8 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
        DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
                      connector->base.id, connector->name);
 
+       intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS);
+
        while (!live_status && --retry) {
                live_status = intel_digital_port_connected(dev_priv,
                                hdmi_to_dig_port(intel_hdmi));
@@ -1412,6 +1414,8 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
        } else
                status = connector_status_disconnected;
 
+       intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
+
        return status;
 }