drm/i915/dp: Backlight PWM enable before BL Enable assert
Subsystems (2)
PATCH 1/1 drm/i915/dp: Backlight PWM enable before BL Enable assert
From: Clint Taylor <[email protected]>
Backlight on delay uses PWM enable time to seperate PWM to backlight enable assert. Previous time difference used timing from VDD enable which occur several seconds before resulting in PWM starting 5ms after backlight enable. Changes to backlight
duty cycle take affect at the end of the current PWM cycle.
Measured time for the PWM cycle is 5ms. 5 additional ms must be added to the backlight_on_delay to get correct VBT timing of PWM to backlight enable assert.
--- drivers/gpu/drm/i915/intel_dp.c | 6 ++++-- drivers/gpu/drm/i915/intel_drv.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +4 -2
@@ -1141,7 +1141,7 @@ static void wait_panel_power_cycle(struct intel_dp *intel_dp)static void wait_backlight_on (struct intel_dp *intel_dp) { -wait_remaining_ms_from_jiffies (intel_dp->last_power_on, +wait_remaining_ms_from_jiffies (intel_dp->last_backlight_on, intel_dp->backlight_on_delay); }
@@ -1398,6 +1398,7 @@ void intel_edp_backlight_on(struct intel_dp *intel_dp)DRM_DEBUG_KMS ("\n" );intel_panel_enable_backlight (intel_dp->attached_connector); + intel_dp->last_backlight_on = jiffies;/* * If we enable the backlight right away following a panel power
@@ -4243,9 +4244,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,assign_final (t11_t12);#undef assign_final +#define PWM_CYCLE_DELAY 5#define get_delay (field) (DIV_ROUND_UP(final.field, 10)) intel_dp->panel_power_up_delay =get_delay (t1_t3); - intel_dp->backlight_on_delay =get_delay (t8); + intel_dp->backlight_on_delay =get_delay (t8) +PWM_CYCLE_DELAY ; intel_dp->backlight_off_delay =get_delay (t9); intel_dp->panel_power_down_delay =get_delay (t10); intel_dp->panel_power_cycle_delay =get_delay (t11_t12);
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -556,6 +556,7 @@ struct intel_dp {bool want_panel_vdd;unsigned long last_power_cycle;unsigned long last_power_on; +unsigned long last_backlight_on;unsigned long last_backlight_off;struct notifier_block edp_notifier;
Signature · 1 line
1.8.3.2
Jani Nikula
maintainerQuoted 10 lines · On Fri, 15 Aug 2014, [email protected] wrote:
From: Clint Taylor <[email protected]>
Backlight on delay uses PWM enable time to seperate PWM to backlight enable assert. Previous time difference used timing from VDD enable which occur several seconds before resulting in PWM starting 5ms after backlight enable. Changes to backlight
duty cycle take affect at the end of the current PWM cycle.
Measured time for the PWM cycle is 5ms. 5 additional ms must be added to thebacklight_on_delayto get correct VBT timing of PWM to backlight enable assert.
The patch seems sane, but I'd like you to rebase this on top of patch 1/4 of my backlight series [1] so I can queue them both to drm-intel-fixes. Then we'll have fewer conflicts with the rest of the backlight series going forward.
Hint hint, I'd also appreciate review of my backlight series. ;)
BR,
Jani.
[1] http://mid.gmane.org/e7a47b50ed0f25cafdc26711fc09561ea8af3b81.1407849872.git.jani.nikula@intel.com
Quoted 60 lines
Change-Id I484999a597fd84dacf4cf99a168ec9ba4bb6ff11Signed-off-by Clint Taylor <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 6 ++++-- drivers/gpu/drm/i915/intel_drv.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_dp.c +4
-2@@ -1141,7 +1141,7 @@ static void wait_panel_power_cycle(struct intel_dp *intel_dp)static void wait_backlight_on (struct intel_dp *intel_dp) { -wait_remaining_ms_from_jiffies (intel_dp->last_power_on, +wait_remaining_ms_from_jiffies (intel_dp->last_backlight_on, intel_dp->backlight_on_delay); }@@ -1398,6 +1398,7 @@ void intel_edp_backlight_on(struct intel_dp *intel_dp)DRM_DEBUG_KMS ("\n" );intel_panel_enable_backlight (intel_dp->attached_connector); + intel_dp->last_backlight_on = jiffies;/* * If we enable the backlight right away following a panel power @@ -4243,9 +4244,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,assign_final (t11_t12);#undef assign_final +#define PWM_CYCLE_DELAY 5#define get_delay (field) (DIV_ROUND_UP(final.field, 10)) intel_dp->panel_power_up_delay =get_delay (t1_t3); - intel_dp->backlight_on_delay =get_delay (t8); + intel_dp->backlight_on_delay =get_delay (t8) +PWM_CYCLE_DELAY ; intel_dp->backlight_off_delay =get_delay (t9); intel_dp->panel_power_down_delay =get_delay (t10); intel_dp->panel_power_cycle_delay =get_delay (t11_t12);drivers/gpu/drm/i915/intel_drv.h +1
-0@@ -556,6 +556,7 @@ struct intel_dp {bool want_panel_vdd;unsigned long last_power_cycle;unsigned long last_power_on; +unsigned long last_backlight_on;unsigned long last_backlight_off;struct notifier_block edp_notifier;Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center