All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] drm/i915: Failsafe migration blits
@ 2021-10-08 13:35 ` Thomas Hellström
  0 siblings, 0 replies; 33+ messages in thread
From: Thomas Hellström @ 2021-10-08 13:35 UTC (permalink / raw)
  To: intel-gfx, dri-devel
  Cc: maarten.lankhorst, matthew.auld, Thomas Hellström

This patch series introduces failsafe migration blits.
The reason for this seemingly strange concept is that if the initial
clearing or readback of LMEM fails for some reason, and we then set up
either GPU- or CPU ptes to the allocated LMEM, we can expose old
contents from other clients.

So after each migration blit we attach a struct dma-fence-work that checks
the error value and if it's an error, perform a memcpy blit, instead.

This comes with some needed infrastructure updates:

Patch 1, updates dma_fence_work to do the work even if there is an error.
The work callback needs to check for error and take action accordingly.
Patch 2, Introduces refcounted sg-tables. The sg-tables are needed async for
the memcpy.
Patch 3, Introduces the failsafe migration blits and selftests.
Patch 4, Adds the possibility to attach the struct dma_fence_work to a timeline.
Patch 5, Attached the migration fence to a timeline since TTM requires that
for upcoming async eviction.
Patch 6 Adds an optimization for coalescing-only struct dma_fence_work.

Worth to consider during review: Patch 4-6 are probably better done in the
context of struct dma_fence_array. Both since we perhaps shouldn't add
irq work to yet another fence data structure and also because the
i915 command submission can individualize struct dma_fence_arrays.

Also the memcpy solution here isn't a final one as it only works if the
aperture covers all of lmem. We probably need to work on a solution where
we intercept move_fence errors and refuse GPU- and CPU mappings.

Thomas Hellström (6):
  drm/i915: Update dma_fence_work
  drm/i915: Introduce refcounted sg-tables
  drm/i915/ttm: Failsafe migration blits
  drm/i915: Add a struct dma_fence_work timeline
  drm/i915/ttm: Attach the migration fence to a region timeline on
    eviction
  drm/i915: Use irq work for coalescing-only dma-fence-work

 drivers/gpu/drm/i915/gem/i915_gem_clflush.c   |   5 +
 .../gpu/drm/i915/gem/i915_gem_object_types.h  |   3 +-
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c       | 467 ++++++++++++++----
 drivers/gpu/drm/i915/gem/i915_gem_ttm.h       |   4 +
 .../drm/i915/gem/selftests/i915_gem_migrate.c |  24 +-
 drivers/gpu/drm/i915/i915_scatterlist.c       |  62 ++-
 drivers/gpu/drm/i915/i915_scatterlist.h       |  76 ++-
 drivers/gpu/drm/i915/i915_sw_fence_work.c     | 145 +++++-
 drivers/gpu/drm/i915/i915_sw_fence_work.h     |  61 +++
 drivers/gpu/drm/i915/i915_vma.c               |  12 +-
 drivers/gpu/drm/i915/intel_memory_region.c    |  43 ++
 drivers/gpu/drm/i915/intel_memory_region.h    |   7 +
 drivers/gpu/drm/i915/intel_region_ttm.c       |  15 +-
 drivers/gpu/drm/i915/intel_region_ttm.h       |   5 +-
 drivers/gpu/drm/i915/selftests/mock_region.c  |  12 +-
 15 files changed, 776 insertions(+), 165 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2021-10-14  7:30 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08 13:35 [PATCH 0/6] drm/i915: Failsafe migration blits Thomas Hellström
2021-10-08 13:35 ` [Intel-gfx] " Thomas Hellström
2021-10-08 13:35 ` [PATCH 1/6] drm/i915: Update dma_fence_work Thomas Hellström
2021-10-08 13:35   ` [Intel-gfx] " Thomas Hellström
2021-10-13 12:41   ` Daniel Vetter
2021-10-13 12:41     ` [Intel-gfx] " Daniel Vetter
2021-10-13 12:59     ` Thomas Hellström
2021-10-13 12:59       ` [Intel-gfx] " Thomas Hellström
2021-10-08 13:35 ` [PATCH 2/6] drm/i915: Introduce refcounted sg-tables Thomas Hellström
2021-10-08 13:35   ` [Intel-gfx] " Thomas Hellström
2021-10-13 14:41   ` Daniel Vetter
2021-10-13 14:41     ` [Intel-gfx] " Daniel Vetter
2021-10-13 14:55     ` Thomas Hellström
2021-10-13 14:55       ` [Intel-gfx] " Thomas Hellström
2021-10-08 13:35 ` [PATCH 3/6] drm/i915/ttm: Failsafe migration blits Thomas Hellström
2021-10-08 13:35   ` [Intel-gfx] " Thomas Hellström
2021-10-08 13:35 ` [PATCH 4/6] drm/i915: Add a struct dma_fence_work timeline Thomas Hellström
2021-10-08 13:35   ` [Intel-gfx] " Thomas Hellström
2021-10-13 12:43   ` Daniel Vetter
2021-10-13 14:21     ` Thomas Hellström
2021-10-13 14:33       ` Daniel Vetter
2021-10-13 14:39         ` Thomas Hellström
2021-10-08 13:35 ` [PATCH 5/6] drm/i915/ttm: Attach the migration fence to a region timeline on eviction Thomas Hellström
2021-10-08 13:35   ` [Intel-gfx] " Thomas Hellström
2021-10-08 13:35 ` [PATCH 6/6] drm/i915: Use irq work for coalescing-only dma-fence-work Thomas Hellström
2021-10-08 13:35   ` [Intel-gfx] " Thomas Hellström
2021-10-08 17:00 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Failsafe migration blits Patchwork
2021-10-08 17:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-10-09  0:04 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-10-14  1:50 ` [PATCH 0/6] " Dave Airlie
2021-10-14  1:50   ` [Intel-gfx] " Dave Airlie
2021-10-14  7:29   ` Thomas Hellström
2021-10-14  7:29     ` Thomas Hellström

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.