Commit 71906550 authored by Imre Deak's avatar Imre Deak

drm/i915: Track power reference taken for eDP VDD

Add wakeref tracking for the eDP encoders' AUX display power domain
references taken while the panel's VDD is enabled.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20201130212200.2811939-7-imre.deak@intel.com
parent 162e68e1
...@@ -1384,6 +1384,7 @@ struct intel_dp { ...@@ -1384,6 +1384,7 @@ struct intel_dp {
unsigned long last_power_on; unsigned long last_power_on;
unsigned long last_backlight_off; unsigned long last_backlight_off;
ktime_t panel_power_off_time; ktime_t panel_power_off_time;
intel_wakeref_t vdd_wakeref;
/* /*
* Pipe whose power sequencer is currently locked into * Pipe whose power sequencer is currently locked into
......
...@@ -3094,8 +3094,9 @@ static bool edp_panel_vdd_on(struct intel_dp *intel_dp) ...@@ -3094,8 +3094,9 @@ static bool edp_panel_vdd_on(struct intel_dp *intel_dp)
if (edp_have_panel_vdd(intel_dp)) if (edp_have_panel_vdd(intel_dp))
return need_to_disable; return need_to_disable;
intel_display_power_get(dev_priv, drm_WARN_ON(&dev_priv->drm, intel_dp->vdd_wakeref);
intel_aux_power_domain(dig_port)); intel_dp->vdd_wakeref = intel_display_power_get(dev_priv,
intel_aux_power_domain(dig_port));
drm_dbg_kms(&dev_priv->drm, "Turning [ENCODER:%d:%s] VDD on\n", drm_dbg_kms(&dev_priv->drm, "Turning [ENCODER:%d:%s] VDD on\n",
dig_port->base.base.base.id, dig_port->base.base.base.id,
...@@ -3188,8 +3189,9 @@ static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp) ...@@ -3188,8 +3189,9 @@ static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp)
if ((pp & PANEL_POWER_ON) == 0) if ((pp & PANEL_POWER_ON) == 0)
intel_dp->panel_power_off_time = ktime_get_boottime(); intel_dp->panel_power_off_time = ktime_get_boottime();
intel_display_power_put_unchecked(dev_priv, intel_display_power_put(dev_priv,
intel_aux_power_domain(dig_port)); intel_aux_power_domain(dig_port),
fetch_and_zero(&intel_dp->vdd_wakeref));
} }
static void edp_panel_vdd_work(struct work_struct *__work) static void edp_panel_vdd_work(struct work_struct *__work)
...@@ -3341,7 +3343,9 @@ static void edp_panel_off(struct intel_dp *intel_dp) ...@@ -3341,7 +3343,9 @@ static void edp_panel_off(struct intel_dp *intel_dp)
intel_dp->panel_power_off_time = ktime_get_boottime(); intel_dp->panel_power_off_time = ktime_get_boottime();
/* We got a reference when we enabled the VDD. */ /* We got a reference when we enabled the VDD. */
intel_display_power_put_unchecked(dev_priv, intel_aux_power_domain(dig_port)); intel_display_power_put(dev_priv,
intel_aux_power_domain(dig_port),
fetch_and_zero(&intel_dp->vdd_wakeref));
} }
void intel_edp_panel_off(struct intel_dp *intel_dp) void intel_edp_panel_off(struct intel_dp *intel_dp)
...@@ -6894,7 +6898,9 @@ static void intel_edp_panel_vdd_sanitize(struct intel_dp *intel_dp) ...@@ -6894,7 +6898,9 @@ static void intel_edp_panel_vdd_sanitize(struct intel_dp *intel_dp)
*/ */
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"VDD left on by BIOS, adjusting state tracking\n"); "VDD left on by BIOS, adjusting state tracking\n");
intel_display_power_get(dev_priv, intel_aux_power_domain(dig_port)); drm_WARN_ON(&dev_priv->drm, intel_dp->vdd_wakeref);
intel_dp->vdd_wakeref = intel_display_power_get(dev_priv,
intel_aux_power_domain(dig_port));
edp_panel_vdd_schedule_off(intel_dp); edp_panel_vdd_schedule_off(intel_dp);
} }
......
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