1. 29 1月, 2016 3 次提交
    • T
      drm/i915: Fix premature LRC unpin in GuC mode · f4e2dece
      Tvrtko Ursulin 提交于
      In GuC mode LRC pinning lifetime depends exclusively on the
      request liftime. Since that is terminated by the seqno update
      that opens up a race condition between GPU finishing writing
      out the context image and the driver unpinning the LRC.
      
      To extend the LRC lifetime we will employ a similar approach
      to what legacy ringbuffer submission does.
      
      We will start tracking the last submitted context per engine
      and keep it pinned until it is replaced by another one.
      
      Note that the driver unload path is a bit fragile and could
      benefit greatly from efforts to unify the legacy and exec
      list submission code paths.
      
      At the moment i915_gem_context_fini has special casing for the
      two which are potentialy not needed, and also depends on
      i915_gem_cleanup_ringbuffer running before itself.
      
      v2:
       * Move pinning into engine->emit_request and actually fix
         the reference/unreference logic. (Chris Wilson)
      
       * ring->dev can be NULL on driver unload so use a different
         route towards it.
      
      v3:
       * Rebase.
       * Handle the reset path. (Chris Wilson)
       * Exclude default context from the pinning - it is impossible
         to get it right before default context special casing in
         general is eliminated.
      
      v4:
       * Rebased & moved context tracking to
         intel_logical_ring_advance_and_submit.
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Issue: VIZ-4277
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Nick Hoath <nicholas.hoath@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1453976997-25424-1-git-send-email-tvrtko.ursulin@linux.intel.com
      f4e2dece
    • T
      drm/i915: Make LRC pinning own a reference to the context · 321fe304
      Tvrtko Ursulin 提交于
      Will simplify the following fix and sounds logical.
      
      v2: Add some whitespace to separate logic better. (Chris Wilson)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Nick Hoath <nicholas.hoath@intel.com>
      321fe304
    • T
      drm/i915: Make LRC (un)pinning work on context and engine · e5292823
      Tvrtko Ursulin 提交于
      Previously intel_lr_context_(un)pin were operating on requests
      which is in conflict with their names.
      
      If we make them take a context and an engine, it makes the names
      make more sense and it also makes future fixes possible.
      
      v2: Rebase for default_context/kernel_context change.
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Nick Hoath <nicholas.hoath@intel.com>
      e5292823
  2. 25 1月, 2016 2 次提交
  3. 21 1月, 2016 5 次提交
  4. 18 1月, 2016 3 次提交
  5. 15 1月, 2016 1 次提交
  6. 13 1月, 2016 3 次提交
  7. 12 1月, 2016 1 次提交
  8. 09 1月, 2016 1 次提交
  9. 07 1月, 2016 3 次提交
  10. 05 1月, 2016 3 次提交
  11. 30 12月, 2015 1 次提交
  12. 21 12月, 2015 1 次提交
  13. 12 12月, 2015 1 次提交
    • D
      drm/i915: mark GEM object pages dirty when mapped & written by the CPU · 033908ae
      Dave Gordon 提交于
      In various places, a single page of a (regular) GEM object is mapped into
      CPU address space and updated. In each such case, either the page or the
      the object should be marked dirty, to ensure that the modifications are
      not discarded if the object is evicted under memory pressure.
      
      The typical sequence is:
      	va = kmap_atomic(i915_gem_object_get_page(obj, pageno));
      	*(va+offset) = ...
      	kunmap_atomic(va);
      
      Here we introduce i915_gem_object_get_dirty_page(), which performs the
      same operation as i915_gem_object_get_page() but with the side-effect
      of marking the returned page dirty in the pagecache.  This will ensure
      that if the object is subsequently evicted (due to memory pressure),
      the changes are written to backing store rather than discarded.
      
      Note that it works only for regular (shmfs-backed) GEM objects, but (at
      least for now) those are the only ones that are updated in this way --
      the objects in question are contexts and batchbuffers, which are always
      shmfs-backed.
      
      Separate patches deal with the cases where whole objects are (or may
      be) dirtied.
      
      v3: Mark two more pages dirty in the page-boundary-crossing
          cases of the execbuffer relocation code [Chris Wilson]
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449773486-30822-2-git-send-email-david.s.gordon@intel.comReviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      033908ae
  14. 10 12月, 2015 1 次提交
  15. 05 12月, 2015 1 次提交
  16. 03 12月, 2015 1 次提交
    • N
      drm/i915: Extend LRC pinning to cover GPU context writeback · 6d65ba94
      Nick Hoath 提交于
      Use the first retired request on a new context to unpin
      the old context. This ensures that the hw context remains
      bound until it has been written back to by the GPU.
      Now that the context is pinned until later in the request/context
      lifecycle, it no longer needs to be pinned from context_queue to
      retire_requests.
      This fixes an issue with GuC submission where the GPU might not
      have finished writing back the context before it is unpinned. This
      results in a GPU hang.
      
      v2: Moved the new pin to cover GuC submission (Alex Dai)
          Moved the new unpin to request_retire to fix coverage leak
      v3: Added switch to default context if freeing a still pinned
          context just in case the hw was actually still using it
      v4: Unwrapped context unpin to allow calling without a request
      v5: Only create a switch to idle context if the ring doesn't
          already have a request pending on it (Alex Dai)
          Rename unsaved to dirty to avoid double negatives (Dave Gordon)
          Changed _no_req postfix to __ prefix for consistency (Dave Gordon)
          Split out per engine cleanup from context_free as it
          was getting unwieldy
          Corrected locking (Dave Gordon)
      v6: Removed some bikeshedding (Mika Kuoppala)
          Added explanation of the GuC hang that this fixes (Daniel Vetter)
      v7: Removed extra per request pinning from ring reset code (Alex Dai)
          Added forced ring unpin/clean in error case in context free (Alex Dai)
      Signed-off-by: NNick Hoath <nicholas.hoath@intel.com>
      Issue: VIZ-4277
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Gordon <david.s.gordon@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Alex Dai <yu.dai@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NAlex Dai <yu.dai@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6d65ba94
  17. 20 11月, 2015 1 次提交
  18. 18 11月, 2015 6 次提交
  19. 29 10月, 2015 2 次提交