1. 18 3月, 2015 14 次提交
    • V
      drm/i915: Rewrite VLV/CHV watermark code · ae80152d
      Ville Syrjälä 提交于
      Assuming the PND deadline mechanism works reasonably we should do
      memory requests as early as possible so that PND has schedule the
      requests more intelligently. Currently we're still calculating
      the watermarks as if VLV/CHV are identical to g4x, which isn't
      the case.
      
      The current code also seems to calculate insufficient watermarks
      and hence we're seeing some underruns, especially on high resolution
      displays.
      
      To fix it just rip out the current code and replace is with something
      that tries to utilize PND as efficiently as possible.
      
      We now calculate the WM watermark to trigger when the FIFO still has
      256us worth of data. 256us is the maximum deadline value supoorted by
      PND, so issuing memory requests earlier would mean we probably couldn't
      utilize the full FIFO as PND would attempt to return the data at
      least in at least 256us. We also clamp the watermark to at least 8
      cachelines as that's the magic watermark that enabling trickle feed
      would also impose. I'm assuming it matches some burst size.
      
      In theory we could just enable trickle feed and ignore the WM values,
      except trickle feed doesn't work with max fifo mode anyway, so we'd
      still need to calculate the SR watermarks. It seems cleaner to just
      disable trickle feed and calculate all watermarks the same way. Also
      trickle feed wouldn't account for the 256us max deadline value, thoguh
      that may be a moot point in non-max fifo mode sicne the FIFOs are fairly
      small.
      
      On VLV max fifo mode can be used with either primary or sprite planes.
      So the code now also checks all the planes (apart from the cursor)
      when calculating the SR plane watermark.
      
      We don't have to worry about the WM1 watermarks since we're using the
      PND deadline scheme which means the hardware ignores WM1 values.
      
      v2: Use plane->state->fb instead of plane->fb
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ae80152d
    • M
      drm/i915: Use crtc->state->active in ilk/skl watermark calculations (v3) · 3ef00284
      Matt Roper 提交于
      Existing watermark code calls intel_crtc_active() to determine whether a CRTC
      is active for the purpose of watermark calculations (and bails out early if it
      determines the CRTC is not active).  However intel_crtc_active() only returns
      true if crtc->primary->fb is non-NULL, which isn't appropriate in the modern
      age of universal planes and atomic modeset since userspace can now disable the
      primary plane, but leave the CRTC (and other planes) running.
      
      Note that commit
      
              commit 0fda6568
              Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
              Date:   Fri Feb 27 15:12:35 2015 +0000
      
                  drm/i915/skl: Update watermarks for Y tiling
      
      adds a test for primary plane enable/disable to trigger a watermark update
      (previously we ignored updates to primary planes, which wasn't really correct,
      but we got lucky since we always pretended the primary plane was on).  Tvrtko's
      patch tries to update watermarks when we re-enable the primary plane, but that
      watermark computation gets aborted early because intel_crtc_active() returns
      false due to the disabled primary plane.
      
      Switch the ILK and SKL watermark code over to use crtc->state->active rather
      than calling intel_crtc_active() so that we'll properly compute watermarks when
      re-enabling the primary plane.
      
      Note that this commit doesn't touch callsites in the watermark code for
      older platforms since there were concerns that doing so would lead to
      other types of breakage.
      
      Also note that all of the watermark calculation at the moment takes place after
      new crtc/plane states are swapped into the DRM objects.  This will change in
      the future, so we'll be working with in-flight state objects, but for the time
      being, crtc->state is what we want to operate on.
      
      v2: Don't drop primary->fb check from intel_crtc_active(), but rather replace
          ILK/SKL callsites with direct tests of crtc->state->active.  There is
          concern that messing with intel_crtc_active() will lead to other breakage for
          old hardware platforms.  (Ville)
      
      v3: Use intel_crtc->active for now rather than crtc->state->active since
          we don't have CRTC states properly hooked up and initialized yet.
          We'll defer the switch to crtc->state->active until the atomic CRTC
          state work is farther along. (Ville)
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3ef00284
    • V
      drm/i915: Make sure PND deadline mode is enabled on VLV/CHV · c6beb13e
      Ville Syrjälä 提交于
      Poke at the CBR1_VLV register during init_clock_gating to make sure the
      PND deadline scheme is used.
      
      The hardware has two modes of operation wrt. watermarks:
      
      1) PND deadline mode:
       - memory request deadline is calculated from actual FIFO level * DDL
       - WM1 watermark values are unused (AFAIK)
       - WM watermark level defines when to start fetching data from memory
         (assuming trickle feed is not used)
      
      2) backup mode
       - deadline is based on FIFO status, DDL is unused
       - FIFO split into three regions with WM and WM1 watermarks, each
         part specifying a different FIFO status
      
      We want to use the PND deadline mode, so let's make sure the chicken
      bit is in the correct position on init.
      
      Also take the opportunity to refactor the shared code between VLV and
      CHV to a shared function.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c6beb13e
    • V
      drm/i915: Read out display FIFO size on VLV/CHV · b5004720
      Ville Syrjälä 提交于
      VLV/CHV have similar DSPARB registers as older platforms, just more of
      them due to more planes. Add a bit of code to read out the current FIFO
      split from the registers. Will be useful later when we improve the WM
      calculations.
      
      v2: Add display_mmio_offset to DSPARB
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b5004720
    • V
      drm/i915: Pass plane to vlv_compute_drain_latency() · 883a3d2f
      Ville Syrjälä 提交于
      Now that we have drm_planes for the cursor and primary we can move the
      pixel_size handling into vlv_compute_drain_latency() and just pass the
      appropriate plane to it.
      
      v2: Check plane->state->fb instead of plane->fb
      
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v1)
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      [danvet: Resolve conflict with Matt's s/plane->fb/plane->state->fb/
      patch.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      883a3d2f
    • V
      drm/i915: Reorganize VLV DDL setup · 0018fda1
      Ville Syrjälä 提交于
      Introduce struct vlv_wm_values to house VLV watermark/drain latency
      values. We start by using it when computing the drain latency values.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0018fda1
    • V
      drm/i915: Hide VLV DDL precision handling · 341c526f
      Ville Syrjälä 提交于
      Move the DDL precision handling into vlv_compute_drain_latency() so the
      callers don't have to duplicate the same code to deal with it.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      341c526f
    • V
      drm/i915: Simplify VLV drain latency computation · abfc00b5
      Ville Syrjälä 提交于
      The current drain lantency computation relies on hardcoded limits to
      determine when the to use the low vs. high precision multiplier.
      Rewrite the code to use a more straightforward approach.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      abfc00b5
    • V
      drm/i915: Kill DRAIN_LATENCY_PRECISION_* defines · 12030516
      Ville Syrjälä 提交于
      Kill the silly DRAIN_LATENCY_PRECISION_* defines and just use the raw
      number instead.
      
      v2: Move the sprite 32/16 -> 16/8 preision multiplier
          change to another patch (Jesse)
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      12030516
    • V
      drm/i915: Reduce CHV DDL multiplier to 16/8 · edf60560
      Ville Syrjälä 提交于
      Apparently we must yet halve the DDL drain latency from what we're
      using currently. This little nugget is not in any spec, but came
      down through the grapevine.
      
      This makes the displays a bit more stable. Not quite fully stable but at
      least they don't fall over immediately on driver load.
      
      v2: Update high_precision in valleyview_update_sprite_wm() too (Jesse)
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      edf60560
    • J
      drm/i915: Remove ironlake rc6 support · a5611654
      John Harrison 提交于
      Apparently, this has never worked reliably and is currently disabled. Also, the
      gains are not particularly impressive. Thus rather than try to keep unused code
      from decaying and having to update it for other driver changes, it was decided
      to simply remove it.
      
      For: VIZ-5115
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a5611654
    • D
      drm/i915: Make for_each_plane() take dev_priv as argument · dd740780
      Damien Lespiau 提交于
      Implicit usage of local variables in macros isn't exactly the greatest
      thing in the world, especially when that variable is the drm device and
      we want to move towards a broader use of the i915 device structure.
      
      Let's make for_each_plane() take dev_priv as its first argument then.
      Suggested-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: Chris Wilson <chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      dd740780
    • M
      drm/i915: Use plane->state->fb in watermark code (v2) · 59bea882
      Matt Roper 提交于
      plane->fb is a legacy pointer that not always be up-to-date (or updated
      early enough).  Make sure the watermark code uses plane->state->fb so
      that we're always doing our calculations based on the correct
      framebuffers.
      
      This patch was generated by Coccinelle with the following semantic
      patch:
      
              @@
              struct drm_plane *P;
              @@
              - P->fb
              + P->state->fb
      
      v2: Rebase
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      59bea882
    • M
      drm/i915: Kill intel_crtc->cursor_{width, height} (v2) · 3dd512fb
      Matt Roper 提交于
      The cursor size fields in intel_crtc just duplicate the data from
      cursor->state.crtc_{w,h} so we don't need them any more.  Worse, their
      use in the watermark code actually introduces a subtle bug since they
      don't get updated to mirror the state values until the plane commit
      stage, which is *after* we've already used them to calculate new
      watermark values.  This happens because we had to move watermark updates
      slightly earlier (outside vblank evasion) in commit
      
              commit 32b7eeec
              Author: Matt Roper <matthew.d.roper@intel.com>
              Date:   Wed Dec 24 07:59:06 2014 -0800
      
                  drm/i915: Refactor work that can sleep out of commit (v7)
      
      Dropping the intel_crtc fields and just using the state values (which
      are properly updated by the time watermark updates happen) should solve
      the problem.
      
      Aside from the actual removal of the struct fields (which are formatted
      in a way that I couldn't figure out how to match in Coccinelle), the
      rest of this patch was generated via the following semantic patch:
      
              // Drop assignment
              @@
              struct intel_crtc *C;
              struct drm_plane_state S;
              @@
              (
              - C->cursor_width = S.crtc_w;
              |
              - C->cursor_height = S.crtc_h;
              )
      
              // Replace usage
              @@
              struct intel_crtc *C;
              expression E;
              @@
              (
              - C->cursor_width
              + C->base.cursor->state->crtc_w
              |
              - C->cursor_height
              + C->base.cursor->state->crtc_h
              |
              - to_intel_crtc(E)->cursor_width
              + E->cursor->state->crtc_w
              |
              - to_intel_crtc(E)->cursor_height
              + E->cursor->state->crtc_h
              )
      
      v2: Rebase
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Joe Konno <joe.konno@linux.intel.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89346Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3dd512fb
  2. 28 2月, 2015 2 次提交
  3. 25 2月, 2015 1 次提交
  4. 14 2月, 2015 13 次提交
  5. 11 2月, 2015 1 次提交
  6. 31 1月, 2015 1 次提交
  7. 27 1月, 2015 8 次提交