1. 31 10月, 2022 1 次提交
  2. 28 7月, 2022 1 次提交
  3. 09 5月, 2022 2 次提交
  4. 17 3月, 2022 2 次提交
  5. 28 2月, 2022 1 次提交
  6. 14 2月, 2022 2 次提交
  7. 10 1月, 2022 2 次提交
  8. 25 11月, 2021 1 次提交
  9. 02 11月, 2021 1 次提交
    • T
      drm/i915: Introduce refcounted sg-tables · cad7109a
      Thomas Hellström 提交于
      As we start to introduce asynchronous failsafe object migration,
      where we update the object state and then submit asynchronous
      commands we need to record what memory resources are actually used
      by various part of the command stream. Initially for three purposes:
      
      1) Error capture.
      2) Asynchronous migration error recovery.
      3) Asynchronous vma bind.
      
      At the time where these happens, the object state may have been updated
      to be several migrations ahead and object sg-tables discarded.
      
      In order to make it possible to keep sg-tables with memory resource
      information for these operations, introduce refcounted sg-tables that
      aren't freed until the last user is done with them.
      
      The alternative would be to reference information sitting on the
      corresponding ttm_resources which typically have the same lifetime as
      these refcountes sg_tables, but that leads to other awkward constructs:
      Due to the design direction chosen for ttm resource managers that would
      lead to diamond-style inheritance, the LMEM resources may sometimes be
      prematurely freed, and finally the subclassed struct ttm_resource would
      have to bleed into the asynchronous vma bind code.
      
      v3:
      - Address a number of style issues (Matthew Auld)
      v4:
      - Dont check for st->sgl being NULL in i915_ttm_tt__shmem_unpopulate(),
        that should never happen. (Matthew Auld)
      v5:
      - Fix a Potential double-free (Matthew Auld)
      Signed-off-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211101122444.114607-1-thomas.hellstrom@linux.intel.com
      cad7109a
  10. 22 10月, 2021 2 次提交
    • M
      drm/i915/ttm: add tt shmem backend · 7ae03459
      Matthew Auld 提交于
      For cached objects we can allocate our pages directly in shmem. This
      should make it possible(in a later patch) to utilise the existing
      i915-gem shrinker code for such objects. For now this is still disabled.
      
      v2(Thomas):
        - Add optional try_to_writeback hook for objects. Importantly we need
          to check if the object is even still shrinkable; in between us
          dropping the shrinker LRU lock and acquiring the object lock it could for
          example have been moved. Also we need to differentiate between
          "lazy" shrinking and the immediate writeback mode. Also later we need to
          handle objects which don't even have mm.pages, so bundling this into
          put_pages() would require somehow handling that edge case, hence
          just letting the ttm backend handle everything in try_to_writeback
          doesn't seem too bad.
      v3(Thomas):
        - Likely a bad idea to touch the object from the unpopulate hook,
          since it's not possible to hold a reference, without also creating
          circular dependency, so likely this is too fragile. For now just
          ensure we at least mark the pages as dirty/accessed when called from the
          shrinker on WILLNEED objects.
        - s/try_to_writeback/shrinker_release_pages, since this can do more
          than just writeback.
        - Get rid of do_backup boolean and just set the SWAPPED flag prior to
          calling unpopulate.
        - Keep shmem_tt as lowest priority for the TTM LRU bo_swapout walk, since
          these just get skipped anyway. We can try to come up with something
          better later.
      v4(Thomas):
        - s/PCI_DMA/DMA/. Also drop NO_KERNEL_MAPPING and NO_WARN, which
          apparently doesn't do anything with streaming mappings.
        - Just pass along the error for ->truncate, and assume nothing.
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Oak Zeng <oak.zeng@intel.com>
      Reviewed-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Acked-by: NOak Zeng <oak.zeng@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-2-matthew.auld@intel.com
      7ae03459
    • T
      drm/i915/gem: Break out some shmem backend utils · f05b985e
      Thomas Hellström 提交于
      Break out some shmem backend utils for future reuse by the TTM backend:
      shmem_alloc_st(), shmem_free_st() and __shmem_writeback() which we can
      use to provide a shmem-backed TTM page pool for cached-only TTM
      buffer objects.
      
      Main functional change here is that we now compute the page sizes using
      the dma segments rather than using the physical page address segments.
      
      v2(Reported-by: kernel test robot <lkp@intel.com>)
          - Make sure we initialise the mapping on the error path in
            shmem_get_pages()
      Signed-off-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-1-matthew.auld@intel.com
      f05b985e
  11. 20 10月, 2021 2 次提交
  12. 27 7月, 2021 1 次提交
    • M
      drm/i915/ehl: unconditionally flush the pages on acquire · 13d29c82
      Matthew Auld 提交于
      EHL and JSL add the 'Bypass LLC' MOCS entry, which should make it
      possible for userspace to bypass the GTT caching bits set by the kernel,
      as per the given object cache_level. This is troublesome since the heavy
      flush we apply when first acquiring the pages is skipped if the kernel
      thinks the object is coherent with the GPU. As a result it might be
      possible to bypass the cache and read the contents of the page directly,
      which could be stale data. If it's just a case of userspace shooting
      themselves in the foot then so be it, but since i915 takes the stance of
      always zeroing memory before handing it to userspace, we need to prevent
      this.
      
      v2: this time actually set cache_dirty in put_pages()
      v3: move to get_pages() which looks simpler
      
      BSpec: 34007
      References: 04609175 ("Revert "drm/i915/ehl: Update MOCS table for EHL"")
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Cc: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
      Cc: Francisco Jerez <francisco.jerez.plata@intel.com>
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Cc: Jon Bloomfield <jon.bloomfield@intel.com>
      Cc: Chris Wilson <chris.p.wilson@intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210723105045.400841-2-matthew.auld@intel.com
      13d29c82
  13. 30 6月, 2021 1 次提交
  14. 25 6月, 2021 2 次提交
  15. 02 6月, 2021 1 次提交
  16. 25 3月, 2021 1 次提交
  17. 24 3月, 2021 3 次提交
  18. 02 2月, 2021 1 次提交
  19. 21 1月, 2021 1 次提交
  20. 15 1月, 2021 1 次提交
  21. 14 10月, 2020 1 次提交
  22. 30 5月, 2020 1 次提交
  23. 25 5月, 2020 2 次提交
  24. 22 5月, 2020 1 次提交
    • C
      drm/i915/gem: Avoid iterating an empty list · 957ad9a0
      Chris Wilson 提交于
      Our __sgt_iter assumes that the scattergather list has at least one
      element. But during construction we may fail in allocating the first
      page, and so mark the first element as the terminator. This is
      unexpected!
      
      [22555.524752] RIP: 0010:shmem_get_pages+0x506/0x710 [i915]
      [22555.524759] Code: 49 8b 2c 24 31 c0 66 89 44 24 40 48 85 ed 0f 84 62 01 00 00 4c 8b 75 00 8b 5d 08 44 8b 7d 0c 48 8b 0d 7e 34 07 e2 49 83 e6 fc <49> 8b 16 41 01 df 48 89 cf 48 89 d0 48 c1 e8 2d 48 85 c9 0f 84 c8
      [22555.524765] RSP: 0018:ffffc9000053f9d0 EFLAGS: 00010246
      [22555.524770] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8881ffffa000
      [22555.524774] RDX: fffffffffffffff4 RSI: ffffffffffffffff RDI: ffffffff821efe00
      [22555.524778] RBP: ffff8881b099ab00 R08: 0000000000000000 R09: 00000000fffffff4
      [22555.524782] R10: 0000000000000002 R11: 00000000ffec0a02 R12: ffff8881cd3c8d60
      [22555.524786] R13: 00000000fffffff4 R14: 0000000000000000 R15: 0000000000000000
      [22555.524790] FS:  00007f4fbeb9b9c0(0000) GS:ffff8881f8580000(0000) knlGS:0000000000000000
      [22555.524795] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [22555.524799] CR2: 0000000000000000 CR3: 00000001ec7f0004 CR4: 00000000001606e0
      [22555.524803] Call Trace:
      [22555.524919]  __i915_gem_object_get_pages+0x4f/0x60 [i915]
      
      Fixes: 85d1225e ("drm/i915: Introduce & use new lightweight SGL iterators")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: <stable@vger.kernel.org> # v4.8+
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Reviewed-by: NMaciej Patelczyk <maciej.patelczyk@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200522132706.5133-1-chris@chris-wilson.co.uk
      957ad9a0
  25. 22 1月, 2020 1 次提交
  26. 29 12月, 2019 1 次提交
  27. 22 10月, 2019 1 次提交
  28. 18 10月, 2019 1 次提交
  29. 07 8月, 2019 1 次提交
  30. 04 7月, 2019 1 次提交