Re: [PATCH v2 2/2] drm/i915/intel_dsi: Read back pclk set by GOP and use that as pclk v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 19, 2018 at 03:49:15PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 19-10-18 11:20, Jani Nikula wrote:
> > On Wed, 17 Oct 2018, Hans de Goede <j.w.r.degoede@xxxxxxxxx> wrote:
> > > On BYT and CHT the GOP sometimes initializes the pclk at a (slightly)
> > > different frequency then the pclk which we've calculated.
> > > 
> > > This commit makes the DSI code read-back the pclk set by the GOP and
> > > if that is within a reasonable margin of the calculated pclk, uses
> > > that instead.
> > > 
> > > This fixes the first modeset being a full modeset instead of a
> > > fast modeset on systems where the GOP pclk is different.
> > 
> > I assume we don't do the fast path because intel_pipe_config_compare()
> > returns false due to crtc_clock and port_clock mismatch. The dmesg
> > should tell you the reason with drm.debugs enabled.
> 
> As I think I mentioned already last time (but that was a while ago,
> so I understand you cannot remember the details), the problem is these
> checks from intel_pipe_config_compare():
> 
>         PIPE_CONF_CHECK_X(dsi_pll.ctrl);
>         PIPE_CONF_CHECK_X(dsi_pll.div);
> 
> > Now, the clock checks are already "fuzzy", and should account for slight
> > variations. I think the goal was the same as here, plus IIUC we may lose
> > some accuracy on the hardware roundtrip.
> 
> The check I quoted above are basically doing a non-fuzzy port_clock check,
> we already do a fuzzy port_clock check, so maybe we should just drop them?
> 
> > Please try adding more tolerance in intel_fuzzy_clock_check() and see if
> > that helps. The code looks like it allows 5% diff, but it's 2.5%.
> > 
> > Regardless of whether we end up changing the tolerance or adjusting the
> > state based on the hardware readout or what, I think doing the
> > adjustment in intel_dsi_vbt.c init is the wrong place. We shouldn't have
> > anything that depends on accessing the hardware there. I believe that's
> > what Ville was trying to say in [1].
> 
> If you agree with dropping these 2 in essence non-fuzzy port-clock checks:
> 
>         PIPE_CONF_CHECK_X(dsi_pll.ctrl);
>         PIPE_CONF_CHECK_X(dsi_pll.div);
> 
> Then we won't need this state adjustment.
> 
> But in case you do want to keep these, then were should the adjustment be done?
> 
> Keep in mind that the pclk is initially calculated in intel_dsi_vbt.c
> and then immediately used to calculate a bunch of other settings such as
> intel_dsi->lp_byte_clk, prepare_cnt, etc. So there really is no other
> place were we can reasonably do this.

We still want to do these checks when validating a modeset afterwards, but
for the fuzzy case we need to cut them out indeed. Similar to what we do
for the some of the other fastboot registers already with the if (!adjust)
condition.

I guess the trick here is making sure we pick the right set of registers
... Maybe we want to make all the pll low-level state like that (so both
dsi_pll and dpll_hw_state)?

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux