1. 30 1月, 2019 4 次提交
  2. 22 1月, 2019 1 次提交
  3. 21 1月, 2019 1 次提交
  4. 15 1月, 2019 2 次提交
  5. 02 1月, 2019 1 次提交
  6. 22 12月, 2018 1 次提交
  7. 13 12月, 2018 2 次提交
  8. 12 12月, 2018 2 次提交
    • M
      drm/i915: Switch to level-based DDB allocation algorithm (v5) · d8e87498
      Matt Roper 提交于
      The DDB allocation algorithm currently used by the driver grants each
      plane a very small minimum allocation of DDB blocks and then divies up
      all of the remaining blocks based on the percentage of the total data
      rate that the plane makes up.  It turns out that this proportional
      allocation approach is overly-generous with the larger planes and can
      leave very small planes wthout a big enough allocation to even hit their
      level 0 watermark requirements (especially on APL, which has a smaller
      DDB in general than other gen9 platforms).  Or there can be situations
      where the smallest planes hit a lower watermark level than they should
      have been able to hit with a more equitable division of DDB blocks, thus
      limiting the overall system sleep state that can be achieved.
      
      The bspec now describes an alternate algorithm that can be used to
      overcome these types of issues.  With the new algorithm, we calculate
      all plane watermark values for all wm levels first, then go back and
      partition a pipe's DDB space second.  The DDB allocation will calculate
      what the highest watermark level that can be achieved on *all* active
      planes, and then grant the blocks necessary to hit that level to each
      plane.  Any remaining blocks are then divided up proportionally
      according to data rate, similar to the old algorithm.
      
      There was a previous attempt to implement this algorithm a couple years
      ago in bb9d85f6 ("drm/i915/skl: New ddb allocation algorithm"), but
      some regressions were reported, the patch was reverted, and nobody
      ever got around to figuring out exactly where the bug was in that
      version.  Our watermark code has evolved significantly in the meantime,
      but we're still getting bug reports caused by the unfair proportional
      algorithm, so let's give this another shot.
      
      v2:
       - Make sure cursor allocation stays constant and fixed at the end of
         the pipe allocation.
       - Fix some watermark level iterators that weren't handling the max
         level.
      
      v3:
       - Ensure we don't leave any DDB blocks unused by using DIV_ROUND_UP+min
         to calculate the extra blocks for each plane.  (Ville)
       - Replace a while() loop with a for() loop to be more consistent with
         surrounding code.  (Ville)
       - Clean unattainable watermark levels with memset rather than directly
         clearing the member fields.  Also do the same for the transition
         watermark values if they can't be achieved.  (Ville)
       - Drop min_disp_buf_needed calculations in skl_compute_plane_wm() since
         the results are no longer needed or used.  (Ville)
       - Drop skl_latency[0] != 0 sanity check; both watermark methods already
         account for an invalid 0 latency by returning FP_16_16_MAX.  (Ville)
      
      v4:
       - Break DDB allocation loop when total_data_rate=0 rather than
         alloc_size=0.  If total_data_rate has dropped to 0, all remaining
         planes are disabled, which isn't true for alloc_size (we might just
         have not had any remaining blocks to hand out).  Plus
         total_data_rate=0 is the case we need to avoid to a prevent a
         div-by-0.  (Ville)
       - s/DIV_ROUND_UP/DIV64_U64_ROUND_UP/ to prevent 32-bit breakage (Ville)
      
      v5:
       - Don't forget to move 'start' pointer forward for UV surface when
         setting plane DDB boundaries.  (Ville)
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105458Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181211173107.11068-2-matthew.d.roper@intel.com
      d8e87498
    • M
      drm/i915: Don't use DDB allocation when choosing gen9 watermark method · 9343bb24
      Matt Roper 提交于
      The bspec gives an if/else chain for choosing whether to use "method 1"
      or "method 2" for calculating the watermark "Selected Result Blocks"
      value for a plane.  One of the branches of the if chain is:
      
              "Else If ('plane buffer allocation' is known and (plane buffer
              allocation / plane blocks per line) >=1)"
      
      Since our driver currently calculates DDB allocations first and the
      actual watermark values second, the plane buffer allocation is known at
      this point in our code and we include this test in our driver's logic.
      However we plan to soon move to a "watermarks first, ddb allocation
      second" sequence where we won't know the DDB allocation at this point.
      Let's drop this arm of the if/else statement (effectively considering
      the DDB allocation unknown) as an independent patch so that any
      regressions can be more accurately bisected to either the different
      watermark value (in this patch) or the new DDB allocation (in the next
      patch).
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181211173107.11068-1-matthew.d.roper@intel.com
      9343bb24
  9. 11 12月, 2018 1 次提交
  10. 08 12月, 2018 3 次提交
  11. 29 11月, 2018 7 次提交
  12. 19 11月, 2018 1 次提交
    • V
      drm/i915: Disable LP3 watermarks on all SNB machines · 21556350
      Ville Syrjälä 提交于
      I have a Thinkpad X220 Tablet in my hands that is losing vblank
      interrupts whenever LP3 watermarks are used.
      
      If I nudge the latency value written to the WM3 register just
      by one in either direction the problem disappears. That to me
      suggests that the punit will not enter the corrsponding
      powersave mode (MPLL shutdown IIRC) unless the latency value
      in the register matches exactly what we read from SSKPD. Ie.
      it's not really a latency value but rather just a cookie
      by which the punit can identify the desired power saving state.
      On HSW/BDW this was changed such that we actually just write
      the WM level number into those bits, which makes much more
      sense given the observed behaviour.
      
      We could try to handle this by disallowing LP3 watermarks
      only when vblank interrupts are enabled but we'd first have
      to prove that only vblank interrupts are affected, which
      seems unlikely. Also we can't grab the wm mutex from the
      vblank enable/disable hooks because those are called with
      various spinlocks held. Thus we'd have to redesigne the
      watermark locking. So to play it safe and keep the code
      simple we simply disable LP3 watermarks on all SNB machines.
      
      To do that we simply zero out the latency values for
      watermark level 3, and we adjust the watermark computation
      to check for that. The behaviour now matches that of the
      g4x/vlv/skl wm code in the presence of a zeroed latency
      value.
      
      v2: s/USHRT_MAX/U32_MAX/ for consistency with the types (Chris)
      
      Cc: stable@vger.kernel.org
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101269
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103713Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181114173440.6730-1-ville.syrjala@linux.intel.com
      (cherry picked from commit 03981c6e)
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      21556350
  13. 16 11月, 2018 1 次提交
    • V
      drm/i915: Disable LP3 watermarks on all SNB machines · 03981c6e
      Ville Syrjälä 提交于
      I have a Thinkpad X220 Tablet in my hands that is losing vblank
      interrupts whenever LP3 watermarks are used.
      
      If I nudge the latency value written to the WM3 register just
      by one in either direction the problem disappears. That to me
      suggests that the punit will not enter the corrsponding
      powersave mode (MPLL shutdown IIRC) unless the latency value
      in the register matches exactly what we read from SSKPD. Ie.
      it's not really a latency value but rather just a cookie
      by which the punit can identify the desired power saving state.
      On HSW/BDW this was changed such that we actually just write
      the WM level number into those bits, which makes much more
      sense given the observed behaviour.
      
      We could try to handle this by disallowing LP3 watermarks
      only when vblank interrupts are enabled but we'd first have
      to prove that only vblank interrupts are affected, which
      seems unlikely. Also we can't grab the wm mutex from the
      vblank enable/disable hooks because those are called with
      various spinlocks held. Thus we'd have to redesigne the
      watermark locking. So to play it safe and keep the code
      simple we simply disable LP3 watermarks on all SNB machines.
      
      To do that we simply zero out the latency values for
      watermark level 3, and we adjust the watermark computation
      to check for that. The behaviour now matches that of the
      g4x/vlv/skl wm code in the presence of a zeroed latency
      value.
      
      v2: s/USHRT_MAX/U32_MAX/ for consistency with the types (Chris)
      
      Cc: stable@vger.kernel.org
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101269
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103713Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181114173440.6730-1-ville.syrjala@linux.intel.com
      03981c6e
  14. 13 11月, 2018 1 次提交
  15. 10 11月, 2018 1 次提交
  16. 09 11月, 2018 1 次提交
  17. 06 11月, 2018 1 次提交
  18. 02 11月, 2018 2 次提交
  19. 30 10月, 2018 2 次提交
  20. 24 10月, 2018 4 次提交
  21. 16 10月, 2018 1 次提交