Skip to content
  1. Aug 20, 2021
    • Matthew Brost's avatar
      drm/i915: Fix syncmap memory leak · faf89098
      Matthew Brost authored
      
      
      A small race exists between intel_gt_retire_requests_timeout and
      intel_timeline_exit which could result in the syncmap not getting
      free'd. Rather than work to hard to seal this race, simply cleanup the
      syncmap on fini.
      
      unreferenced object 0xffff88813bc53b18 (size 96):
        comm "gem_close_race", pid 5410, jiffies 4294917818 (age 1105.600s)
        hex dump (first 32 bytes):
          01 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 00  ................
          00 00 00 00 00 00 00 00 6b 6b 6b 6b 06 00 00 00  ........kkkk....
        backtrace:
          [<00000000120b863a>] __sync_alloc_leaf+0x1e/0x40 [i915]
          [<00000000042f6959>] __sync_set+0x1bb/0x240 [i915]
          [<0000000090f0e90f>] i915_request_await_dma_fence+0x1c7/0x400 [i915]
          [<0000000056a48219>] i915_request_await_object+0x222/0x360 [i915]
          [<00000000aaac4ee3>] i915_gem_do_execbuffer+0x1bd0/0x2250 [i915]
          [<000000003c9d830f>] i915_gem_execbuffer2_ioctl+0x405/0xce0 [i915]
          [<00000000fd7a8e68>] drm_ioctl_kernel+0xb0/0xf0 [drm]
          [<00000000e721ee87>] drm_ioctl+0x305/0x3c0 [drm]
          [<000000008b0d8986>] __x64_sys_ioctl+0x71/0xb0
          [<0000000076c362a4>] do_syscall_64+0x33/0x80
          [<00000000eb7a4831>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Fixes: 531958f6 ("drm/i915/gt: Track timeline activeness in enter/exit")
      Cc: <stable@vger.kernel.org>
      Reviewed-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
      Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210730195342.110234-1-matthew.brost@intel.com
      faf89098
  2. Aug 19, 2021
    • Matt Roper's avatar
      drm/i915/dg2: Maintain backward-compatible nested batch behavior · 9e9dfd08
      Matt Roper authored
      
      
      For tgl+, the per-context setting of MI_MODE[12] determines whether
      the bits of a nested MI_BATCH_BUFFER_START instruction should be
      interpreted in the traditional manner or whether they should
      instead use a new tgl+ meaning that breaks backward compatibility, but
      allows nesting into 3rd-level batchbuffers.  For previous platforms,
      the hardware default for this register bit is to maintain
      backward-compatible behavior unless a context intentionally opts into
      the new behavior; however Xe_HPG flips the hardware default behavior.
      
      From a SW perspective, we want to maintain the backward-compatible
      behavior for userspace, so we'll apply a fake workaround to set it back
      to the legacy behavior on platforms where the hardware default is to
      break compatibility.  At the moment there is no Linux userspace that
      utilizes third-level batchbuffers, so this will avoid userspace from
      needing to make any changes.  using the legacy meaning is the correct
      thing to do.  If/when we have userspace consumers that want to utilize
      third-level batch nesting, we can provide a context parameter to allow
      them to opt-in.
      
      Bspec: 45974, 45718
      Cc: John Harrison <John.C.Harrison@Intel.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210805163647.801064-9-matthew.d.roper@intel.com
      
      
      Reviewed-by: default avatarAnusha Srivatsa <anusha.srivatsa@intel.com>
      9e9dfd08
  3. Aug 18, 2021
  4. Aug 13, 2021
  5. Aug 12, 2021
    • Daniel Vetter's avatar
      drm/i915: Use locked access to ctx->engines in set_priority · b9709057
      Daniel Vetter authored
      
      
      This essentially reverts
      
      commit 89ff76bf
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Thu Apr 2 13:42:18 2020 +0100
      
          drm/i915/gem: Utilize rcu iteration of context engines
      
      Note that the other use of __context_engines_await have disappeard in
      the following commits:
      
      ccbc1b97 ("drm/i915/gem: Don't allow changing the VM on running contexts (v4)")
      c7a71fc8 ("drm/i915: Drop getparam support for I915_CONTEXT_PARAM_ENGINES")
      4a766ae4 ("drm/i915: Drop the CONTEXT_CLONE API (v2)")
      
      None of these have any business to optimize their engine lookup with
      rcu, unless extremely convincing benchmark data and a solid analysis
      why we can't make that workload (whatever it is that does) faster with
      a proper design fix.
      
      Also since there's only one caller of context_apply_all left and it's
      really just a loop, inline it and then inline the lopp body too. This
      is how all other callers that take the engine lock loop over engines,
      it's much simpler.
      
      Reviewed-by: default avatarJason Ekstrand <jason@jlekstrand.net>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Matthew Brost <matthew.brost@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210810130523.1972031-1-daniel.vetter@ffwll.ch
      b9709057
  6. Aug 11, 2021
  7. Aug 07, 2021
  8. Aug 05, 2021
  9. Aug 04, 2021