Skip to content
  1. Jun 27, 2019
    • Chris Wilson's avatar
      drm/i915: Only recover active engines · 18398904
      Chris Wilson authored
      If we issue a reset to a currently idle engine, leave it idle
      afterwards. This is useful to excise a linkage between reset and the
      shrinker. When waking the engine, we need to pin the default context
      image which we use for overwriting a guilty context -- if the engine is
      idle we do not need this pinned image! However, this pinning means that
      waking the engine acquires the FS_RECLAIM, and so may trigger the
      shrinker. The shrinker itself may need to wait upon the GPU to unbind
      and object and so may require services of reset; ergo we should avoid
      the engine wake up path.
      
      The danger in skipping the recovery for idle engines is that we leave the
      engine with no context defined, which may interfere with the operation of
      the power context on some older platforms. In practice, we should only
      be resetting an active GPU but it something to look out for on Ironlake
      (if memory serves).
      
      Fixes: 79ffac85
      
       ("drm/i915: Invert the GEM wakeref hierarchy")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190626154549.10066-2-chris@chris-wilson.co.uk
      18398904
    • Chris Wilson's avatar
      drm/i915: Add a wakeref getter for iff the wakeref is already active · de5147b8
      Chris Wilson authored
      
      
      For use in the next patch, we want to acquire a wakeref without having
      to wake the device up -- i.e. only acquire the engine wakeref if the
      engine is already active.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190626154549.10066-1-chris@chris-wilson.co.uk
      de5147b8
    • Ville Syrjälä's avatar
      drm/i915: Initialize drm_driver vblank funcs at compile time · 7d23e593
      Ville Syrjälä authored
      
      
      Move the .get_vblank_timestamp() and .get_scanout_position()
      initialization to happen at compile time. No point in delaying
      it since we always assign the same functions.
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190619170842.20579-5-ville.syrjala@linux.intel.com
      7d23e593
    • Ville Syrjälä's avatar
      drm/i915: Nuke drm_driver irq vfuncs · b318b824
      Ville Syrjälä authored
      
      
      Stop using the irq vfuncs under drm_driver. That's not going to fly
      in a mixed gen environment since the structure is shared between all
      the devices.
      
      v2: Allow intel_irq_uninstall() to be called twice due to
          intel_modeset_cleanup() calling it as well. Toss in a
          FIXME to remind us that this is not great.
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190620103334.15651-1-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      b318b824
    • Ville Syrjälä's avatar
      drm/i915: Switch to per-crtc vblank vfuncs · 08fa8fd0
      Ville Syrjälä authored
      
      
      Switch from the driver-wide vblank vfuncs to the per-crtc ones so that
      we don't have so many platform specific vfuncs in the driver struct.
      
      We still need to do something about the rest fo the irq vfuncs...
      
      v2: s/INTEL_GEN>=3/IS_GEN3/
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190619170842.20579-3-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      08fa8fd0
    • Ville Syrjälä's avatar
      drm/i915: Fix various tracepoints for gen2 · 4c888e7b
      Ville Syrjälä authored
      Gen2 doesn't have a frame counter and apparently we no longer provide
      a fake .get_vblank_counter() hook for it. That means all tracepoints
      calling that hook will oops. Update the tracepoints to use
      intel_crtc_get_vblank_counter() which will gracefully fall back to
      using the software counter. This is actually a better approach since
      we now get (hopefully accurate) frame numbers in the traces.
      
      This also gets rid of the raw driver->get_vblank_counter() calls, which
      we need to do in order to switch to the per-crtc vblank vfuncs.
      
      v2: Deal with new tracepoints
      v3: Use a distinct variable name for the internal crtc iterator (Chris)
      
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Fixes: 967dd484
      
       ("drm: remove drm_vblank_no_hw_counter assignment from driver code")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190619170842.20579-2-ville.syrjala@linux.intel.com
      4c888e7b
  2. Jun 26, 2019
  3. Jun 25, 2019
  4. Jun 24, 2019
    • Chris Wilson's avatar
      drm/i915/execlists: Always clear ring_pause if we do not submit · 8db7933e
      Chris Wilson authored
      
      
      In the unlikely case (thank you CI!), we may find ourselves wanting to
      issue a preemption but having no runnable requests left. In this case,
      we set the semaphore before computing the preemption and so must unset
      it before forgetting (or else we leave the machine busywaiting until the
      next request comes along and so likely hang).
      
      v2: Replace readback with only a wmb after asserting the semaphore
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190624092009.30189-1-chris@chris-wilson.co.uk
      8db7933e
  5. Jun 22, 2019
    • Chris Wilson's avatar
      drm/i915/blt: Remove recursive vma->lock · b2dbf8d9
      Chris Wilson authored
      
      
      As we have already plugged the w->dma into the reservation_object, and
      have set ourselves up to automatically signal the request and w->dma on
      completion, we do not need to export the rq->fence directly and just use
      the w->dma fence.
      
      This avoids having to take the reservation_lock inside the worker which
      cross-release lockdep would complain about. :)
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190621215733.12070-1-chris@chris-wilson.co.uk
      b2dbf8d9
    • Chris Wilson's avatar
      drm/i915: Local debug BUG_ON for intel_wakeref · fb993aa7
      Chris Wilson authored
      
      
      Avoid pulling in i915_gem.h just so that we can use a conditional BUG_ON
      for debugging.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190621183801.23252-5-chris@chris-wilson.co.uk
      fb993aa7
    • Chris Wilson's avatar
      drm/i915: Provide an i915_active.acquire callback · 12c255b5
      Chris Wilson authored
      
      
      If we introduce a callback for i915_active that is only called the first
      time we use the i915_active and is symmetrically paired with the
      i915_active.retire callback, we can replace the open-coded and
      non-atomic implementations -- which will be very fragile (i.e. broken)
      upon removing the struct_mutex serialisation.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190621183801.23252-4-chris@chris-wilson.co.uk
      12c255b5
    • Chris Wilson's avatar
      drm/i915: Throw away the active object retirement complexity · a93615f9
      Chris Wilson authored
      
      
      Remove the accumulated optimisations that we have for i915_vma_retire
      and reduce it to the bare essential of tracking the active object
      reference. This allows us to only use atomic operations, and so will be
      able to avoid the struct_mutex requirement.
      
      The principal loss here is the shrinker MRU bumping, so now if we have
      to shrink, we will do so in much more random order and more likely to
      try and shrink recently used objects. That is a nuisance, but shrinking
      active objects is a second step we try to avoid and will always be a
      system-wide performance issue.
      
      The other loss is here is in the automatic pruning of the
      reservation_object when idling. This is not as large an issue as upon
      reservation_object introduction as now adding new fences into the object
      replaces already signaled fences, keeping the array compact. But we do
      lose the auto-expiration of stale fences and unused arrays. That may be
      a noticeable problem for which we need to re-implement autopruning.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190621183801.23252-3-chris@chris-wilson.co.uk
      a93615f9
    • Chris Wilson's avatar
      drm/i915: Track i915_active using debugobjects · 5361db1a
      Chris Wilson authored
      
      
      Provide runtime asserts and tracking of i915_active via debugobjects.
      For example, this should allow us to check that the i915_active is only
      active when we expect it to be and is never freed too early.
      
      One consequence is that, for simplicity, we no longer allow i915_active
      to be on-stack which only affected the selftests.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190621183801.23252-2-chris@chris-wilson.co.uk
      5361db1a
    • Chris Wilson's avatar
      drm/i915: Remove waiting & retiring from shrinker paths · 9e953980
      Chris Wilson authored
      
      
      i915_gem_wait_for_idle() and i915_retire_requests() introduce a
      dependency on the timeline->mutex. This is problematic as we want to
      later perform allocations underneath i915_active.mutex, forming a link
      between the shrinker, the timeline and active mutexes. Nip this cycle in
      the bud by removing the acquisition of the timeline mutex (i.e.
      retiring) from inside the shrinker.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190621183801.23252-1-chris@chris-wilson.co.uk
      9e953980
    • Daniele Ceraolo Spurio's avatar
      drm/i915/guc: handle GuC messages received with CTB disabled · 2ae70d28
      Daniele Ceraolo Spurio authored
      
      
      There is a very small chance of triggering a log flush event when
      enabling or disabling CT buffers. Events triggered while CT buffers
      are disabled are logged in the SCRATCH_15 register using the same bits
      used in the CT message payload. Since our communication channel with
      GuC is turned off, we can save the message and handle it after we turn
      it back on.
      GuC should be idle and not generate more events in the meantime because
      we're not talking to it.
      
      v2: clear the mmio register on stop_communication as well (Chris)
      
      Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190621182123.31368-2-daniele.ceraolospurio@intel.com
      2ae70d28
    • Daniele Ceraolo Spurio's avatar
      drm/i915/guc: reorder enable/disable communication steps · e29cc1d7
      Daniele Ceraolo Spurio authored
      
      
      Make sure we always have CT buffers enabled when the interrupts are
      enabled, so we can always handle interrupts from GuC. Also move the
      setting of the guc->send and guc->handler functions to the GuC
      communication control functions for consistency.
      
      The reorder also fixes the onion unwinding of intel_uc_init_hw, because
      guc_enable_communication would've left interrupts enabled when failing
      to enable CTB.
      
      v2: always retunr the result of ctch_enable() in
          intel_guc_ct_enable() (Michal)
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110943
      Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Reviewed-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190621182123.31368-1-daniele.ceraolospurio@intel.com
      e29cc1d7
  6. Jun 21, 2019