All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lyude Paul <lyude@redhat.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	 Rodrigo Vivi <rodrigo.vivi@intel.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	 Sean Paul <seanpaul@chromium.org>,
	Aaron Ma <aaron.ma@canonical.com>,
	intel-gfx@lists.freedesktop.org,
	 dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/dp: add a delay before setting panel brightness after power on
Date: Tue, 14 Sep 2021 17:08:32 -0400	[thread overview]
Message-ID: <410de2c8e865446ec7f9d72a419b2674d34891bf.camel@redhat.com> (raw)
In-Reply-To: <87r1dr34nk.fsf@intel.com>

On Tue, 2021-09-14 at 12:09 +0300, Jani Nikula wrote:
> On Mon, 13 Sep 2021, Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> > Panel in my Dell XPS 7590, that uses Intel's HDR backlight interface to
> > control brightness, apparently needs a delay before setting brightness
> > after power on. Without this delay the panel does accept the setting
> > and may come up with some arbitrary brightness (sometimes it's too dark,
> > sometimes it's too bright, I wasn't able to find a system).
> > 
> > I don't have access to the spec, so I'm not sure if it's expected
> > behavior or a quirk for particular device.
> > 
> > Delay was chosen by experiment: it works with 100ms, but fails with
> > anything lower than 75ms.
> 
> Looks like we don't respect the panel delays for DPCD backlight. The
> values are used for setting up the panel power sequencer, and thus PWM
> based backlight, but we should probably use the delays in DPCD backlight
> code too.

This makes sense to me, you're referring to the panel delays in the VBT
correct?

> 
> BR,
> Jani.
> 
> 
> > 
> > Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > index 4f8337c7fd2e..c4f35e1b5870 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > @@ -210,6 +210,10 @@ intel_dp_aux_hdr_enable_backlight(const struct
> > intel_crtc_state *crtc_state,
> >  
> >         ctrl = old_ctrl;
> >         if (panel->backlight.edp.intel.sdr_uses_aux) {
> > +               /* Wait 100ms to ensure that panel is ready otherwise it
> > may not
> > +                * set chosen backlight level
> > +                */
> > +               msleep(100);
> >                 ctrl |= INTEL_EDP_HDR_TCON_BRIGHTNESS_AUX_ENABLE;
> >                 intel_dp_aux_hdr_set_aux_backlight(conn_state, level);
> >         } else {
> 

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


WARNING: multiple messages have this Message-ID (diff)
From: Lyude Paul <lyude@redhat.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	 Rodrigo Vivi <rodrigo.vivi@intel.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	 Sean Paul <seanpaul@chromium.org>,
	Aaron Ma <aaron.ma@canonical.com>,
	intel-gfx@lists.freedesktop.org,
	 dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: add a delay before setting panel brightness after power on
Date: Tue, 14 Sep 2021 17:08:32 -0400	[thread overview]
Message-ID: <410de2c8e865446ec7f9d72a419b2674d34891bf.camel@redhat.com> (raw)
In-Reply-To: <87r1dr34nk.fsf@intel.com>

On Tue, 2021-09-14 at 12:09 +0300, Jani Nikula wrote:
> On Mon, 13 Sep 2021, Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> > Panel in my Dell XPS 7590, that uses Intel's HDR backlight interface to
> > control brightness, apparently needs a delay before setting brightness
> > after power on. Without this delay the panel does accept the setting
> > and may come up with some arbitrary brightness (sometimes it's too dark,
> > sometimes it's too bright, I wasn't able to find a system).
> > 
> > I don't have access to the spec, so I'm not sure if it's expected
> > behavior or a quirk for particular device.
> > 
> > Delay was chosen by experiment: it works with 100ms, but fails with
> > anything lower than 75ms.
> 
> Looks like we don't respect the panel delays for DPCD backlight. The
> values are used for setting up the panel power sequencer, and thus PWM
> based backlight, but we should probably use the delays in DPCD backlight
> code too.

This makes sense to me, you're referring to the panel delays in the VBT
correct?

> 
> BR,
> Jani.
> 
> 
> > 
> > Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > index 4f8337c7fd2e..c4f35e1b5870 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > @@ -210,6 +210,10 @@ intel_dp_aux_hdr_enable_backlight(const struct
> > intel_crtc_state *crtc_state,
> >  
> >         ctrl = old_ctrl;
> >         if (panel->backlight.edp.intel.sdr_uses_aux) {
> > +               /* Wait 100ms to ensure that panel is ready otherwise it
> > may not
> > +                * set chosen backlight level
> > +                */
> > +               msleep(100);
> >                 ctrl |= INTEL_EDP_HDR_TCON_BRIGHTNESS_AUX_ENABLE;
> >                 intel_dp_aux_hdr_set_aux_backlight(conn_state, level);
> >         } else {
> 

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


  reply	other threads:[~2021-09-14 21:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 19:35 [PATCH] drm/i915/dp: add a delay before setting panel brightness after power on Vasily Khoruzhick
2021-09-13 19:35 ` [Intel-gfx] " Vasily Khoruzhick
2021-09-13 22:34 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-09-14  1:58 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-09-14  9:09 ` [PATCH] " Jani Nikula
2021-09-14  9:09   ` [Intel-gfx] " Jani Nikula
2021-09-14 21:08   ` Lyude Paul [this message]
2021-09-14 21:08     ` Lyude Paul
2021-09-14 22:31     ` Jani Nikula
2021-09-14 22:31       ` [Intel-gfx] " Jani Nikula
2021-09-15  1:10       ` Vasily Khoruzhick
2021-09-15  1:10         ` [Intel-gfx] " Vasily Khoruzhick
2021-09-15  8:47         ` Jani Nikula
2021-09-15  8:47           ` [Intel-gfx] " Jani Nikula
2021-09-20  6:57           ` Vasily Khoruzhick
2021-09-20  6:57             ` [Intel-gfx] " Vasily Khoruzhick

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=410de2c8e865446ec7f9d72a419b2674d34891bf.camel@redhat.com \
    --to=lyude@redhat.com \
    --cc=aaron.ma@canonical.com \
    --cc=airlied@linux.ie \
    --cc=anarsoul@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=seanpaul@chromium.org \
    /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.