All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lee, Shawn C" <shawn.c.lee@intel.com>
To: "Nikula, Jani" <jani.nikula@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "Chiou, Cooper" <cooper.chiou@intel.com>
Subject: Re: [PATCH 2/2] drm/i915: Add backlight enable on/off delay for DP aux backlight control
Date: Fri, 14 Jun 2019 08:38:54 +0000	[thread overview]
Message-ID: <D42A2A322A1FCA4089E30E9A9BA36AC65D60D1D0@PGSMSX111.gar.corp.intel.com> (raw)
In-Reply-To: <87blz0wpul.fsf@intel.com>


On Fri, 14 Jun 2019, Jani Nikula <jani.nikula@intel.com> wrote:
>On Thu, 13 Jun 2019, "Lee, Shawn C" <shawn.c.lee@intel.com> wrote:
>> Follow generla eDP backlight enable control sequence. Add T8 (valid 
>> video data to backlight enable) delay before turn backlight_enable on.
>> And T9 (backlight disable to end of valida video data) delay after 
>> backlight_enable off.
>
>There are two things that are wrong here:
>
>First, you're adding *two* waits on the DP AUX backlight enable and disable paths. IIUC there is no reason to wait between setting the level and enabling here. The waits have already been done on intel_dp.c level.
>
>Second, the last_power_on, backlight_on_delay, last_backlight_off, and backlight_off_delay members of intel_dp should all be private to intel_dp.c. Indeed these waits even have wrappers *within* intel_dp.c so that only very specific functions in intel_dp.c ever look at these members. This is a huge red flag.
>
>What's the problem you're trying to solve? Does this fix something
>*actual* that you're seeing?
>
>BR,
>Jani.

This change will call on/off delay twice. It is a mistake.

I check the driver again. To use the original on/off delay in _intel_edp_backlight_on() and _intel_edp_backlight_off() are enough.
And we should bypass backlight_enable on/off control by soc if aux backlight control active. Right?

One more question about the off flow. In this case, backlight_enable will be off at backlight.disable() function.
But wait delay was executed at _intel_edp_backlight_off() before backlight.disable(). 

We are trying to enable a panel with DP aux backlight control. The modification in patch #1 to correct the sequence and make it works.
But seems we should modify the delay time to fit panel's spec just like what we did for general eDP panel.

Best regards,
Shawn

>
>>
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Cc: Jani Nikula <jani.nikula@intel.com>
>> Cc: Jose Roberto de Souza <jose.souza@intel.com>
>> Cc: Cooper Chiou <cooper.chiou@intel.com>
>>
>> Signed-off-by: Lee, Shawn C <shawn.c.lee@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 13 +++++++++++++
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c 
>> b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
>> index 98210ae17285..b008e887f4e9 100644
>> --- a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
>> +++ b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
>> @@ -217,12 +217,25 @@ static void intel_dp_aux_enable_backlight(const struct intel_crtc_state *crtc_st
>>  	}
>>  
>>  	intel_dp_aux_set_backlight(conn_state, 
>> connector->panel.backlight.level);
>> +
>> +	wait_remaining_ms_from_jiffies(intel_dp->last_power_on,
>> +				       intel_dp->backlight_on_delay);
>> +
>>  	set_aux_backlight_enable(intel_dp, true);  }
>>  
>>  static void intel_dp_aux_disable_backlight(const struct 
>> drm_connector_state *old_conn_state)  {
>> +	struct intel_connector *connector = to_intel_connector(old_conn_state->connector);
>> +	struct intel_dp *intel_dp = 
>> +enc_to_intel_dp(&connector->encoder->base);
>> +
>> +	intel_dp->last_backlight_off = jiffies;
>> +
>>  	
>> set_aux_backlight_enable(enc_to_intel_dp(old_conn_state->best_encoder)
>> , false);
>> +
>> +	wait_remaining_ms_from_jiffies(intel_dp->last_backlight_off,
>> +				       intel_dp->backlight_off_delay);
>> +
>>  	intel_dp_aux_set_backlight(old_conn_state, 0);  }
>
>--
>Jani Nikula, Intel Open Source Graphics Center
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-06-14  8:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  6:09 [PATCH 1/2] drm/i915: Refine eDP aux backlight enable/disable sequence Lee, Shawn C
2019-06-14  5:50 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/2] " Patchwork
2019-06-14  6:09 ` [PATCH 2/2] drm/i915: Add backlight enable on/off delay for DP aux backlight control Lee, Shawn C
2019-06-14  8:09   ` Jani Nikula
2019-06-14  8:38     ` Lee, Shawn C [this message]
2019-06-14 18:09 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Refine eDP aux backlight enable/disable sequence Patchwork
2019-06-15 10:59 ` ✓ Fi.CI.IGT: " Patchwork
2019-06-21  3:02 ` [PATCH v2] " Lee Shawn C
2019-06-21  2:53   ` Lee, Shawn C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D42A2A322A1FCA4089E30E9A9BA36AC65D60D1D0@PGSMSX111.gar.corp.intel.com \
    --to=shawn.c.lee@intel.com \
    --cc=1560492565-30405-2-git-send-email-shawn.c.lee@intel.com \
    --cc=cooper.chiou@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.