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.
V2: Rebase to Jani Nikula backlight power patch 1/4
--- 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); }
@@ -1418,6 +1418,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;_intel_edp_backlight_on (intel_dp); }
@@ -4256,9 +4257,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
Quoted 34 lines · On Mon, Aug 18, 2014 at 01:48:35PM -0700, [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.V2: Rebase to Jani Nikula backlight power patch 1/4
Change-Id I2982f9785d92e8d64c04ca25c8bd4c5d1dc8067cSigned-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 +1
-1@@ -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); }
drivers/gpu/drm/i915/intel_dp.c void intel_edp_backlight_on(struct intel_dp *intel_dp) · line 1421
Quoted 4 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -1418,6 +1418,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;
Seems to me we should just have a msleep(PWM_CYCLE_DELAY) here since (assuming I understood correctly) only the PWM cycle time is important between these two steps, and the "t8" (vbt spec says t7 actually) is relevant only from end of link training to backlight on.
Hmm, no actually your idea might be better since on VLV/CHV we turn the pipe on after link training, and I assume t7/t8 should really start counting from the pipe on on those platforms. So I guess the most appropriate solution might be somehting like
{
intel_dp->last_backlight_on = jiffies; intel_panel_enable_backlight(intel_dp->attached_connector); msleep(POWER_CYCLE_DELAY); _intel_edp_backlight_on(intel_dp);
}
But I'm not sure the distinction makes any difference since intel_panel_enable_backlight() shouldn't take a significant amount of time, and msleep() is itself rather inaccurate.
So I guess your approach is the simplest option here.
drivers/gpu/drm/i915/intel_dp.c intel_dp_init_panel_power_sequencer(struct drm_device *dev, · line 4260
Quoted 8 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0_intel_edp_backlight_on (intel_dp); }@@ -4256,9 +4257,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,assign_final (t11_t12);#undef assign_final +#define PWM_CYCLE_DELAY 5
Shoduln't this be calculated from the PWM frequqncy? Not sure what a PWM cycle here is exactly. Just one full period of the signal?
Also would be nice to have a comment in the code explaining what this is and why we need to add it to the delay.
Quoted 26 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1#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 · 2 lines
Ville Syrjälä Intel OTC
Quoted 37 lines · Ville Syrjälä
Quoted 36 lines · On Mon, Aug 18, 2014 at 01:48:35PM -0700, [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.V2: Rebase to Jani Nikula backlight power patch 1/4
Change-Id I2982f9785d92e8d64c04ca25c8bd4c5d1dc8067cSigned-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 +1
-1@@ -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); }@@ -1418,6 +1418,7 @@ void intel_edp_backlight_on(struct intel_dp *intel_dp)DRM_DEBUG_KMS ("\n" );
Quoted 8 lines
drivers/gpu/drm/i915/intel_dp.c void intel_edp_backlight_on(struct intel_dp *intel_dp) · line 1421
Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0intel_panel_enable_backlight (intel_dp->attached_connector); + intel_dp->last_backlight_on = jiffies;Seems to me we should just have a
msleep(PWM_CYCLE_DELAY)here since (assuming I understood correctly) only the PWM cycle time is important between these two steps, and the "t8" (vbt spec says t7 actually) is relevant only from end of link training to backlight on.
The driver has overloaded both T8 and T9 VBT timing entries. The eDP specification really doesn't have timing data defined for this requirement, but the panel manufacturers have it in their panel specification and they use various names like (Te, t17, etc...) for this delay.
Quoted 12 lines
Hmm, no actually your idea might be better since on VLV/CHV we turn the pipe on after link training, and I assume t7/t8 should really start counting from the pipe on on those platforms. So I guess the most appropriate solution might be somehting like
{ intel_dp->last_backlight_on = jiffies; intel_panel_enable_backlight(intel_dp->attached_connector); msleep(POWER_CYCLE_DELAY); _intel_edp_backlight_on(intel_dp); }
Quoted 4 lines
But I'm not sure the distinction makes any difference since
intel_panel_enable_backlight()shouldn't take a significant amount of time, andmsleep()is itself rather inaccurate.
There is also a need to add this delay when turning off the PWM enable bit through intel_panel_disable_backlight(). If the PWM enable bit is turned off while the PWM signal is high then the signal remains high. If the bit is turned off when the signal is low the PWM will remain low. Since we don't know the current state of the PWM signal we must set the duty_cycle to 0, wait PWM_CYCLE_DELAY, and then turn off the enable bit.
Actually it might be better if we never turn off the PWM enable bit in intel_panel_disable_backlight() and we just use the duty cycle register to control the PWM.
Quoted 5 lines
So I guess your approach is the simplest option here.
Quoted 3 lines
drivers/gpu/drm/i915/intel_dp.c +0
-0_intel_edp_backlight_on (intel_dp); }
Quoted 9 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_init_panel_power_sequencer(struct drm_device *dev, · line 4260
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -4256,9 +4257,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,assign_final (t11_t12);#undef assign_final +#define PWM_CYCLE_DELAY 5Shoduln't this be calculated from the PWM frequqncy? Not sure what a PWM cycle here is exactly. Just one full period of the signal?
The PWM cycle in this case turns out to be 1 full cycle of the PWM waveform though it depends on which display core clock (128 or 25Mhz(S0ix) is being used. Since we only care about the minimum elapsed time to meet the panel specification a value of 5ms will work even though more or less PWM cycles would take place before the BL_ENABLE is asserted. I would prefer not to add complexity to switch between panel timings for normal and S0ix display clock modes. How often does the backlight get enabled while in S0ix?
Quoted 2 lines
Also would be nice to have a comment in the code explaining what this is and why we need to add it to the delay.
Sure, As you may have noticed in other patches I really like comments.
Quoted 28 lines
Quoted 27 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1#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
-1@@ -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; --1.8.3.2
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 96 lines · Clint Taylor
Quoted 37 lines · Ville Syrjälä
Quoted 36 lines · On Mon, Aug 18, 2014 at 01:48:35PM -0700, [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.V2: Rebase to Jani Nikula backlight power patch 1/4
Change-Id I2982f9785d92e8d64c04ca25c8bd4c5d1dc8067cSigned-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 +1
-1@@ -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); }@@ -1418,6 +1418,7 @@ void intel_edp_backlight_on(struct intel_dp *intel_dp)DRM_DEBUG_KMS ("\n" );Quoted 8 lines
drivers/gpu/drm/i915/intel_dp.c void intel_edp_backlight_on(struct intel_dp *intel_dp) · line 1421
Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0intel_panel_enable_backlight (intel_dp->attached_connector); + intel_dp->last_backlight_on = jiffies;Seems to me we should just have a
msleep(PWM_CYCLE_DELAY)here since (assuming I understood correctly) only the PWM cycle time is important between these two steps, and the "t8" (vbt spec says t7 actually) is relevant only from end of link training to backlight on.The driver has overloaded both T8 and T9 VBT timing entries. The eDP specification really doesn't have timing data defined for this requirement, but the panel manufacturers have it in their panel specification and they use various names like (Te, t17, etc...) for this delay.
Quoted 12 lines
Hmm, no actually your idea might be better since on VLV/CHV we turn the pipe on after link training, and I assume t7/t8 should really start counting from the pipe on on those platforms. So I guess the most appropriate solution might be somehting like
{ intel_dp->last_backlight_on = jiffies; intel_panel_enable_backlight(intel_dp->attached_connector); msleep(POWER_CYCLE_DELAY); _intel_edp_backlight_on(intel_dp); }Quoted 4 lines
But I'm not sure the distinction makes any difference since
intel_panel_enable_backlight()shouldn't take a significant amount of time, andmsleep()is itself rather inaccurate.There is also a need to add this delay when turning off the PWM enable bit through
intel_panel_disable_backlight(). If the PWM enable bit is turned off while the PWM signal is high then the signal remains high. If the bit is turned off when the signal is low the PWM will remain low. Since we don't know the current state of the PWM signal we must set theduty_cycleto 0, waitPWM_CYCLE_DELAY, and then turn off the enable bit.Actually it might be better if we never turn off the PWM enable bit in
intel_panel_disable_backlight()and we just use the duty cycle register to control the PWM.Quoted 5 lines
So I guess your approach is the simplest option here.
Quoted 3 lines
drivers/gpu/drm/i915/intel_dp.c +0
-0_intel_edp_backlight_on (intel_dp); }Quoted 9 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_init_panel_power_sequencer(struct drm_device *dev, · line 4260
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -4256,9 +4257,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,assign_final (t11_t12);#undef assign_final +#define PWM_CYCLE_DELAY 5Shoduln't this be calculated from the PWM frequqncy? Not sure what a PWM cycle here is exactly. Just one full period of the signal?
Quoted 8 lines
The PWM cycle in this case turns out to be 1 full cycle of the PWM waveform though it depends on which display core clock (128 or 25Mhz(S0ix) is being used. Since we only care about the minimum elapsed time to meet the panel specification a value of 5ms will work even though more or less PWM cycles would take place before the
BL_ENABLEis asserted. I would prefer not to add complexity to switch between panel timings for normal and S0ix display clock modes. How often does the backlight get enabled while in S0ix?
I'm not sure how this could even be a problem for s0ix. The driver would be suspended by the time we enter s0ix.
I'm more worried about other platforms that may have different pwm cycle. So it seems to me that we should calculate the pwm cycle as DIV_ROUND_UP(1000, intel_hrawclk()), assuming it's hrawclk instead of cdclk that's used (which is the impression I get from the docs).
Quoted 34 lines
Quoted 3 lines
Also would be nice to have a comment in the code explaining what this is and why we need to add it to the delay.
Sure, As you may have noticed in other patches I really like comments.
Quoted 28 lines
Quoted 27 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1#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
-1@@ -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; --1.8.3.2
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä Intel OTC
Jani Nikula
maintainer+Art
Quoted 6 lines · Clint Taylor
There is also a need to add this delay when turning off the PWM enable bit through
intel_panel_disable_backlight(). If the PWM enable bit is turned off while the PWM signal is high then the signal remains high. If the bit is turned off when the signal is low the PWM will remain low. Since we don't know the current state of the PWM signal we must set theduty_cycleto 0, waitPWM_CYCLE_DELAY, and then turn off the enable bit.
[citation needed]
Really, I want this in the specs if this is true.
Quoted 3 lines
Actually it might be better if we never turn off the PWM enable bit in
intel_panel_disable_backlight()and we just use the duty cycle register to control the PWM.
Art, any feedback on these two?
BR,
Jani.
Quoted 63 lines
Quoted 6 lines
So I guess your approach is the simplest option here.
Quoted 3 lines
_intel_edp_backlight_on(intel_dp); }Quoted 9 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_init_panel_power_sequencer(struct drm_device *dev, · line 4260
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -4256,9 +4257,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,assign_final (t11_t12);#undef assign_final +#define PWM_CYCLE_DELAY 5Shoduln't this be calculated from the PWM frequqncy? Not sure what a PWM cycle here is exactly. Just one full period of the signal?
The PWM cycle in this case turns out to be 1 full cycle of the PWM waveform though it depends on which display core clock (128 or 25Mhz(S0ix) is being used. Since we only care about the minimum elapsed time to meet the panel specification a value of 5ms will work even though more or less PWM cycles would take place before the
BL_ENABLEis asserted. I would prefer not to add complexity to switch between panel timings for normal and S0ix display clock modes. How often does the backlight get enabled while in S0ix?Quoted 2 lines
Also would be nice to have a comment in the code explaining what this is and why we need to add it to the delay.
Sure, As you may have noticed in other patches I really like comments.
Quoted 19 lines
Quoted 19 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1#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;Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_drv.h +0
-1struct notifier_block edp_notifier; --1.8.3.2
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
I'll check it out. I haven't heard any complaint about this before, but it may be one of those things that started back on i745 and never got documented.
-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Friday, August 22, 2014 6:07 AM
To: Taylor, Clinton A; Ville Syrjälä; Runyan, Arthur J
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: Backlight PWM enable before BL Enable assert
+Art
Quoted 6 lines · Clint Taylor
There is also a need to add this delay when turning off the PWM enable bit through
intel_panel_disable_backlight(). If the PWM enable bit is turned off while the PWM signal is high then the signal remains high. If the bit is turned off when the signal is low the PWM will remain low. Since we don't know the current state of the PWM signal we must set theduty_cycleto 0, waitPWM_CYCLE_DELAY, and then turn off the enable bit.
[citation needed]
Really, I want this in the specs if this is true.
Quoted 3 lines
Actually it might be better if we never turn off the PWM enable bit in
intel_panel_disable_backlight()and we just use the duty cycle register to control the PWM.
Art, any feedback on these two?
BR,
Jani.
Quoted 63 lines
Quoted 6 lines
So I guess your approach is the simplest option here.
Quoted 3 lines
_intel_edp_backlight_on(intel_dp); }Quoted 9 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_init_panel_power_sequencer(struct drm_device *dev, · line 4260
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -4256,9 +4257,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,assign_final (t11_t12);#undef assign_final +#define PWM_CYCLE_DELAY 5Shoduln't this be calculated from the PWM frequqncy? Not sure what a PWM cycle here is exactly. Just one full period of the signal?
The PWM cycle in this case turns out to be 1 full cycle of the PWM waveform though it depends on which display core clock (128 or 25Mhz(S0ix) is being used. Since we only care about the minimum elapsed time to meet the panel specification a value of 5ms will work even though more or less PWM cycles would take place before the
BL_ENABLEis asserted. I would prefer not to add complexity to switch between panel timings for normal and S0ix display clock modes. How often does the backlight get enabled while in S0ix?Quoted 2 lines
Also would be nice to have a comment in the code explaining what this is and why we need to add it to the delay.
Sure, As you may have noticed in other patches I really like comments.
Quoted 19 lines
Quoted 19 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1#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;Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_drv.h +0
-1struct notifier_block edp_notifier; --1.8.3.2
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Quoted 3 lines · Arthur J
I'll check it out. I haven't heard any complaint about this before, but it may be one of those things that started back on i745 and never got documented.
Only i855 and later started to have native lvds with all the surrounding stuff, before there's only bridge chips that did all the magic. So won't be quite _that_ old ;-)
Cheers, Daniel
Quoted 103 lines
-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Friday, August 22, 2014 6:07 AM
To: Taylor, Clinton A; Ville Syrjälä; Runyan, Arthur J
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: Backlight PWM enable before BL Enable assert+Art
Quoted 6 lines · Clint Taylor
There is also a need to add this delay when turning off the PWM enable bit through
intel_panel_disable_backlight(). If the PWM enable bit is turned off while the PWM signal is high then the signal remains high. If the bit is turned off when the signal is low the PWM will remain low. Since we don't know the current state of the PWM signal we must set theduty_cycleto 0, waitPWM_CYCLE_DELAY, and then turn off the enable bit.[citation needed]
Really, I want this in the specs if this is true.
Quoted 3 lines
Actually it might be better if we never turn off the PWM enable bit in
intel_panel_disable_backlight()and we just use the duty cycle register to control the PWM.Art, any feedback on these two?
BR,
Jani.Quoted 63 lines
Quoted 6 lines
So I guess your approach is the simplest option here.
Quoted 3 lines
_intel_edp_backlight_on(intel_dp); }Quoted 9 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_init_panel_power_sequencer(struct drm_device *dev, · line 4260
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -4256,9 +4257,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,assign_final (t11_t12);#undef assign_final +#define PWM_CYCLE_DELAY 5Shoduln't this be calculated from the PWM frequqncy? Not sure what a PWM cycle here is exactly. Just one full period of the signal?
The PWM cycle in this case turns out to be 1 full cycle of the PWM waveform though it depends on which display core clock (128 or 25Mhz(S0ix) is being used. Since we only care about the minimum elapsed time to meet the panel specification a value of 5ms will work even though more or less PWM cycles would take place before the
BL_ENABLEis asserted. I would prefer not to add complexity to switch between panel timings for normal and S0ix display clock modes. How often does the backlight get enabled while in S0ix?Quoted 2 lines
Also would be nice to have a comment in the code explaining what this is and why we need to add it to the delay.
Sure, As you may have noticed in other patches I really like comments.
Quoted 19 lines
Quoted 19 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1#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;Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_drv.h +0
-1struct notifier_block edp_notifier; --1.8.3.2
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
:-) We pulled most of the mobile functions from the bridge chip into the main chip, so that same backlight code might well have been there.
Quoted 1 line
From sandybridge onwards I see that hardware will override the PWM signal to inactive (0 if backlight polarity is active high, 1 if active low) when PWM is disabled (PWM control bit 31 = 0). I don't have anything older than sandybridge to look at, and of course there could always be some hidden bug that prevents the override from kicking in.
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, August 26, 2014 2:52 AM
To: Runyan, Arthur J
Cc: Jani Nikula; Taylor, Clinton A; Ville Syrjälä; [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: Backlight PWM enable before BL Enable assert
Quoted 3 lines · Arthur J
I'll check it out. I haven't heard any complaint about this before, but it may be one of those things that started back on i745 and never got documented.
Only i855 and later started to have native lvds with all the surrounding stuff, before there's only bridge chips that did all the magic. So won't be quite _that_ old ;-)
Cheers, Daniel
Quoted 103 lines
-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Friday, August 22, 2014 6:07 AM
To: Taylor, Clinton A; Ville Syrjälä; Runyan, Arthur J
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: Backlight PWM enable before BL Enable assert+Art
Quoted 6 lines · Clint Taylor
There is also a need to add this delay when turning off the PWM enable bit through
intel_panel_disable_backlight(). If the PWM enable bit is turned off while the PWM signal is high then the signal remains high. If the bit is turned off when the signal is low the PWM will remain low. Since we don't know the current state of the PWM signal we must set theduty_cycleto 0, waitPWM_CYCLE_DELAY, and then turn off the enable bit.[citation needed]
Really, I want this in the specs if this is true.
Quoted 3 lines
Actually it might be better if we never turn off the PWM enable bit in
intel_panel_disable_backlight()and we just use the duty cycle register to control the PWM.Art, any feedback on these two?
BR,
Jani.Quoted 63 lines
Quoted 6 lines
So I guess your approach is the simplest option here.
Quoted 3 lines
_intel_edp_backlight_on(intel_dp); }Quoted 9 lines
drivers/gpu/drm/i915/intel_dp.c intel_dp_init_panel_power_sequencer(struct drm_device *dev, · line 4260
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -4256,9 +4257,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,assign_final (t11_t12);#undef assign_final +#define PWM_CYCLE_DELAY 5Shoduln't this be calculated from the PWM frequqncy? Not sure what a PWM cycle here is exactly. Just one full period of the signal?
The PWM cycle in this case turns out to be 1 full cycle of the PWM waveform though it depends on which display core clock (128 or 25Mhz(S0ix) is being used. Since we only care about the minimum elapsed time to meet the panel specification a value of 5ms will work even though more or less PWM cycles would take place before the
BL_ENABLEis asserted. I would prefer not to add complexity to switch between panel timings for normal and S0ix display clock modes. How often does the backlight get enabled while in S0ix?Quoted 2 lines
Also would be nice to have a comment in the code explaining what this is and why we need to add it to the delay.
Sure, As you may have noticed in other patches I really like comments.
Quoted 19 lines
Quoted 19 lines
drivers/gpu/drm/i915/intel_dp.c +1
-1#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;Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_drv.h +0
-1struct notifier_block edp_notifier; --1.8.3.2
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 3 lines · Arthur J
:-) We pulled most of the mobile functions from the bridge chip into the main chip, so that same backlight code might well have been there.
From sandybridge onwards I see that hardware will override the PWM signal to inactive (0 if backlight polarity is active high, 1 if active low) when PWM is disabled (PWM control bit 31 = 0). I don't have anything older than sandybridge to look at, and of course there could always be some hidden bug that prevents the override from kicking in.
Just enabling/disabling the PWM control bit will reproduce the issue on VLV. I have not tested on other platforms.
Clint
Quoted 122 lines
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, August 26, 2014 2:52 AM
To: Runyan, Arthur J
Cc: Jani Nikula; Taylor, Clinton A; Ville Syrjälä; [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: Backlight PWM enable before BL Enable assertQuoted 3 lines · Arthur J
I'll check it out. I haven't heard any complaint about this before, but it may be one of those things that started back on i745 and never got documented.
Only i855 and later started to have native lvds with all the surrounding stuff, before there's only bridge chips that did all the magic. So won't be quite _that_ old ;-)
Cheers, Daniel
Quoted 103 lines
-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Friday, August 22, 2014 6:07 AM
To: Taylor, Clinton A; Ville Syrjälä; Runyan, Arthur J
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: Backlight PWM enable before BL Enable assert+Art
Quoted 6 lines · Clint Taylor
There is also a need to add this delay when turning off the PWM enable bit through
intel_panel_disable_backlight(). If the PWM enable bit is turned off while the PWM signal is high then the signal remains high. If the bit is turned off when the signal is low the PWM will remain low. Since we don't know the current state of the PWM signal we must set theduty_cycleto 0, waitPWM_CYCLE_DELAY, and then turn off the enable bit.[citation needed]
Really, I want this in the specs if this is true.
Quoted 3 lines
Actually it might be better if we never turn off the PWM enable bit in
intel_panel_disable_backlight()and we just use the duty cycle register to control the PWM.Art, any feedback on these two?
BR,
Jani.Quoted 59 lines
Quoted 6 lines
So I guess your approach is the simplest option here.
Quoted 3 lines
_intel_edp_backlight_on(intel_dp); }Quoted 9 lines
Review intel_dp_init_panel_power_sequencer(struct drm_device *dev, · line 4260
Quoted 5 lines
(quoted diff) +1
-0@@ -4256,9 +4257,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev, assign_final(t11_t12); #undef assign_final +#define PWM_CYCLE_DELAY 5Shoduln't this be calculated from the PWM frequqncy? Not sure what a PWM cycle here is exactly. Just one full period of the signal?
The PWM cycle in this case turns out to be 1 full cycle of the PWM waveform though it depends on which display core clock (128 or 25Mhz(S0ix) is being used. Since we only care about the minimum elapsed time to meet the panel specification a value of 5ms will work even though more or less PWM cycles would take place before the
BL_ENABLEis asserted. I would prefer not to add complexity to switch between panel timings for normal and S0ix display clock modes. How often does the backlight get enabled while in S0ix?Quoted 2 lines
Also would be nice to have a comment in the code explaining what this is and why we need to add it to the delay.
Sure, As you may have noticed in other patches I really like comments.
Quoted 19 lines
Quoted 19 lines
(quoted diff) +1
-1#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;Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_drv.h +0
-1struct notifier_block edp_notifier; --1.8.3.2
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfxQuoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
VLV is a whole different can of worms. Some parts of display are from before sanybridge, and it may have some special muxing on the backlight pins. I won't be able to give any feedback on how hardware behaves there.
-----Original Message-----
From: Taylor, Clinton A
Sent: Tuesday, September 02, 2014 5:27 PM
To: Runyan, Arthur J; Daniel Vetter
Cc: Jani Nikula; Ville Syrjälä; [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: Backlight PWM enable before BL Enable assert
Quoted 3 lines · Arthur J
:-) We pulled most of the mobile functions from the bridge chip into the main chip, so that same backlight code might well have been there.
From sandybridge onwards I see that hardware will override the PWM signal to inactive (0 if backlight polarity is active high, 1 if active low) when PWM is disabled (PWM control bit 31 = 0). I don't have anything older than sandybridge to look at, and of course there could always be some hidden bug that prevents the override from kicking in.
Just enabling/disabling the PWM control bit will reproduce the issue on VLV. I have not tested on other platforms.
Clint
Quoted 122 lines
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, August 26, 2014 2:52 AM
To: Runyan, Arthur J
Cc: Jani Nikula; Taylor, Clinton A; Ville Syrjälä; [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: Backlight PWM enable before BL Enable assertQuoted 3 lines · Arthur J
I'll check it out. I haven't heard any complaint about this before, but it may be one of those things that started back on i745 and never got documented.
Only i855 and later started to have native lvds with all the surrounding stuff, before there's only bridge chips that did all the magic. So won't be quite _that_ old ;-)
Cheers, Daniel
Quoted 103 lines
-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Friday, August 22, 2014 6:07 AM
To: Taylor, Clinton A; Ville Syrjälä; Runyan, Arthur J
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: Backlight PWM enable before BL Enable assert+Art
Quoted 6 lines · Clint Taylor
There is also a need to add this delay when turning off the PWM enable bit through
intel_panel_disable_backlight(). If the PWM enable bit is turned off while the PWM signal is high then the signal remains high. If the bit is turned off when the signal is low the PWM will remain low. Since we don't know the current state of the PWM signal we must set theduty_cycleto 0, waitPWM_CYCLE_DELAY, and then turn off the enable bit.[citation needed]
Really, I want this in the specs if this is true.
Quoted 3 lines
Actually it might be better if we never turn off the PWM enable bit in
intel_panel_disable_backlight()and we just use the duty cycle register to control the PWM.Art, any feedback on these two?
BR,
Jani.Quoted 59 lines
Quoted 6 lines
So I guess your approach is the simplest option here.
Quoted 3 lines
_intel_edp_backlight_on(intel_dp); }Quoted 9 lines
Review intel_dp_init_panel_power_sequencer(struct drm_device *dev, · line 4260
Quoted 5 lines
(quoted diff) +1
-0@@ -4256,9 +4257,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev, assign_final(t11_t12); #undef assign_final +#define PWM_CYCLE_DELAY 5Shoduln't this be calculated from the PWM frequqncy? Not sure what a PWM cycle here is exactly. Just one full period of the signal?
The PWM cycle in this case turns out to be 1 full cycle of the PWM waveform though it depends on which display core clock (128 or 25Mhz(S0ix) is being used. Since we only care about the minimum elapsed time to meet the panel specification a value of 5ms will work even though more or less PWM cycles would take place before the
BL_ENABLEis asserted. I would prefer not to add complexity to switch between panel timings for normal and S0ix display clock modes. How often does the backlight get enabled while in S0ix?Quoted 2 lines
Also would be nice to have a comment in the code explaining what this is and why we need to add it to the delay.
Sure, As you may have noticed in other patches I really like comments.
Quoted 19 lines
Quoted 19 lines
(quoted diff) +1
-1#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;Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_drv.h +0
-1struct notifier_block edp_notifier; --1.8.3.2
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfxQuoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx