diff mbox series

[11/13] drm/i915/pps: add locked intel_pps_wait_power_cycle

Message ID 12b05c736546aa3368b0cd2564e574d677474cda.1608648128.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/dp: split out pps and aux | expand

Commit Message

Jani Nikula Dec. 22, 2020, 2:49 p.m. UTC
Prefer keeping the unlocked variants hidden if possible.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c  |  7 +------
 drivers/gpu/drm/i915/display/intel_pps.c | 13 ++++++++++++-
 drivers/gpu/drm/i915/display/intel_pps.h |  3 +--
 3 files changed, 14 insertions(+), 9 deletions(-)

Comments

Gupta, Anshuman Dec. 29, 2020, 7:59 a.m. UTC | #1
On 2020-12-22 at 20:19:51 +0530, Jani Nikula wrote:
> Prefer keeping the unlocked variants hidden if possible.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c  |  7 +------
>  drivers/gpu/drm/i915/display/intel_pps.c | 13 ++++++++++++-
>  drivers/gpu/drm/i915/display/intel_pps.h |  3 +--
>  3 files changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 65406d4ccdbe..bc3a447f5992 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -5833,13 +5833,8 @@ void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder)
>  void intel_dp_encoder_shutdown(struct intel_encoder *intel_encoder)
>  {
>  	struct intel_dp *intel_dp = enc_to_intel_dp(intel_encoder);
> -	intel_wakeref_t wakeref;
> -
> -	if (!intel_dp_is_edp(intel_dp))
> -		return;
>  
> -	with_intel_pps_lock(intel_dp, wakeref)
> -		wait_panel_power_cycle(intel_dp);
> +	intel_pps_wait_power_cycle(intel_dp);
>  }
>  
>  static enum pipe vlv_active_pipe(struct intel_dp *intel_dp)
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
> index ceb6de9e7aff..ceb74967f2b4 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.c
> +++ b/drivers/gpu/drm/i915/display/intel_pps.c
> @@ -503,7 +503,7 @@ static void wait_panel_off(struct intel_dp *intel_dp)
>  	wait_panel_status(intel_dp, IDLE_OFF_MASK, IDLE_OFF_VALUE);
>  }
>  
> -void wait_panel_power_cycle(struct intel_dp *intel_dp)
> +static void wait_panel_power_cycle(struct intel_dp *intel_dp)
>  {
>  	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
>  	ktime_t panel_power_on_time;
> @@ -525,6 +525,17 @@ void wait_panel_power_cycle(struct intel_dp *intel_dp)
>  	wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE);
>  }
>  
> +void intel_pps_wait_power_cycle(struct intel_dp *intel_dp)
> +{
> +	intel_wakeref_t wakeref;
> +
> +	if (!intel_dp_is_edp(intel_dp))
> +		return;
> +
> +	with_intel_pps_lock(intel_dp, wakeref)
> +		wait_panel_power_cycle(intel_dp);
> +}
> +
>  static void wait_backlight_on(struct intel_dp *intel_dp)
>  {
>  	wait_remaining_ms_from_jiffies(intel_dp->last_power_on,
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.h b/drivers/gpu/drm/i915/display/intel_pps.h
> index 451d5125b2b7..c8766b777501 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.h
> +++ b/drivers/gpu/drm/i915/display/intel_pps.h
> @@ -37,8 +37,7 @@ void intel_pps_on(struct intel_dp *intel_dp);
>  void intel_pps_off(struct intel_dp *intel_dp);
>  void intel_pps_vdd_off_sync(struct intel_dp *intel_dp);
>  bool intel_pps_have_power(struct intel_dp *intel_dp);
> -
> -void wait_panel_power_cycle(struct intel_dp *intel_dp);
> +void intel_pps_wait_power_cycle(struct intel_dp *intel_dp);
>  
>  void intel_pps_init(struct intel_dp *intel_dp);
>  void intel_pps_reinit(struct intel_dp *intel_dp);
> -- 
> 2.20.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 65406d4ccdbe..bc3a447f5992 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -5833,13 +5833,8 @@  void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder)
 void intel_dp_encoder_shutdown(struct intel_encoder *intel_encoder)
 {
 	struct intel_dp *intel_dp = enc_to_intel_dp(intel_encoder);
-	intel_wakeref_t wakeref;
-
-	if (!intel_dp_is_edp(intel_dp))
-		return;
 
-	with_intel_pps_lock(intel_dp, wakeref)
-		wait_panel_power_cycle(intel_dp);
+	intel_pps_wait_power_cycle(intel_dp);
 }
 
 static enum pipe vlv_active_pipe(struct intel_dp *intel_dp)
diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
index ceb6de9e7aff..ceb74967f2b4 100644
--- a/drivers/gpu/drm/i915/display/intel_pps.c
+++ b/drivers/gpu/drm/i915/display/intel_pps.c
@@ -503,7 +503,7 @@  static void wait_panel_off(struct intel_dp *intel_dp)
 	wait_panel_status(intel_dp, IDLE_OFF_MASK, IDLE_OFF_VALUE);
 }
 
-void wait_panel_power_cycle(struct intel_dp *intel_dp)
+static void wait_panel_power_cycle(struct intel_dp *intel_dp)
 {
 	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
 	ktime_t panel_power_on_time;
@@ -525,6 +525,17 @@  void wait_panel_power_cycle(struct intel_dp *intel_dp)
 	wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE);
 }
 
+void intel_pps_wait_power_cycle(struct intel_dp *intel_dp)
+{
+	intel_wakeref_t wakeref;
+
+	if (!intel_dp_is_edp(intel_dp))
+		return;
+
+	with_intel_pps_lock(intel_dp, wakeref)
+		wait_panel_power_cycle(intel_dp);
+}
+
 static void wait_backlight_on(struct intel_dp *intel_dp)
 {
 	wait_remaining_ms_from_jiffies(intel_dp->last_power_on,
diff --git a/drivers/gpu/drm/i915/display/intel_pps.h b/drivers/gpu/drm/i915/display/intel_pps.h
index 451d5125b2b7..c8766b777501 100644
--- a/drivers/gpu/drm/i915/display/intel_pps.h
+++ b/drivers/gpu/drm/i915/display/intel_pps.h
@@ -37,8 +37,7 @@  void intel_pps_on(struct intel_dp *intel_dp);
 void intel_pps_off(struct intel_dp *intel_dp);
 void intel_pps_vdd_off_sync(struct intel_dp *intel_dp);
 bool intel_pps_have_power(struct intel_dp *intel_dp);
-
-void wait_panel_power_cycle(struct intel_dp *intel_dp);
+void intel_pps_wait_power_cycle(struct intel_dp *intel_dp);
 
 void intel_pps_init(struct intel_dp *intel_dp);
 void intel_pps_reinit(struct intel_dp *intel_dp);