Skip to content

Reorganise calls to vmap() GEM objects

Dave Gordon dri-devel intel-gfx 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest7 patches 8 repliesIn review
  2. v67 patches 2 repliesSuperseded
  3. v57 patches 9 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v43 patches8 repliesSuperseded

Changes in v7 from the cover letter

Reverted to passing range specification in pages not bytes, and allow npages==0 as a shorthand for "up to the end of the object". Reordered patch sequence, with the most local changes first and the optional ones at the end.

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7drm/i915: deduplicate intel_pin_and_map_ringbuffer_obj() error handlingdrivers/gpu/drm/i915/intel_ringbuffer.c+12 -120 replies
2/7drm/i915: move locking in i915_gem_unmap_dma_buf()drivers/gpu/drm/i915/i915_gem_dmabuf.c+1 -30 replies
3/7drm,i915: introduce drm_malloc_gfp()drivers/gpu/drm/i915/i915_gem_execbuffer.c drivers/gpu/drm/i915/i915_gem_gtt.c drivers/gpu/drm/i915/i915_gem_userptr.c +1 more+29 -180 replies
4/7drm/i915: introduce and use i915_gem_object_vmap_range()drivers/gpu/drm/i915/i915_cmd_parser.c drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c +2 more+71 -641 reply
5/7drm/i915: optimise i915_gem_object_vmap_range() for small objectsdrivers/gpu/drm/i915/i915_gem.c+11 -60 replies
6/7drm/i915: refactor duplicate object vmap functions (the final rework?)drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/i915/i915_gem_dmabuf.c +1 more+65 -415 replies
7/7drm: add parameter-order checking to drm memory allocatorsdrivers/gpu/drm/etnaviv/etnaviv_gem_submit.c drivers/gpu/drm/i915/i915_gem_execbuffer.c include/drm/drm_mem_util.h+29 -81 reply

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchVille SyrjäläDave AirlieTvrtko Ursulin
1/7R-b
2/7R-b
3/7R-b A-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v7 thread

Cover letter [PATCH v7 0/7] Reorganise calls to vmap() GEM objects

Alex Dai and Chris Wilson have both recently posted patches to rationalise the use of vmap() for mapping GEM objects into kernel virtual space. However, they addressed different areas, with Alex's patch being derived from the copy_batch() code, whereas Chris' patch refactored the dma-buf and ringbuffer code.

So this patchset unifies the two, copying Chris' interfaces which unite pin-and-vmap for convenient lifecycle management, but using Alex's code underneath to permit partial mappings. And finally there's a little optimisation I've added for "small" objects e.g. ringbuffers and contexts, which are expected to be the objects most commonly handled by this code.

v5:
Added another of Chris' patches, introducing drm_malloc_gfp().

Split Chris' original patch into three, of which two are actually minor unrelated improvements, and only one is actually addresses the vmap() reorganisation [Tvrtko Ursulin]

Decided not to hold onto vmappings after the pin count goes to zero. This may reduce the benefit of Chris' scheme somewhat, but does avoid any increased risk of exhausting kernel vmap space on 32-bit kernels [Tvrtko Ursulin]. Potentially, the vunmap() could be moved back to the put_pages() stage (thus extending the cache lifetime) if a suitable notifier were written, but that's not included here.

v6:
Addressed a few review comments by Tvrtko & Chris; the main functional change is that i915_gem_object_vmap_range() now takes a range in bytes rather than pages, so we use sg_nents_for_len() to validate it against the actual scatterlist.

v7:
Reverted to passing range specification in pages not bytes, and allow npages==0 as a shorthand for "up to the end of the object". Reordered patch sequence, with the most local changes first and the optional ones at the end.

Cc Alex Dai <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc Daniel Vetter <[email protected]>

Alex Dai (1):
drm/i915: introduce and use i915_gem_object_vmap_range()

Chris Wilson (3):
drm/i915: deduplicate intel_pin_and_map_ringbuffer_obj() error
handling
drm/i915: move locking in i915_gem_unmap_dma_buf() drm,i915: introduce drm_malloc_gfp()

Dave Gordon (3):
drm/i915: optimise i915_gem_object_vmap_range() for small objects drm/i915: refactor duplicate object vmap functions (the final rework?)
drm: add parameter-order checking to drm memory allocators

 drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c |   2 +-
 drivers/gpu/drm/i915/i915_cmd_parser.c       |  34 ++-------
 drivers/gpu/drm/i915/i915_drv.h              |  26 +++++--
 drivers/gpu/drm/i915/i915_gem.c              | 103 +++++++++++++++++++++++++++
 drivers/gpu/drm/i915/i915_gem_dmabuf.c       |  53 ++------------
 drivers/gpu/drm/i915/i915_gem_execbuffer.c   |  12 ++--
 drivers/gpu/drm/i915/i915_gem_gtt.c          |   5 +-
 drivers/gpu/drm/i915/i915_gem_userptr.c      |  15 ++--
 drivers/gpu/drm/i915/intel_ringbuffer.c      |  52 +++++---------
 include/drm/drm_mem_util.h                   |  44 +++++++++++-
 10 files changed, 206 insertions(+), 140 deletions(-)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx