1. 06 Jul, 2018 24 commits
  2. 05 Jul, 2018 8 commits
  3. 04 Jul, 2018 4 commits
  4. 03 Jul, 2018 2 commits
  5. 02 Jul, 2018 2 commits
    • Tarun Vyas's avatar
      drm/i915: Wait for PSR exit before checking for vblank evasion · a6089879
      Tarun Vyas authored
      The PIPEDSL freezes on PSR entry and if PSR hasn't fully exited, then
      the pipe_update_start call schedules itself out to check back later.
      
      On ChromeOS-4.4 kernel, which is fairly up-to-date w.r.t drm/i915 but
      lags w.r.t core kernel code, hot plugging an external display triggers
      tons of "potential atomic update errors" in the dmesg, on *pipe A*. A
      closer analysis reveals that we try to read the scanline 3 times and
      eventually timeout, b/c PSR hasn't exited fully leading to a PIPEDSL
      stuck @ 1599. This issue is not seen on upstream kernels, b/c for *some*
      reason we loop inside intel_pipe_update start for ~2+ msec which in this
      case is more than enough to exit PSR fully, hence an *unstuck* PIPEDSL
      counter, hence no error. On the other hand, the ChromeOS kernel spends
      ~1.1 msec looping inside intel_pipe_update_start and hence errors out
      b/c the source is still in PSR.
      
      Regardless, we should wait for PSR exit (if PSR is disabled, we incur
      a ~1-2 usec penalty) before reading the PIPEDSL, b/c if we haven't
      fully exited PSR, then checking for vblank evasion isn't actually
      applicable.
      
      v4: Comment explaining psr_wait after enabling VBL interrupts (DK)
      
      v5: CAN_PSR() to handle platforms that don't support PSR.
      
      v6: Handle local_irq_disable on early return (Chris)
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Signed-off-by: default avatarTarun Vyas <tarun.vyas@intel.com>
      Signed-off-by: default avatarDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180627200250.1515-2-tarun.vyas@intel.com
      a6089879
    • Tarun Vyas's avatar
      drm/i915/psr: Lockless version of psr_wait_for_idle · c43dbcbb
      Tarun Vyas authored
      This is a lockless version of the exisiting psr_wait_for_idle().
      We want to wait for PSR to idle out inside intel_pipe_update_start.
      At the time of a pipe update, we should never race with any psr
      enable or disable code, which is a part of crtc enable/disable.
      The follow up patch will use this lockless wait inside pipe_update_
      start to wait for PSR to idle out before checking for vblank evasion.
      We need to keep the wait in pipe_update_start to as less as it can be.
      So,we can live and flourish w/o taking any psr locks at all.
      
      Even if psr is never enabled, psr2_enabled will be false and this
      function will wait for PSR1 to idle out, which should just return
      immediately, so a very short (~1-2 usec) wait for cases where PSR
      is disabled.
      
      v2: Add comment to explain the 25msec timeout (DK)
      
      v3: Rename psr_wait_for_idle to __psr_wait_for_idle_locked to avoid
          naming conflicts and propagate err (if any) to the caller (Chris)
      
      v5: Form a series with the next patch
      
      v7: Better explain the need for lockless wait and increase the max
          timeout to handle refresh rates < 60 Hz (Daniel Vetter)
      
      v8: Rebase
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Signed-off-by: default avatarTarun Vyas <tarun.vyas@intel.com>
      Signed-off-by: default avatarDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180627200250.1515-1-tarun.vyas@intel.com
      c43dbcbb