1. 15 Nov, 2021 1 commit
  2. 12 Nov, 2021 1 commit
  3. 11 Nov, 2021 21 commits
  4. 10 Nov, 2021 1 commit
  5. 09 Nov, 2021 6 commits
    • Dan Carpenter's avatar
      drm/i915: pin: delete duplicate check in intel_pin_and_fence_fb_obj() · 6cff894e
      Dan Carpenter authored
      The "ret" variable is checked on the previous line so we know it's
      zero.  No need to check again.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211109114850.GB16587@kili
      6cff894e
    • Ville Syrjälä's avatar
      drm/i915: Call intel_update_active_dpll() for both bigjoiner pipes · c68dac96
      Ville Syrjälä authored
      Currently we're only calling intel_update_active_dpll() for the
      bigjoiner master pipe but not for the slave. With TC ports this
      leads to the two pipes end up trying to use different PLLs
      (TC vs. TBT). What's worse we're enabling the PLL that didn't get
      intel_update_active_dpll() called on it at the spot where we
      need the clocks turned on. So we turn on the wrong PLL and the
      DDI is now trying to source its clock from the other PLL which is
      still disabled. Naturally that doesn't end so well and the DDI
      fails to start up.
      
      The state checker also gets a bit unhappy (which is a good thing)
      when it notices that one of the pipes was using the wrong PLL.
      
      Let's fix this by remembering to call intel_update_active_dpll()
      for both pipes. That should get the correct PLL turned on when
      we need it, and the state checker should also be happy.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Manasi Navare <manasi.d.navare@intel.com>
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4434
      Fixes: e12d6218 ("drm/i915: Reduce bigjoiner special casing")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211105212156.5697-1-ville.syrjala@linux.intel.comReviewed-by: default avatarImre Deak <imre.deak@intel.com>
      c68dac96
    • Ville Syrjälä's avatar
      drm/i915: Use unlocked register accesses for LUT loads · 115e0f68
      Ville Syrjälä authored
      We have to bash in a lot of registers to load the higher
      precision LUT modes. The locking overhead is significant, especially
      as we have to get this done as quickly as possible during vblank.
      So let's switch to unlocked accesses for these. Fortunately the LUT
      registers are mostly spread around such that two pipes do not have
      any registers on the same cacheline. So as long as commits on the
      same pipe are serialized (which they are) we should get away with
      this without angering the hardware.
      
      The only exceptions are the PREC_PIPEGCMAX registers on ilk/snb which
      we don't use atm as they are only used in the 12bit gamma mode. If/when
      we add support for that we may need to remember to still serialize
      those registers, though I'm not sure ilk/snb are actually affected
      by the same cacheline issue. I think ivb/hsw at least were, but they
      use a different set of registers for the precision LUT.
      
      I have a test case which is updating the LUTs on two pipes from a
      single atomic commit. Running that in a loop for a minute I get the
      following worst case with the locks in place:
       intel_crtc_vblank_work_start: pipe B, frame=10037, scanline=1081
       intel_crtc_vblank_work_start: pipe A, frame=12274, scanline=769
       intel_crtc_vblank_work_end: pipe A, frame=12274, scanline=58
       intel_crtc_vblank_work_end: pipe B, frame=10037, scanline=74
      
      And here's the worst case with the locks removed:
       intel_crtc_vblank_work_start: pipe B, frame=5869, scanline=1081
       intel_crtc_vblank_work_start: pipe A, frame=7616, scanline=769
       intel_crtc_vblank_work_end: pipe B, frame=5869, scanline=1096
       intel_crtc_vblank_work_end: pipe A, frame=7616, scanline=777
      
      The test was done on a snb using the 10bit 1024 entry LUT mode.
      The vtotals for the two displays are 793 and 1125. So we can
      see that with the locks ripped out the LUT updates are pretty
      nicely confined within the vblank, whereas with the locks in
      place we're routinely blasting past the vblank end which causes
      visual artifacts near the top of the screen.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211020223339.669-5-ville.syrjala@linux.intel.comReviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      115e0f68
    • Ville Syrjälä's avatar
      drm/i915: Use vblank workers for gamma updates · 2bbc6fca
      Ville Syrjälä authored
      The pipe gamma registers are single buffered so they should only
      be updated during the vblank to avoid screen tearing. In fact they
      really should only be updated between start of vblank and frame
      start because that is the only time the pipe is guaranteed to be
      empty. Already at frame start the pipe begins to fill up with
      data for the next frame.
      
      Unfortunately frame start happens ~1 scanline after the start
      of vblank which in practice doesn't always leave us enough time to
      finish the gamma update in time (gamma LUTs can be several KiB of
      data we have to bash into the registers). However we must try our
      best and so we'll add a vblank work for each pipe from where we
      can do the gamma update. Additionally we could consider pushing
      frame start forward to the max of ~4 scanlines after start of
      vblank. But not sure that's exactly a validated configuration.
      As it stands the ~100 first pixels tend to make it through with
      the old gamma values.
      
      Even though the vblank worker is running on a high prority thread
      we still have to contend with C-states. If the CPU happens be in
      a deep C-state when the vblank interrupt arrives even the irq
      handler gets delayed massively (I've observed dozens of scanlines
      worth of latency). To avoid that problem we'll use the qos mechanism
      to keep the CPU awake while the vblank work is scheduled.
      
      With all this hooked up we can finally enjoy near atomic gamma
      updates. It even works across several pipes from the same atomic
      commit which previously was a total fail because we did the
      gamma updates for each pipe serially after waiting for all
      pipes to have latched the double buffered registers.
      
      In the future the DSB should take over this responsibility
      which will hopefully avoid some of these issues.
      
      Kudos to Lyude for finishing the actual vblank workers.
      Works like the proverbial train toilet.
      
      v2: Add missing intel_atomic_state fwd declaration
      v3: Clean up properly when not scheduling the worker
      v4: Clean up the rest and add tracepoints
      v5: s/intel_wait_for_vblank_works/intel_wait_for_vblank_workers/ (Jani,Uma)
      
      CC: Lyude Paul <lyude@redhat.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211020223339.669-4-ville.syrjala@linux.intel.comReviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      2bbc6fca
    • Ville Syrjälä's avatar
      drm/i915: Do vrr push before sampling the frame counter · 6f9976bd
      Ville Syrjälä authored
      Do the vrr push before we sample the frame counter to
      know when the commit has been latched. Doing these in the
      wrong order could lead us to complete the flip before it
      has actually happened.
      
      Cc: Manasi Navare <manasi.d.navare@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211020223339.669-3-ville.syrjala@linux.intel.comReviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      6f9976bd
    • William Tseng's avatar
      drm/i915/dsi: disable lpdt if it is not enabled · 38a1b50c
      William Tseng authored
      Avoid setting LP_DATA_TRANSFER when enable_lpdt is false
      
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
      Cc: Lee Shawn C <shawn.c.lee@intel.com>
      Cc: Cooper Chiou <cooper.chiou@intel.com>
      Signed-off-by: default avatarWilliam Tseng <william.tseng@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211109034125.11291-1-william.tseng@intel.com
      38a1b50c
  6. 08 Nov, 2021 1 commit
  7. 05 Nov, 2021 6 commits
  8. 04 Nov, 2021 3 commits