1. 12 Dec, 2018 2 commits
  2. 11 Dec, 2018 3 commits
    • Matt Roper's avatar
      drm/i915: Switch to level-based DDB allocation algorithm (v5) · d8e87498
      Matt Roper authored
      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: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181211173107.11068-2-matthew.d.roper@intel.com
      d8e87498
    • Matt Roper's avatar
      drm/i915: Don't use DDB allocation when choosing gen9 watermark method · 9343bb24
      Matt Roper authored
      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: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181211173107.11068-1-matthew.d.roper@intel.com
      9343bb24
    • Clint Taylor's avatar
      drm/i915/hdmi: SCDC Scrambling enable without CTS mode · ab2cb2cb
      Clint Taylor authored
      Setting the SCDC scrambling CTS mode causes HDMI Link Layer protocol tests
      HF1-12 and HF1-13 to fail.
      
      V2: Removed "Source Shall" entries to a new patch
      V3: Rebase to drm-tip
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107895
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107896Signed-off-by: default avatarClint Taylor <clinton.a.taylor@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1544482374-26507-1-git-send-email-clinton.a.taylor@intel.com
      ab2cb2cb
  3. 10 Dec, 2018 2 commits
  4. 07 Dec, 2018 9 commits
  5. 06 Dec, 2018 9 commits
  6. 05 Dec, 2018 2 commits
  7. 04 Dec, 2018 13 commits