All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/7] drm/i915: Remove short term pins from execbuf by requiring lock to unbind.
@ 2022-01-10 11:51 ` Maarten Lankhorst
  0 siblings, 0 replies; 21+ messages in thread
From: Maarten Lankhorst @ 2022-01-10 11:51 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel

Previously, short term pinning in execbuf was required because i915_vma was
effectively independent from objects, and has its own refcount, locking,
lifetime rules and pinning.

This series removes the separate locking, by requiring vma->obj->resv to be
held when pinning and unbinding. This will also be required for VM_BIND work.
Some patches have already been merged, but this contains the mremainder of
the conversion.

With pinning required for pinning and unbinding, the lock is enough to prevent
unbinding when trying to pin with the lock held, for example in execbuf.

This makes binding/unbinding similar to ttm_bo_validate()'s use, which just
cares that an object is in a certain place, without pinning it in place.

Having the VMA part of gem bo removes a lot of the vma refcounting, and makes
i915_vma more a part of the bo, instead of its own floating object that just
happens to be part of a bo. This is also required to make it more compatible
with TTM, and migration in general.

For future work, it makes things a lot simpler and clear. We want to end up
with i915_vma just being a specific mapping of the BO, just like is the
case in other drivers. i915_vma->active removal is the next step there,
and makes it when object is destroyed, the bindings are destroyed (after idle),
instead of object being destroyed when bindings are idle. 

Maarten Lankhorst (7):
  drm/i915: Call i915_gem_evict_vm in vm_fault_gtt to prevent new ENOSPC
    errors, v2.
  drm/i915: Add locking to i915_gem_evict_vm()
  drm/i915: Add object locking to i915_gem_evict_for_node and
    i915_gem_evict_something
  drm/i915: Add i915_vma_unbind_unlocked, and take obj lock for
    i915_vma_unbind, v2.
  drm/i915: Remove assert_object_held_shared
  drm/i915: Remove support for unlocked i915_vma unbind
  drm/i915: Remove short-term pins from execbuf, v6.

 drivers/gpu/drm/i915/display/intel_fb_pin.c   |   2 +-
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 220 +++++++++---------
 drivers/gpu/drm/i915/gem/i915_gem_mman.c      |  17 +-
 drivers/gpu/drm/i915/gem/i915_gem_object.c    |   4 +-
 drivers/gpu/drm/i915/gem/i915_gem_object.h    |  14 --
 drivers/gpu/drm/i915/gem/i915_gem_pages.c     |  10 +-
 drivers/gpu/drm/i915/gem/i915_gem_userptr.c   |   2 +-
 .../gpu/drm/i915/gem/selftests/huge_pages.c   |   2 +-
 .../i915/gem/selftests/i915_gem_client_blt.c  |   2 +-
 .../drm/i915/gem/selftests/i915_gem_mman.c    |   6 +
 drivers/gpu/drm/i915/gt/intel_ggtt.c          |  51 +++-
 drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c  |   1 -
 drivers/gpu/drm/i915/gt/selftest_hangcheck.c  |   2 +-
 drivers/gpu/drm/i915/gvt/aperture_gm.c        |   2 +-
 drivers/gpu/drm/i915/i915_drv.h               |   5 +-
 drivers/gpu/drm/i915/i915_gem.c               |   2 +
 drivers/gpu/drm/i915/i915_gem_evict.c         |  64 ++++-
 drivers/gpu/drm/i915/i915_gem_gtt.c           |   8 +-
 drivers/gpu/drm/i915/i915_gem_gtt.h           |   4 +
 drivers/gpu/drm/i915/i915_vgpu.c              |   2 +-
 drivers/gpu/drm/i915/i915_vma.c               | 122 +++++-----
 drivers/gpu/drm/i915/i915_vma.h               |   1 +
 .../gpu/drm/i915/selftests/i915_gem_evict.c   |  27 ++-
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c |  36 +--
 drivers/gpu/drm/i915/selftests/i915_vma.c     |   8 +-
 25 files changed, 361 insertions(+), 253 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2022-01-10 19:50 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 11:51 [PATCH v4 0/7] drm/i915: Remove short term pins from execbuf by requiring lock to unbind Maarten Lankhorst
2022-01-10 11:51 ` [Intel-gfx] " Maarten Lankhorst
2022-01-10 11:51 ` [PATCH v4 1/7] drm/i915: Call i915_gem_evict_vm in vm_fault_gtt to prevent new ENOSPC errors, v2 Maarten Lankhorst
2022-01-10 11:51   ` [Intel-gfx] " Maarten Lankhorst
2022-01-10 11:51 ` [PATCH v4 2/7] drm/i915: Add locking to i915_gem_evict_vm() Maarten Lankhorst
2022-01-10 11:51   ` [Intel-gfx] " Maarten Lankhorst
2022-01-10 11:51 ` [PATCH v4 3/7] drm/i915: Add object locking to i915_gem_evict_for_node and i915_gem_evict_something Maarten Lankhorst
2022-01-10 11:51   ` [Intel-gfx] " Maarten Lankhorst
2022-01-10 11:51 ` [PATCH v4 4/7] drm/i915: Add i915_vma_unbind_unlocked, and take obj lock for i915_vma_unbind, v2 Maarten Lankhorst
2022-01-10 11:51   ` [Intel-gfx] " Maarten Lankhorst
2022-01-10 11:51 ` [PATCH v4 5/7] drm/i915: Remove assert_object_held_shared Maarten Lankhorst
2022-01-10 11:51   ` [Intel-gfx] " Maarten Lankhorst
2022-01-10 19:50   ` kernel test robot
2022-01-10 11:51 ` [PATCH v4 6/7] drm/i915: Remove support for unlocked i915_vma unbind Maarten Lankhorst
2022-01-10 11:51   ` [Intel-gfx] " Maarten Lankhorst
2022-01-10 11:51 ` [PATCH v4 7/7] drm/i915: Remove short-term pins from execbuf, v6 Maarten Lankhorst
2022-01-10 11:51   ` [Intel-gfx] " Maarten Lankhorst
2022-01-10 13:07 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Remove short term pins from execbuf by requiring lock to unbind. (rev2) Patchwork
2022-01-10 13:08 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-01-10 13:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-01-10 16:48 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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.