Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Get HDR DPCD refresh timeout from VBT
Date: Wed, 1 Mar 2023 17:51:27 +0200	[thread overview]
Message-ID: <Y/90fwlyYgwK3O6o@intel.com> (raw)
In-Reply-To: <878rggwl95.fsf@intel.com>

On Wed, Mar 01, 2023 at 05:21:10PM +0200, Jani Nikula wrote:
> On Wed, 01 Mar 2023, "Hogander, Jouni" <jouni.hogander@intel.com> wrote:
> > On Mon, 2023-02-20 at 18:47 +0200, Ville Syrjala wrote:
> >> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> 
> >> Grab the HDR DPCD refresh timeout (time we need to wait after
> >> writing the sourc OUI before the HDR DPCD registers are ready)
> >> from the VBT.
> >> 
> >> Windows doesn't even seem to have any default value for this,
> >> which is perhaps a bit weird since the VBT value is documented
> >> as TGL+ and I thought the HDR backlight stuff might already be
> >> used on earlier platforms. To play it safe I left the old
> >> hardcoded 30ms default in place. Digging through some internal
> >> stuff that seems to have been a number given by the vendor for
> >> one particularly slow TCON. Although I did see 50ms mentioned
> >> somewhere as well.
> >> 
> >> Let's also include the value in the debug print to ease
> >> debugging, and toss in the customary connector id+name as well.
> >> 
> >> The TGL Thinkpad T14 I have sets this to 0 btw. So the delay
> >> is now gone on this machine:
> >>  [CONNECTOR:308:eDP-1] Detected Intel HDR backlight interface version
> >> 1
> >>  [CONNECTOR:308:eDP-1] Using Intel proprietary eDP backlight controls
> >>  [CONNECTOR:308:eDP-1] SDR backlight is controlled through PWM
> >>  [CONNECTOR:308:eDP-1] Using native PCH PWM for backlight control
> >> (controller=0)
> >>  [CONNECTOR:308:eDP-1] Using AUX HDR interface for backlight control
> >> (range 0..496)
> >>  [CONNECTOR:308:eDP-1] Performing OUI wait (0 ms)
> >
> > Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
> 
> Cc: stable@vger.kernel.org
> 
> ?

Not aware of anythigng actually getting fixed by this. I suspect
it's usually more of an optimization since the original 30ms was
supposedly only needed by some especially slow TCONs.

> 
> >
> >> 
> >> Cc: Lyude Paul <lyude@redhat.com>
> >> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> ---
> >>  drivers/gpu/drm/i915/display/intel_bios.c          | 6 ++++++
> >>  drivers/gpu/drm/i915/display/intel_display_types.h | 1 +
> >>  drivers/gpu/drm/i915/display/intel_dp.c            | 9 +++++++--
> >>  3 files changed, 14 insertions(+), 2 deletions(-)
> >> 
> >> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c
> >> b/drivers/gpu/drm/i915/display/intel_bios.c
> >> index f35ef3675d39..f16887aed56d 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> >> @@ -1084,6 +1084,12 @@ parse_lfp_backlight(struct drm_i915_private
> >> *i915,
> >>                 panel->vbt.backlight.min_brightness = entry-
> >> >min_brightness;
> >>         }
> >>  
> >> +       if (i915->display.vbt.version >= 239)
> >> +               panel->vbt.backlight.hdr_dpcd_refresh_timeout =
> >> +                       DIV_ROUND_UP(backlight_data-
> >> >hdr_dpcd_refresh_timeout[panel_type], 100);
> >> +       else
> >> +               panel->vbt.backlight.hdr_dpcd_refresh_timeout = 30;
> >> +
> >>         drm_dbg_kms(&i915->drm,
> >>                     "VBT backlight PWM modulation frequency %u Hz, "
> >>                     "active %s, min brightness %u, level %u,
> >> controller %u\n",
> >> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h
> >> b/drivers/gpu/drm/i915/display/intel_display_types.h
> >> index 748b0cd411fa..76f47ba3be45 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> >> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> >> @@ -326,6 +326,7 @@ struct intel_vbt_panel_data {
> >>         struct {
> >>                 u16 pwm_freq_hz;
> >>                 u16 brightness_precision_bits;
> >> +               u16 hdr_dpcd_refresh_timeout;
> >>                 bool present;
> >>                 bool active_low_pwm;
> >>                 u8 min_brightness;      /* min_brightness/255 of max
> >> */
> >> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> >> b/drivers/gpu/drm/i915/display/intel_dp.c
> >> index b77bd4565864..3734e7567230 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> >> @@ -2293,10 +2293,15 @@ intel_edp_init_source_oui(struct intel_dp
> >> *intel_dp, bool careful)
> >>  
> >>  void intel_dp_wait_source_oui(struct intel_dp *intel_dp)
> >>  {
> >> +       struct intel_connector *connector = intel_dp-
> >> >attached_connector;
> >>         struct drm_i915_private *i915 = dp_to_i915(intel_dp);
> >>  
> >> -       drm_dbg_kms(&i915->drm, "Performing OUI wait\n");
> >> -       wait_remaining_ms_from_jiffies(intel_dp->last_oui_write, 30);
> >> +       drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] Performing OUI
> >> wait (%u ms)\n",
> >> +                   connector->base.base.id, connector->base.name,
> >> +                   connector-
> >> >panel.vbt.backlight.hdr_dpcd_refresh_timeout);
> >> +
> >> +       wait_remaining_ms_from_jiffies(intel_dp->last_oui_write,
> >> +                                      connector-
> >> >panel.vbt.backlight.hdr_dpcd_refresh_timeout);
> >>  }
> >>  
> >>  /* If the device supports it, try to set the power state
> >> appropriately */
> >
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2023-03-01 15:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 16:47 [Intel-gfx] [PATCH] drm/i915: Get HDR DPCD refresh timeout from VBT Ville Syrjala
2023-02-20 18:38 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
2023-02-20 21:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Get HDR DPCD refresh timeout from VBT (rev2) Patchwork
2023-02-21  0:19 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-03-01 14:55 ` [Intel-gfx] [PATCH] drm/i915: Get HDR DPCD refresh timeout from VBT Hogander, Jouni
2023-03-01 15:21   ` Jani Nikula
2023-03-01 15:51     ` Ville Syrjälä [this message]
2023-03-28 20:09 ` Lyude Paul
2023-03-29 10:13   ` Ville Syrjälä

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=Y/90fwlyYgwK3O6o@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox