1. 09 May, 2020 2 commits
  2. 08 May, 2020 5 commits
  3. 07 May, 2020 7 commits
  4. 06 May, 2020 1 commit
  5. 05 May, 2020 6 commits
  6. 04 May, 2020 15 commits
  7. 03 May, 2020 1 commit
  8. 01 May, 2020 3 commits
    • Chris Wilson's avatar
      drm/i915/gem: Try an alternate engine for relocations · 6f576d62
      Chris Wilson authored
      If at first we don't succeed, try try again.
      
      Not all engines may support the MI ops we need to perform asynchronous
      relocation patching, and so we end up falling back to a synchronous
      operation that has a liability of blocking. However, Tvrtko pointed out
      we don't need to use the same engine to perform the relocations as we
      are planning to execute the execbuf on, and so if we switch over to a
      working engine, we can perform the relocation asynchronously. The user
      execbuf will be queued after the relocations by virtue of fencing.
      
      This patch creates a new context per execbuf requiring asynchronous
      relocations on an unusable engines. This is perhaps a bit excessive and
      can be ameliorated by a small context cache, but for the moment we only
      need it for working around a little used engine on Sandybridge, and only
      if relocations are actually required to an active batch buffer.
      
      Now we just need to teach the relocation code to handle physical
      addressing for gen2/3, and we should then have universal support!
      Suggested-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Testcase: igt/gem_exec_reloc/basic-spin # snb
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200501192945.22215-3-chris@chris-wilson.co.uk
      6f576d62
    • Chris Wilson's avatar
      drm/i915/gem: Use a single chained reloc batches for a single execbuf · 0e97fbb0
      Chris Wilson authored
      As we can now keep chaining together a relocation batch to process any
      number of relocations, we can keep building that relocation batch for
      all of the target vma. This avoiding emitting a new request into the
      ring for each target, consuming precious ring space and a potential
      stall.
      
      v2: Propagate the failure from submitting the relocation batch.
      
      Testcase: igt/gem_exec_reloc/basic-wide-active
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200501192945.22215-2-chris@chris-wilson.co.uk
      0e97fbb0
    • Chris Wilson's avatar
      drm/i915/gem: Use chained reloc batches · 964a9b0f
      Chris Wilson authored
      The ring is a precious resource: we anticipate to only use a few hundred
      bytes for a request, and only try to reserve that before we start. If we
      go beyond our guess in building the request, then instead of waiting at
      the start of execbuf before we hold any locks or other resources, we
      may trigger a wait inside a critical region. One example is in using gpu
      relocations, where currently we emit a new MI_BB_START from the ring
      every time we overflow a page of relocation entries. However, instead of
      insert the command into the precious ring, we can chain the next page of
      relocation entries as MI_BB_START from the end of the previous.
      
      v2: Delay the emit_bb_start until after all the chained vma
      synchronisation is complete. Since the buffer pool batches are idle, this
      _should_ be a no-op, but one day we may some fancy async GPU bindings
      for new vma!
      
      v3: Use pool/batch consitently, once we start thinking in terms of the
      batch vma, use batch->obj.
      v4: Explain the magic number 4.
      
      Tvrtko spotted that we lose propagation of the error for failing to
      submit the relocation request; that's easier to fix up in the next
      patch.
      
      Testcase: igt/gem_exec_reloc/basic-many-active
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200501192945.22215-1-chris@chris-wilson.co.uk
      964a9b0f