diff mbox series

[v4] drm/i915/pps: improve eDP power on flow

Message ID 20221114062155.18770-1-shawn.c.lee@intel.com (mailing list archive)
State New, archived
Headers show
Series [v4] drm/i915/pps: improve eDP power on flow | expand

Commit Message

Lee, Shawn C Nov. 14, 2022, 6:21 a.m. UTC
After i915 dirver initialized, a panel power off cycle delay
always append before turn eDP on. If eDP display did not
power on before. With this change, power off duration might
longer than power cycle delay. So driver can save power cycle
delay to speed up driver initialization time.

v2: fix commit messages
v3: refine panel_power_off_time default value and modify
    commit messages
v4: add eDP power off cycle delay at the path to unload i915 module

Cc: Shankar Uma <uma.shankar@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
---
 drivers/gpu/drm/i915/display/intel_pps.c | 2 +-
 drivers/gpu/drm/i915/i915_driver.c       | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Jani Nikula Nov. 16, 2022, 3:44 p.m. UTC | #1
On Mon, 14 Nov 2022, Lee Shawn C <shawn.c.lee@intel.com> wrote:
> After i915 dirver initialized, a panel power off cycle delay
> always append before turn eDP on. If eDP display did not
> power on before. With this change, power off duration might
> longer than power cycle delay. So driver can save power cycle
> delay to speed up driver initialization time.
>
> v2: fix commit messages
> v3: refine panel_power_off_time default value and modify
>     commit messages
> v4: add eDP power off cycle delay at the path to unload i915 module
>
> Cc: Shankar Uma <uma.shankar@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_pps.c | 2 +-
>  drivers/gpu/drm/i915/i915_driver.c       | 4 ++++
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
> index 81ee7f3aadf6..ab4118b38120 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.c
> +++ b/drivers/gpu/drm/i915/display/intel_pps.c
> @@ -1100,7 +1100,7 @@ bool intel_pps_have_panel_power_or_vdd(struct intel_dp *intel_dp)
>  
>  static void pps_init_timestamps(struct intel_dp *intel_dp)
>  {
> -	intel_dp->pps.panel_power_off_time = ktime_get_boottime();
> +	intel_dp->pps.panel_power_off_time = 0;
>  	intel_dp->pps.last_power_on = jiffies;
>  	intel_dp->pps.last_backlight_off = jiffies;
>  }
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index c3d43f9b1e45..0e3cbd129055 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -107,6 +107,8 @@ static const char irst_name[] = "INT3392";
>  
>  static const struct drm_driver i915_drm_driver;
>  
> +static void intel_shutdown_encoders(struct drm_i915_private *dev_priv);
> +
>  static void i915_release_bridge_dev(struct drm_device *dev,
>  				    void *bridge)
>  {
> @@ -796,6 +798,8 @@ static void i915_driver_unregister(struct drm_i915_private *dev_priv)
>  
>  	intel_display_driver_unregister(dev_priv);
>  
> +	intel_shutdown_encoders(dev_priv);
> +

Per Ville's comments on IRC, this is still too early. See [1] for
another approach.

BR,
Jani.


[1] https://patchwork.freedesktop.org/patch/msgid/20221116150657.1347504-1-jani.nikula@intel.com


>  	for_each_gt(gt, dev_priv, i)
>  		intel_gt_driver_unregister(gt);
Lee, Shawn C Nov. 16, 2022, 3:57 p.m. UTC | #2
On Wednesday, November 16, 2022 11:45 PM, Jani Nikula <jani.nikula@linux.intel.com> wrote:
>On Mon, 14 Nov 2022, Lee Shawn C <shawn.c.lee@intel.com> wrote:
>> After i915 dirver initialized, a panel power off cycle delay always 
>> append before turn eDP on. If eDP display did not power on before. 
>> With this change, power off duration might longer than power cycle 
>> delay. So driver can save power cycle delay to speed up driver 
>> initialization time.
>>
>> v2: fix commit messages
>> v3: refine panel_power_off_time default value and modify
>>     commit messages
>> v4: add eDP power off cycle delay at the path to unload i915 module
>>
>> Cc: Shankar Uma <uma.shankar@intel.com>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_pps.c | 2 +-
>>  drivers/gpu/drm/i915/i915_driver.c       | 4 ++++
>>  2 files changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_pps.c 
>> b/drivers/gpu/drm/i915/display/intel_pps.c
>> index 81ee7f3aadf6..ab4118b38120 100644
>> --- a/drivers/gpu/drm/i915/display/intel_pps.c
>> +++ b/drivers/gpu/drm/i915/display/intel_pps.c
>> @@ -1100,7 +1100,7 @@ bool intel_pps_have_panel_power_or_vdd(struct 
>> intel_dp *intel_dp)
>>  
>>  static void pps_init_timestamps(struct intel_dp *intel_dp)  {
>> -	intel_dp->pps.panel_power_off_time = ktime_get_boottime();
>> +	intel_dp->pps.panel_power_off_time = 0;
>>  	intel_dp->pps.last_power_on = jiffies;
>>  	intel_dp->pps.last_backlight_off = jiffies;  } diff --git 
>> a/drivers/gpu/drm/i915/i915_driver.c 
>> b/drivers/gpu/drm/i915/i915_driver.c
>> index c3d43f9b1e45..0e3cbd129055 100644
>> --- a/drivers/gpu/drm/i915/i915_driver.c
>> +++ b/drivers/gpu/drm/i915/i915_driver.c
>> @@ -107,6 +107,8 @@ static const char irst_name[] = "INT3392";
>>  
>>  static const struct drm_driver i915_drm_driver;
>>  
>> +static void intel_shutdown_encoders(struct drm_i915_private 
>> +*dev_priv);
>> +
>>  static void i915_release_bridge_dev(struct drm_device *dev,
>>  				    void *bridge)
>>  {
>> @@ -796,6 +798,8 @@ static void i915_driver_unregister(struct 
>> drm_i915_private *dev_priv)
>>  
>>  	intel_display_driver_unregister(dev_priv);
>>  
>> +	intel_shutdown_encoders(dev_priv);
>> +
>
>Per Ville's comments on IRC, this is still too early. See [1] for another approach.
>
>BR,
>Jani.
>

Thank you! I've tested this patch and it works properly. Detail kernel log is attached on [2].
Please help to review and merge that patch ASAP. 

Best regards,
Shawn

>
>[1] https://patchwork.freedesktop.org/patch/msgid/20221116150657.1347504-1-jani.nikula@intel.com

[2] https://gitlab.freedesktop.org/drm/intel/-/issues/7417#note_1643009

>
>
>>  	for_each_gt(gt, dev_priv, i)
>>  		intel_gt_driver_unregister(gt);
>
>--
>Jani Nikula, Intel Open Source Graphics Center
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
index 81ee7f3aadf6..ab4118b38120 100644
--- a/drivers/gpu/drm/i915/display/intel_pps.c
+++ b/drivers/gpu/drm/i915/display/intel_pps.c
@@ -1100,7 +1100,7 @@  bool intel_pps_have_panel_power_or_vdd(struct intel_dp *intel_dp)
 
 static void pps_init_timestamps(struct intel_dp *intel_dp)
 {
-	intel_dp->pps.panel_power_off_time = ktime_get_boottime();
+	intel_dp->pps.panel_power_off_time = 0;
 	intel_dp->pps.last_power_on = jiffies;
 	intel_dp->pps.last_backlight_off = jiffies;
 }
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index c3d43f9b1e45..0e3cbd129055 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -107,6 +107,8 @@  static const char irst_name[] = "INT3392";
 
 static const struct drm_driver i915_drm_driver;
 
+static void intel_shutdown_encoders(struct drm_i915_private *dev_priv);
+
 static void i915_release_bridge_dev(struct drm_device *dev,
 				    void *bridge)
 {
@@ -796,6 +798,8 @@  static void i915_driver_unregister(struct drm_i915_private *dev_priv)
 
 	intel_display_driver_unregister(dev_priv);
 
+	intel_shutdown_encoders(dev_priv);
+
 	for_each_gt(gt, dev_priv, i)
 		intel_gt_driver_unregister(gt);