History

dma-buf-map: Rename to iosys-map

Rename struct dma_buf_map to struct iosys_map and corresponding APIs. Over time dma-buf-map grew up to more functionality than the one used by dma-buf: in fact it's just a shim layer to abstract system memory, that can be accessed via regular load and store, from IO memory that needs to be acessed via arch helpers. The idea is to extend this API so it can fulfill other needs, internal to a single driver. Example: in the i915 driver it's desired to share the implementation for integrated graphics, which uses mostly system memory, with discrete graphics, which may need to access IO memory. The conversion was mostly done with the following semantic patch: @r1@ @@ - struct dma_buf_map + struct iosys_map @r2@ @@ ( - DMA_BUF_MAP_INIT_VADDR + IOSYS_MAP_INIT_VADDR | - dma_buf_map_set_vaddr + iosys_map_set_vaddr | - dma_buf_map_set_vaddr_iomem + iosys_map_set_vaddr_iomem | - dma_buf_map_is_equal + iosys_map_is_equal | - dma_buf_map_is_null + iosys_map_is_null | - dma_buf_map_is_set + iosys_map_is_set | - dma_buf_map_clear + iosys_map_clear | - dma_buf_map_memcpy_to + iosys_map_memcpy_to | - dma_buf_map_incr + iosys_map_incr ) @@ @@ - #include <linux/dma-buf-map.h> + #include <linux/iosys-map.h> Then some files had their includes adjusted and some comments were update to remove mentions to dma-buf-map. Since this is not specific to dma-buf anymore, move the documentation to the "Bus-Independent Device Accesses" section. v2: - Squash patches v3: - Fix wrong removal of dma-buf.h from MAINTAINERS - Move documentation from dma-buf.rst to device-io.rst v4: - Change documentation title and level

Lucas De Marchi committed 4 years ago

Commit 7938f421 parent 722b71779 files · +599 −568Browse files

Unified · Split

79 files
  1. Documentation/driver-api/device-io.rst +9 −0
  2. Documentation/driver-api/dma-buf.rst +0 −9
  3. Documentation/gpu/todo.rst +10 −10
  4. MAINTAINERS +8 −1
  5. drivers/dma-buf/dma-buf.c +11 −11
  6. drivers/dma-buf/heaps/cma_heap.c +5 −5
  7. drivers/dma-buf/heaps/system_heap.c +5 −5
  8. drivers/gpu/drm/ast/ast_drv.h +1 −1
  9. drivers/gpu/drm/ast/ast_mode.c +4 −4
  10. drivers/gpu/drm/drm_cache.c +9 −9
  11. drivers/gpu/drm/drm_client.c +5 −4
  12. drivers/gpu/drm/drm_fb_helper.c +6 −6
  13. drivers/gpu/drm/drm_gem.c +6 −6
  14. drivers/gpu/drm/drm_gem_cma_helper.c +5 −4
  15. drivers/gpu/drm/drm_gem_framebuffer_helper.c +8 −8
  16. drivers/gpu/drm/drm_gem_shmem_helper.c +9 −6
  17. drivers/gpu/drm/drm_gem_ttm_helper.c +2 −2
  18. drivers/gpu/drm/drm_gem_vram_helper.c +14 −11
  19. drivers/gpu/drm/drm_internal.h +3 −3
  20. drivers/gpu/drm/drm_mipi_dbi.c +4 −4
  21. drivers/gpu/drm/drm_prime.c +2 −2
  22. drivers/gpu/drm/etnaviv/etnaviv_drv.h +1 −1
  23. drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +4 −4
  24. drivers/gpu/drm/gud/gud_pipe.c +2 −2
  25. drivers/gpu/drm/hyperv/hyperv_drm_modeset.c +3 −2
  26. drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +5 −3
  27. drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +3 −3
  28. drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c +3 −3
  29. drivers/gpu/drm/lima/lima_gem.c +2 −1
  30. drivers/gpu/drm/lima/lima_sched.c +2 −2
  31. drivers/gpu/drm/mediatek/mtk_drm_gem.c +4 −3
  32. drivers/gpu/drm/mediatek/mtk_drm_gem.h +3 −2
  33. drivers/gpu/drm/mgag200/mgag200_mode.c +2 −2
  34. drivers/gpu/drm/msm/msm_drv.h +2 −2
  35. drivers/gpu/drm/msm/msm_gem_prime.c +3 −3
  36. drivers/gpu/drm/panfrost/panfrost_perfcnt.c +7 −6
  37. drivers/gpu/drm/qxl/qxl_display.c +4 −4
  38. drivers/gpu/drm/qxl/qxl_draw.c +3 −3
  39. drivers/gpu/drm/qxl/qxl_drv.h +5 −5
  40. drivers/gpu/drm/qxl/qxl_object.c +4 −4
  41. drivers/gpu/drm/qxl/qxl_object.h +2 −2
  42. drivers/gpu/drm/qxl/qxl_prime.c +2 −2
  43. drivers/gpu/drm/radeon/radeon_gem.c +1 −0
  44. drivers/gpu/drm/rockchip/rockchip_drm_gem.c +5 −4
  45. drivers/gpu/drm/rockchip/rockchip_drm_gem.h +3 −2
  46. drivers/gpu/drm/tegra/gem.c +5 −5
  47. drivers/gpu/drm/tiny/cirrus.c +5 −3
  48. drivers/gpu/drm/tiny/gm12u320.c +4 −3
  49. drivers/gpu/drm/ttm/ttm_bo_util.c +8 −8
  50. drivers/gpu/drm/ttm/ttm_resource.c +21 −21
  51. drivers/gpu/drm/ttm/ttm_tt.c +4 −4
  52. drivers/gpu/drm/udl/udl_modeset.c +2 −1
  53. drivers/gpu/drm/vboxvideo/vbox_mode.c +2 −2
  54. drivers/gpu/drm/vkms/vkms_composer.c +2 −2
  55. drivers/gpu/drm/vkms/vkms_drv.h +3 −3
  56. drivers/gpu/drm/vkms/vkms_plane.c +1 −1
  57. drivers/gpu/drm/vkms/vkms_writeback.c +1 −1
  58. drivers/gpu/drm/xen/xen_drm_front_gem.c +4 −3
  59. drivers/gpu/drm/xen/xen_drm_front_gem.h +3 −3
  60. drivers/media/common/videobuf2/videobuf2-dma-contig.c +4 −4
  61. drivers/media/common/videobuf2/videobuf2-dma-sg.c +5 −4
  62. drivers/media/common/videobuf2/videobuf2-vmalloc.c +6 −5
  63. drivers/misc/fastrpc.c +2 −2
  64. include/drm/drm_cache.h +3 −3
  65. include/drm/drm_client.h +4 −3
  66. include/drm/drm_gem.h +3 −3
  67. include/drm/drm_gem_atomic_helper.h +3 −3
  68. include/drm/drm_gem_cma_helper.h +4 −2
  69. include/drm/drm_gem_framebuffer_helper.h +4 −4
  70. include/drm/drm_gem_shmem_helper.h +8 −4
  71. include/drm/drm_gem_ttm_helper.h +3 −3
  72. include/drm/drm_gem_vram_helper.h +5 −4
  73. include/drm/drm_prime.h +3 −3
  74. include/drm/ttm/ttm_bo_api.h +5 −5
  75. include/drm/ttm/ttm_kmap_iter.h +5 −5
  76. include/drm/ttm/ttm_resource.h +3 −3
  77. include/linux/dma-buf-map.h +0 −266
  78. include/linux/dma-buf.h +6 −6
  79. include/linux/iosys-map.h +257 −0
Documentation/driver-api/device-io.rst+9−0
@@ -502,6 +502,15 @@ pcim_iomap() · 501 unmodified lines
502502 Not using these wrappers may make drivers unusable on certain platforms with
503503 stricter rules for mapping I/O memory.
504504
505+Generalizing Access to System and I/O Memory
506+============================================
507+
508+.. kernel-doc:: include/linux/iosys-map.h
509+ :doc: overview
510+
511+.. kernel-doc:: include/linux/iosys-map.h
512+ :internal:
513+
505514 Public Functions Provided
506515 =========================
507516
Documentation/driver-api/dma-buf.rst+0−9
@@ -128,15 +128,6 @@ Kernel Functions and Structures Reference · 127 unmodified lines
128128 .. kernel-doc:: include/linux/dma-buf.h
129129 :internal:
130130
131−Buffer Mapping Helpers
132−~~~~~~~~~~~~~~~~~~~~~~
133−
134−.. kernel-doc:: include/linux/dma-buf-map.h
135− :doc: overview
136−
137−.. kernel-doc:: include/linux/dma-buf-map.h
138− :internal:
139−
140131 Reservation Objects
141132 -------------------
142133
Documentation/gpu/todo.rst+10−10
@@ -222,7 +222,7 @@ Convert drivers to use drm_fbdev_generic_setup() · 221 unmodified lines
222222 Most drivers can use drm_fbdev_generic_setup(). Driver have to implement
223223 atomic modesetting and GEM vmap support. Historically, generic fbdev emulation
224224 expected the framebuffer in system memory or system-like memory. By employing
225−struct dma_buf_map, drivers with frambuffers in I/O memory can be supported
225+struct iosys_map, drivers with frambuffers in I/O memory can be supported
226226 as well.
227227
228228 Contact: Maintainer of the driver you plan to convert
@@ -234,7 +234,7 @@ Reimplement functions in drm_fbdev_fb_ops without fbdev · 5 unmodified lines
234234
235235 A number of callback functions in drm_fbdev_fb_ops could benefit from
236236 being rewritten without dependencies on the fbdev module. Some of the
237−helpers could further benefit from using struct dma_buf_map instead of
237+helpers could further benefit from using struct iosys_map instead of
238238 raw pointers.
239239
240240 Contact: Thomas Zimmermann <tzimmermann@suse.de>, Daniel Vetter
@@ -434,19 +434,19 @@ Contact: Emil Velikov, respective driver maintainers · 193 unmodified lines
434434
435435 Level: Intermediate
436436
437−Use struct dma_buf_map throughout codebase
438−------------------------------------------
437+Use struct iosys_map throughout codebase
438+----------------------------------------
439439
440−Pointers to shared device memory are stored in struct dma_buf_map. Each
440+Pointers to shared device memory are stored in struct iosys_map. Each
441441 instance knows whether it refers to system or I/O memory. Most of the DRM-wide
442−interface have been converted to use struct dma_buf_map, but implementations
442+interface have been converted to use struct iosys_map, but implementations
443443 often still use raw pointers.
444444
445−The task is to use struct dma_buf_map where it makes sense.
445+The task is to use struct iosys_map where it makes sense.
446446
447−* Memory managers should use struct dma_buf_map for dma-buf-imported buffers.
448−* TTM might benefit from using struct dma_buf_map internally.
449−* Framebuffer copying and blitting helpers should operate on struct dma_buf_map.
447+* Memory managers should use struct iosys_map for dma-buf-imported buffers.
448+* TTM might benefit from using struct iosys_map internally.
449+* Framebuffer copying and blitting helpers should operate on struct iosys_map.
450450
451451 Contact: Thomas Zimmermann <tzimmermann@suse.de>, Christian König, Daniel Vetter
452452
MAINTAINERS+8−1
@@ -5734,7 +5734,7 @@ T: git git://anongit.freedesktop.org/drm/drm-misc · 5733 unmodified lines
57345734 F: Documentation/driver-api/dma-buf.rst
57355735 F: drivers/dma-buf/
57365736 F: include/linux/*fence.h
5737−F: include/linux/dma-buf*
5737+F: include/linux/dma-buf.h
57385738 F: include/linux/dma-resv.h
57395739 K: \bdma_(?:buf|fence|resv)\b
57405740
@@ -10050,6 +10050,13 @@ F: include/linux/iova.h · 4309 unmodified lines
1005010050 F: include/linux/of_iommu.h
1005110051 F: include/uapi/linux/iommu.h
1005210052
10053+IOSYS-MAP HELPERS
10054+M: Thomas Zimmermann <tzimmermann@suse.de>
10055+L: dri-devel@lists.freedesktop.org
10056+S: Maintained
10057+T: git git://anongit.freedesktop.org/drm/drm-misc
10058+F: include/linux/iosys-map.h
10059+
1005310060 IO_URING
1005410061 M: Jens Axboe <axboe@kernel.dk>
1005510062 R: Pavel Begunkov <asml.silence@gmail.com>
drivers/dma-buf/dma-buf.c+11−11
@@ -1047,8 +1047,8 @@ EXPORT_SYMBOL_NS_GPL(dma_buf_move_notify, DMA_BUF); · 1046 unmodified lines
10471047 *
10481048 * Interfaces::
10491049 *
1050− * void \*dma_buf_vmap(struct dma_buf \*dmabuf, struct dma_buf_map \*map)
1051− * void dma_buf_vunmap(struct dma_buf \*dmabuf, struct dma_buf_map \*map)
1050+ * void \*dma_buf_vmap(struct dma_buf \*dmabuf, struct iosys_map \*map)
1051+ * void dma_buf_vunmap(struct dma_buf \*dmabuf, struct iosys_map \*map)
10521052 *
10531053 * The vmap call can fail if there is no vmap support in the exporter, or if
10541054 * it runs out of vmalloc space. Note that the dma-buf layer keeps a reference
@@ -1260,12 +1260,12 @@ EXPORT_SYMBOL_NS_GPL(dma_buf_mmap, DMA_BUF); · 205 unmodified lines
12601260 *
12611261 * Returns 0 on success, or a negative errno code otherwise.
12621262 */
1263−int dma_buf_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map)
1263+int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map)
12641264 {
1265− struct dma_buf_map ptr;
1265+ struct iosys_map ptr;
12661266 int ret = 0;
12671267
1268− dma_buf_map_clear(map);
1268+ iosys_map_clear(map);
12691269
12701270 if (WARN_ON(!dmabuf))
12711271 return -EINVAL;
@@ -1276,12 +1276,12 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map) · 4 unmodified lines
12761276 mutex_lock(&dmabuf->lock);
12771277 if (dmabuf->vmapping_counter) {
12781278 dmabuf->vmapping_counter++;
1279− BUG_ON(dma_buf_map_is_null(&dmabuf->vmap_ptr));
1279+ BUG_ON(iosys_map_is_null(&dmabuf->vmap_ptr));
12801280 *map = dmabuf->vmap_ptr;
12811281 goto out_unlock;
12821282 }
12831283
1284− BUG_ON(dma_buf_map_is_set(&dmabuf->vmap_ptr));
1284+ BUG_ON(iosys_map_is_set(&dmabuf->vmap_ptr));
12851285
12861286 ret = dmabuf->ops->vmap(dmabuf, &ptr);
12871287 if (WARN_ON_ONCE(ret))
@@ -1303,20 +1303,20 @@ EXPORT_SYMBOL_NS_GPL(dma_buf_vmap, DMA_BUF); · 15 unmodified lines
13031303 * @dmabuf: [in] buffer to vunmap
13041304 * @map: [in] vmap pointer to vunmap
13051305 */
1306−void dma_buf_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map)
1306+void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map)
13071307 {
13081308 if (WARN_ON(!dmabuf))
13091309 return;
13101310
1311− BUG_ON(dma_buf_map_is_null(&dmabuf->vmap_ptr));
1311+ BUG_ON(iosys_map_is_null(&dmabuf->vmap_ptr));
13121312 BUG_ON(dmabuf->vmapping_counter == 0);
1313− BUG_ON(!dma_buf_map_is_equal(&dmabuf->vmap_ptr, map));
1313+ BUG_ON(!iosys_map_is_equal(&dmabuf->vmap_ptr, map));
13141314
13151315 mutex_lock(&dmabuf->lock);
13161316 if (--dmabuf->vmapping_counter == 0) {
13171317 if (dmabuf->ops->vunmap)
13181318 dmabuf->ops->vunmap(dmabuf, map);
1319− dma_buf_map_clear(&dmabuf->vmap_ptr);
1319+ iosys_map_clear(&dmabuf->vmap_ptr);
13201320 }
13211321 mutex_unlock(&dmabuf->lock);
13221322 }
drivers/dma-buf/heaps/cma_heap.c+5−5
@@ -202,7 +202,7 @@ static void *cma_heap_do_vmap(struct cma_heap_buffer *buffer) · 201 unmodified lines
202202 return vaddr;
203203 }
204204
205−static int cma_heap_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map)
205+static int cma_heap_vmap(struct dma_buf *dmabuf, struct iosys_map *map)
206206 {
207207 struct cma_heap_buffer *buffer = dmabuf->priv;
208208 void *vaddr;
@@ -211,7 +211,7 @@ static int cma_heap_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map) · 2 unmodified lines
211211 mutex_lock(&buffer->lock);
212212 if (buffer->vmap_cnt) {
213213 buffer->vmap_cnt++;
214− dma_buf_map_set_vaddr(map, buffer->vaddr);
214+ iosys_map_set_vaddr(map, buffer->vaddr);
215215 goto out;
216216 }
217217
@@ -222,14 +222,14 @@ static int cma_heap_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map) · 4 unmodified lines
222222 }
223223 buffer->vaddr = vaddr;
224224 buffer->vmap_cnt++;
225− dma_buf_map_set_vaddr(map, buffer->vaddr);
225+ iosys_map_set_vaddr(map, buffer->vaddr);
226226 out:
227227 mutex_unlock(&buffer->lock);
228228
229229 return ret;
230230 }
231231
232−static void cma_heap_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map)
232+static void cma_heap_vunmap(struct dma_buf *dmabuf, struct iosys_map *map)
233233 {
234234 struct cma_heap_buffer *buffer = dmabuf->priv;
235235
@@ -239,7 +239,7 @@ static void cma_heap_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map) · 3 unmodified lines
239239 buffer->vaddr = NULL;
240240 }
241241 mutex_unlock(&buffer->lock);
242− dma_buf_map_clear(map);
242+ iosys_map_clear(map);
243243 }
244244
245245 static void cma_heap_dma_buf_release(struct dma_buf *dmabuf)
drivers/dma-buf/heaps/system_heap.c+5−5
@@ -241,7 +241,7 @@ static void *system_heap_do_vmap(struct system_heap_buffer *buffer) · 240 unmodified lines
241241 return vaddr;
242242 }
243243
244−static int system_heap_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map)
244+static int system_heap_vmap(struct dma_buf *dmabuf, struct iosys_map *map)
245245 {
246246 struct system_heap_buffer *buffer = dmabuf->priv;
247247 void *vaddr;
@@ -250,7 +250,7 @@ static int system_heap_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map) · 2 unmodified lines
250250 mutex_lock(&buffer->lock);
251251 if (buffer->vmap_cnt) {
252252 buffer->vmap_cnt++;
253− dma_buf_map_set_vaddr(map, buffer->vaddr);
253+ iosys_map_set_vaddr(map, buffer->vaddr);
254254 goto out;
255255 }
256256
@@ -262,14 +262,14 @@ static int system_heap_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map) · 5 unmodified lines
262262
263263 buffer->vaddr = vaddr;
264264 buffer->vmap_cnt++;
265− dma_buf_map_set_vaddr(map, buffer->vaddr);
265+ iosys_map_set_vaddr(map, buffer->vaddr);
266266 out:
267267 mutex_unlock(&buffer->lock);
268268
269269 return ret;
270270 }
271271
272−static void system_heap_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map)
272+static void system_heap_vunmap(struct dma_buf *dmabuf, struct iosys_map *map)
273273 {
274274 struct system_heap_buffer *buffer = dmabuf->priv;
275275
@@ -279,7 +279,7 @@ static void system_heap_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map) · 3 unmodified lines
279279 buffer->vaddr = NULL;
280280 }
281281 mutex_unlock(&buffer->lock);
282− dma_buf_map_clear(map);
282+ iosys_map_clear(map);
283283 }
284284
285285 static void system_heap_dma_buf_release(struct dma_buf *dmabuf)
drivers/gpu/drm/ast/ast_drv.h+1−1
@@ -107,7 +107,7 @@ struct ast_cursor_plane { · 106 unmodified lines
107107
108108 struct {
109109 struct drm_gem_vram_object *gbo;
110− struct dma_buf_map map;
110+ struct iosys_map map;
111111 u64 off;
112112 } hwc[AST_DEFAULT_HWC_NUM];
113113
drivers/gpu/drm/ast/ast_mode.c+4−4
@@ -801,11 +801,11 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane, · 800 unmodified lines
801801 struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(new_state);
802802 struct drm_framebuffer *fb = new_state->fb;
803803 struct ast_private *ast = to_ast_private(plane->dev);
804− struct dma_buf_map dst_map =
804+ struct iosys_map dst_map =
805805 ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].map;
806806 u64 dst_off =
807807 ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].off;
808− struct dma_buf_map src_map = shadow_plane_state->data[0];
808+ struct iosys_map src_map = shadow_plane_state->data[0];
809809 unsigned int offset_x, offset_y;
810810 u16 x, y;
811811 u8 x_offset, y_offset;
@@ -883,7 +883,7 @@ static void ast_cursor_plane_destroy(struct drm_plane *plane) · 71 unmodified lines
883883 struct ast_cursor_plane *ast_cursor_plane = to_ast_cursor_plane(plane);
884884 size_t i;
885885 struct drm_gem_vram_object *gbo;
886− struct dma_buf_map map;
886+ struct iosys_map map;
887887
888888 for (i = 0; i < ARRAY_SIZE(ast_cursor_plane->hwc); ++i) {
889889 gbo = ast_cursor_plane->hwc[i].gbo;
@@ -910,7 +910,7 @@ static int ast_cursor_plane_init(struct ast_private *ast) · 20 unmodified lines
910910 struct drm_plane *cursor_plane = &ast_cursor_plane->base;
911911 size_t size, i;
912912 struct drm_gem_vram_object *gbo;
913− struct dma_buf_map map;
913+ struct iosys_map map;
914914 int ret;
915915 s64 off;
916916
drivers/gpu/drm/drm_cache.c+9−9
@@ -28,10 +28,10 @@ · 27 unmodified lines
2828 * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
2929 */
3030
31−#include <linux/dma-buf-map.h>
31+#include <linux/cc_platform.h>
3232 #include <linux/export.h>
3333 #include <linux/highmem.h>
34−#include <linux/cc_platform.h>
34+#include <linux/iosys-map.h>
3535 #include <xen/xen.h>
3636
3737 #include <drm/drm_cache.h>
@@ -214,14 +214,14 @@ bool drm_need_swiotlb(int dma_bits) · 176 unmodified lines
214214 }
215215 EXPORT_SYMBOL(drm_need_swiotlb);
216216
217−static void memcpy_fallback(struct dma_buf_map *dst,
218− const struct dma_buf_map *src,
217+static void memcpy_fallback(struct iosys_map *dst,
218+ const struct iosys_map *src,
219219 unsigned long len)
220220 {
221221 if (!dst->is_iomem && !src->is_iomem) {
222222 memcpy(dst->vaddr, src->vaddr, len);
223223 } else if (!src->is_iomem) {
224− dma_buf_map_memcpy_to(dst, src->vaddr, len);
224+ iosys_map_memcpy_to(dst, src->vaddr, len);
225225 } else if (!dst->is_iomem) {
226226 memcpy_fromio(dst->vaddr, src->vaddr_iomem, len);
227227 } else {
@@ -305,8 +305,8 @@ static void __drm_memcpy_from_wc(void *dst, const void *src, unsigned long len) · 77 unmodified lines
305305 * Tries an arch optimized memcpy for prefetching reading out of a WC region,
306306 * and if no such beast is available, falls back to a normal memcpy.
307307 */
308−void drm_memcpy_from_wc(struct dma_buf_map *dst,
309− const struct dma_buf_map *src,
308+void drm_memcpy_from_wc(struct iosys_map *dst,
309+ const struct iosys_map *src,
310310 unsigned long len)
311311 {
312312 if (WARN_ON(in_interrupt())) {
@@ -343,8 +343,8 @@ void drm_memcpy_init_early(void) · 30 unmodified lines
343343 static_branch_enable(&has_movntdqa);
344344 }
345345 #else
346−void drm_memcpy_from_wc(struct dma_buf_map *dst,
347− const struct dma_buf_map *src,
346+void drm_memcpy_from_wc(struct iosys_map *dst,
347+ const struct iosys_map *src,
348348 unsigned long len)
349349 {
350350 WARN_ON(in_interrupt());
drivers/gpu/drm/drm_client.c+5−4
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 * Copyright 2018 Noralf Trønnes
44 */
55
6−#include <linux/dma-buf-map.h>
6+#include <linux/iosys-map.h>
77 #include <linux/list.h>
88 #include <linux/module.h>
99 #include <linux/mutex.h>
@@ -309,9 +309,10 @@ err_delete: · 299 unmodified lines
309309 * 0 on success, or a negative errno code otherwise.
310310 */
311311 int
312−drm_client_buffer_vmap(struct drm_client_buffer *buffer, struct dma_buf_map *map_copy)
312+drm_client_buffer_vmap(struct drm_client_buffer *buffer,
313+ struct iosys_map *map_copy)
313314 {
314− struct dma_buf_map *map = &buffer->map;
315+ struct iosys_map *map = &buffer->map;
315316 int ret;
316317
317318 /*
@@ -342,7 +343,7 @@ EXPORT_SYMBOL(drm_client_buffer_vmap); · 24 unmodified lines
342343 */
343344 void drm_client_buffer_vunmap(struct drm_client_buffer *buffer)
344345 {
345− struct dma_buf_map *map = &buffer->map;
346+ struct iosys_map *map = &buffer->map;
346347
347348 drm_gem_vunmap(buffer->gem, map);
348349 }
drivers/gpu/drm/drm_fb_helper.c+6−6
@@ -373,7 +373,7 @@ static void drm_fb_helper_resume_worker(struct work_struct *work) · 372 unmodified lines
373373
374374 static void drm_fb_helper_damage_blit_real(struct drm_fb_helper *fb_helper,
375375 struct drm_clip_rect *clip,
376− struct dma_buf_map *dst)
376+ struct iosys_map *dst)
377377 {
378378 struct drm_framebuffer *fb = fb_helper->fb;
379379 unsigned int cpp = fb->format->cpp[0];
@@ -382,11 +382,11 @@ static void drm_fb_helper_damage_blit_real(struct drm_fb_helper *fb_helper, · 2 unmodified lines
382382 size_t len = (clip->x2 - clip->x1) * cpp;
383383 unsigned int y;
384384
385− dma_buf_map_incr(dst, offset); /* go to first pixel within clip rect */
385+ iosys_map_incr(dst, offset); /* go to first pixel within clip rect */
386386
387387 for (y = clip->y1; y < clip->y2; y++) {
388− dma_buf_map_memcpy_to(dst, src, len);
389− dma_buf_map_incr(dst, fb->pitches[0]);
388+ iosys_map_memcpy_to(dst, src, len);
389+ iosys_map_incr(dst, fb->pitches[0]);
390390 src += fb->pitches[0];
391391 }
392392 }
@@ -395,7 +395,7 @@ static int drm_fb_helper_damage_blit(struct drm_fb_helper *fb_helper, · 2 unmodified lines
395395 struct drm_clip_rect *clip)
396396 {
397397 struct drm_client_buffer *buffer = fb_helper->buffer;
398− struct dma_buf_map map, dst;
398+ struct iosys_map map, dst;
399399 int ret;
400400
401401 /*
@@ -2322,7 +2322,7 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, · 1920 unmodified lines
23222322 struct drm_framebuffer *fb;
23232323 struct fb_info *fbi;
23242324 u32 format;
2325− struct dma_buf_map map;
2325+ struct iosys_map map;
23262326 int ret;
23272327
23282328 drm_dbg_kms(dev, "surface width(%d), height(%d) and bpp(%d)\n",
drivers/gpu/drm/drm_gem.c+6−6
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636 #include <linux/pagemap.h>
3737 #include <linux/shmem_fs.h>
3838 #include <linux/dma-buf.h>
39−#include <linux/dma-buf-map.h>
39+#include <linux/iosys-map.h>
4040 #include <linux/mem_encrypt.h>
4141 #include <linux/pagevec.h>
4242
@@ -1165,7 +1165,7 @@ void drm_gem_unpin(struct drm_gem_object *obj) · 1122 unmodified lines
11651165 obj->funcs->unpin(obj);
11661166 }
11671167
1168−int drm_gem_vmap(struct drm_gem_object *obj, struct dma_buf_map *map)
1168+int drm_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map)
11691169 {
11701170 int ret;
11711171
@@ -1175,23 +1175,23 @@ int drm_gem_vmap(struct drm_gem_object *obj, struct dma_buf_map *map) · 3 unmodified lines
11751175 ret = obj->funcs->vmap(obj, map);
11761176 if (ret)
11771177 return ret;
1178− else if (dma_buf_map_is_null(map))
1178+ else if (iosys_map_is_null(map))
11791179 return -ENOMEM;
11801180
11811181 return 0;
11821182 }
11831183 EXPORT_SYMBOL(drm_gem_vmap);
11841184
1185−void drm_gem_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map)
1185+void drm_gem_vunmap(struct drm_gem_object *obj, struct iosys_map *map)
11861186 {
1187− if (dma_buf_map_is_null(map))
1187+ if (iosys_map_is_null(map))
11881188 return;
11891189
11901190 if (obj->funcs->vunmap)
11911191 obj->funcs->vunmap(obj, map);
11921192
11931193 /* Always set the mapping to NULL. Callers may rely on this. */
1194− dma_buf_map_clear(map);
1194+ iosys_map_clear(map);
11951195 }
11961196 EXPORT_SYMBOL(drm_gem_vunmap);
11971197
drivers/gpu/drm/drm_gem_cma_helper.c+5−4
@@ -209,7 +209,7 @@ drm_gem_cma_create_with_handle(struct drm_file *file_priv, · 208 unmodified lines
209209 void drm_gem_cma_free(struct drm_gem_cma_object *cma_obj)
210210 {
211211 struct drm_gem_object *gem_obj = &cma_obj->base;
212− struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(cma_obj->vaddr);
212+ struct iosys_map map = IOSYS_MAP_INIT_VADDR(cma_obj->vaddr);
213213
214214 if (gem_obj->import_attach) {
215215 if (cma_obj->vaddr)
@@ -480,9 +480,10 @@ EXPORT_SYMBOL_GPL(drm_gem_cma_prime_import_sg_table); · 264 unmodified lines
480480 * Returns:
481481 * 0 on success, or a negative error code otherwise.
482482 */
483−int drm_gem_cma_vmap(struct drm_gem_cma_object *cma_obj, struct dma_buf_map *map)
483+int drm_gem_cma_vmap(struct drm_gem_cma_object *cma_obj,
484+ struct iosys_map *map)
484485 {
485− dma_buf_map_set_vaddr(map, cma_obj->vaddr);
486+ iosys_map_set_vaddr(map, cma_obj->vaddr);
486487
487488 return 0;
488489 }
@@ -557,7 +558,7 @@ drm_gem_cma_prime_import_sg_table_vmap(struct drm_device *dev, · 68 unmodified lines
557558 {
558559 struct drm_gem_cma_object *cma_obj;
559560 struct drm_gem_object *obj;
560− struct dma_buf_map map;
561+ struct iosys_map map;
561562 int ret;
562563
563564 ret = dma_buf_vmap(attach->dmabuf, &map);
drivers/gpu/drm/drm_gem_framebuffer_helper.c+8−8
@@ -321,7 +321,7 @@ EXPORT_SYMBOL_GPL(drm_gem_fb_create_with_dirty); · 320 unmodified lines
321321 * @data: returns the data address for each BO, can be NULL
322322 *
323323 * This function maps all buffer objects of the given framebuffer into
324− * kernel address space and stores them in struct dma_buf_map. If the
324+ * kernel address space and stores them in struct iosys_map. If the
325325 * mapping operation fails for one of the BOs, the function unmaps the
326326 * already established mappings automatically.
327327 *
@@ -335,8 +335,8 @@ EXPORT_SYMBOL_GPL(drm_gem_fb_create_with_dirty); · 7 unmodified lines
335335 * 0 on success, or a negative errno code otherwise.
336336 */
337337 int drm_gem_fb_vmap(struct drm_framebuffer *fb,
338− struct dma_buf_map map[static DRM_FORMAT_MAX_PLANES],
339− struct dma_buf_map data[DRM_FORMAT_MAX_PLANES])
338+ struct iosys_map map[static DRM_FORMAT_MAX_PLANES],
339+ struct iosys_map data[DRM_FORMAT_MAX_PLANES])
340340 {
341341 struct drm_gem_object *obj;
342342 unsigned int i;
@@ -345,7 +345,7 @@ int drm_gem_fb_vmap(struct drm_framebuffer *fb, · 2 unmodified lines
345345 for (i = 0; i < DRM_FORMAT_MAX_PLANES; ++i) {
346346 obj = drm_gem_fb_get_obj(fb, i);
347347 if (!obj) {
348− dma_buf_map_clear(&map[i]);
348+ iosys_map_clear(&map[i]);
349349 continue;
350350 }
351351 ret = drm_gem_vmap(obj, &map[i]);
@@ -356,9 +356,9 @@ int drm_gem_fb_vmap(struct drm_framebuffer *fb, · 4 unmodified lines
356356 if (data) {
357357 for (i = 0; i < DRM_FORMAT_MAX_PLANES; ++i) {
358358 memcpy(&data[i], &map[i], sizeof(data[i]));
359− if (dma_buf_map_is_null(&data[i]))
359+ if (iosys_map_is_null(&data[i]))
360360 continue;
361− dma_buf_map_incr(&data[i], fb->offsets[i]);
361+ iosys_map_incr(&data[i], fb->offsets[i]);
362362 }
363363 }
364364
@@ -386,7 +386,7 @@ EXPORT_SYMBOL(drm_gem_fb_vmap); · 21 unmodified lines
386386 * See drm_gem_fb_vmap() for more information.
387387 */
388388 void drm_gem_fb_vunmap(struct drm_framebuffer *fb,
389− struct dma_buf_map map[static DRM_FORMAT_MAX_PLANES])
389+ struct iosys_map map[static DRM_FORMAT_MAX_PLANES])
390390 {
391391 unsigned int i = DRM_FORMAT_MAX_PLANES;
392392 struct drm_gem_object *obj;
@@ -396,7 +396,7 @@ void drm_gem_fb_vunmap(struct drm_framebuffer *fb, · 3 unmodified lines
396396 obj = drm_gem_fb_get_obj(fb, i);
397397 if (!obj)
398398 continue;
399− if (dma_buf_map_is_null(&map[i]))
399+ if (iosys_map_is_null(&map[i]))
400400 continue;
401401 drm_gem_vunmap(obj, &map[i]);
402402 }
drivers/gpu/drm/drm_gem_shmem_helper.c+9−6
@@ -286,13 +286,14 @@ void drm_gem_shmem_unpin(struct drm_gem_shmem_object *shmem) · 285 unmodified lines
286286 }
287287 EXPORT_SYMBOL(drm_gem_shmem_unpin);
288288
289−static int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem, struct dma_buf_map *map)
289+static int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem,
290+ struct iosys_map *map)
290291 {
291292 struct drm_gem_object *obj = &shmem->base;
292293 int ret = 0;
293294
294295 if (shmem->vmap_use_count++ > 0) {
295− dma_buf_map_set_vaddr(map, shmem->vaddr);
296+ iosys_map_set_vaddr(map, shmem->vaddr);
296297 return 0;
297298 }
298299
@@ -319,7 +320,7 @@ static int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem, struct · 20 unmodified lines
319320 if (!shmem->vaddr)
320321 ret = -ENOMEM;
321322 else
322− dma_buf_map_set_vaddr(map, shmem->vaddr);
323+ iosys_map_set_vaddr(map, shmem->vaddr);
323324 }
324325
325326 if (ret) {
@@ -353,7 +354,8 @@ err_zero_use: · 27 unmodified lines
353354 * Returns:
354355 * 0 on success or a negative error code on failure.
355356 */
356−int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem, struct dma_buf_map *map)
357+int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem,
358+ struct iosys_map *map)
357359 {
358360 int ret;
359361
@@ -368,7 +370,7 @@ int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem, struct dma_buf_map *m · 8 unmodified lines
368370 EXPORT_SYMBOL(drm_gem_shmem_vmap);
369371
370372 static void drm_gem_shmem_vunmap_locked(struct drm_gem_shmem_object *shmem,
371− struct dma_buf_map *map)
373+ struct iosys_map *map)
372374 {
373375 struct drm_gem_object *obj = &shmem->base;
374376
@@ -400,7 +402,8 @@ static void drm_gem_shmem_vunmap_locked(struct drm_gem_shmem_object *shmem, · 25 unmodified lines
400402 * This function hides the differences between dma-buf imported and natively
401403 * allocated objects.
402404 */
403−void drm_gem_shmem_vunmap(struct drm_gem_shmem_object *shmem, struct dma_buf_map *map)
405+void drm_gem_shmem_vunmap(struct drm_gem_shmem_object *shmem,
406+ struct iosys_map *map)
404407 {
405408 mutex_lock(&shmem->vmap_lock);
406409 drm_gem_shmem_vunmap_locked(shmem, map);
drivers/gpu/drm/drm_gem_ttm_helper.c+2−2
@@ -61,7 +61,7 @@ EXPORT_SYMBOL(drm_gem_ttm_print_info); · 60 unmodified lines
6161 * 0 on success, or a negative errno code otherwise.
6262 */
6363 int drm_gem_ttm_vmap(struct drm_gem_object *gem,
64− struct dma_buf_map *map)
64+ struct iosys_map *map)
6565 {
6666 struct ttm_buffer_object *bo = drm_gem_ttm_of_gem(gem);
6767
@@ -78,7 +78,7 @@ EXPORT_SYMBOL(drm_gem_ttm_vmap); · 10 unmodified lines
7878 * &drm_gem_object_funcs.vmap callback.
7979 */
8080 void drm_gem_ttm_vunmap(struct drm_gem_object *gem,
81− struct dma_buf_map *map)
81+ struct iosys_map *map)
8282 {
8383 struct ttm_buffer_object *bo = drm_gem_ttm_of_gem(gem);
8484
drivers/gpu/drm/drm_gem_vram_helper.c+14−11
@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0-or-later
22
3−#include <linux/dma-buf-map.h>
3+#include <linux/iosys-map.h>
44 #include <linux/module.h>
55
66 #include <drm/drm_debugfs.h>
@@ -116,7 +116,7 @@ static void drm_gem_vram_cleanup(struct drm_gem_vram_object *gbo) · 109 unmodified lines
116116 */
117117
118118 WARN_ON(gbo->vmap_use_count);
119− WARN_ON(dma_buf_map_is_set(&gbo->map));
119+ WARN_ON(iosys_map_is_set(&gbo->map));
120120
121121 drm_gem_object_release(&gbo->bo.base);
122122 }
@@ -365,7 +365,7 @@ int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo) · 242 unmodified lines
365365 EXPORT_SYMBOL(drm_gem_vram_unpin);
366366
367367 static int drm_gem_vram_kmap_locked(struct drm_gem_vram_object *gbo,
368− struct dma_buf_map *map)
368+ struct iosys_map *map)
369369 {
370370 int ret;
371371
@@ -377,7 +377,7 @@ static int drm_gem_vram_kmap_locked(struct drm_gem_vram_object *gbo, · 5 unmodified lines
377377 * page mapping might still be around. Only vmap if the there's
378378 * no mapping present.
379379 */
380− if (dma_buf_map_is_null(&gbo->map)) {
380+ if (iosys_map_is_null(&gbo->map)) {
381381 ret = ttm_bo_vmap(&gbo->bo, &gbo->map);
382382 if (ret)
383383 return ret;
@@ -391,14 +391,14 @@ out: · 7 unmodified lines
391391 }
392392
393393 static void drm_gem_vram_kunmap_locked(struct drm_gem_vram_object *gbo,
394− struct dma_buf_map *map)
394+ struct iosys_map *map)
395395 {
396396 struct drm_device *dev = gbo->bo.base.dev;
397397
398398 if (drm_WARN_ON_ONCE(dev, !gbo->vmap_use_count))
399399 return;
400400
401− if (drm_WARN_ON_ONCE(dev, !dma_buf_map_is_equal(&gbo->map, map)))
401+ if (drm_WARN_ON_ONCE(dev, !iosys_map_is_equal(&gbo->map, map)))
402402 return; /* BUG: map not mapped from this BO */
403403
404404 if (--gbo->vmap_use_count > 0)
@@ -428,7 +428,7 @@ static void drm_gem_vram_kunmap_locked(struct drm_gem_vram_object *gbo, · 23 unmodified lines
428428 * Returns:
429429 * 0 on success, or a negative error code otherwise.
430430 */
431−int drm_gem_vram_vmap(struct drm_gem_vram_object *gbo, struct dma_buf_map *map)
431+int drm_gem_vram_vmap(struct drm_gem_vram_object *gbo, struct iosys_map *map)
432432 {
433433 int ret;
434434
@@ -463,7 +463,8 @@ EXPORT_SYMBOL(drm_gem_vram_vmap); · 28 unmodified lines
463463 * A call to drm_gem_vram_vunmap() unmaps and unpins a GEM VRAM buffer. See
464464 * the documentation for drm_gem_vram_vmap() for more information.
465465 */
466−void drm_gem_vram_vunmap(struct drm_gem_vram_object *gbo, struct dma_buf_map *map)
466+void drm_gem_vram_vunmap(struct drm_gem_vram_object *gbo,
467+ struct iosys_map *map)
467468 {
468469 int ret;
469470
@@ -567,7 +568,7 @@ static void drm_gem_vram_bo_driver_move_notify(struct drm_gem_vram_object *gbo) · 97 unmodified lines
567568 return;
568569
569570 ttm_bo_vunmap(bo, &gbo->map);
570− dma_buf_map_clear(&gbo->map); /* explicitly clear mapping for next vmap call */
571+ iosys_map_clear(&gbo->map); /* explicitly clear mapping for next vmap call */
571572 }
572573
573574 static int drm_gem_vram_bo_driver_move(struct drm_gem_vram_object *gbo,
@@ -802,7 +803,8 @@ static void drm_gem_vram_object_unpin(struct drm_gem_object *gem) · 228 unmodified lines
802803 * Returns:
803804 * 0 on success, or a negative error code otherwise.
804805 */
805−static int drm_gem_vram_object_vmap(struct drm_gem_object *gem, struct dma_buf_map *map)
806+static int drm_gem_vram_object_vmap(struct drm_gem_object *gem,
807+ struct iosys_map *map)
806808 {
807809 struct drm_gem_vram_object *gbo = drm_gem_vram_of_gem(gem);
808810
@@ -815,7 +817,8 @@ static int drm_gem_vram_object_vmap(struct drm_gem_object *gem, struct dma_buf_m · 6 unmodified lines
815817 * @gem: The GEM object to unmap
816818 * @map: Kernel virtual address where the VRAM GEM object was mapped
817819 */
818−static void drm_gem_vram_object_vunmap(struct drm_gem_object *gem, struct dma_buf_map *map)
820+static void drm_gem_vram_object_vunmap(struct drm_gem_object *gem,
821+ struct iosys_map *map)
819822 {
820823 struct drm_gem_vram_object *gbo = drm_gem_vram_of_gem(gem);
821824
drivers/gpu/drm/drm_internal.h+3−3
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333
3434 struct dentry;
3535 struct dma_buf;
36−struct dma_buf_map;
36+struct iosys_map;
3737 struct drm_connector;
3838 struct drm_crtc;
3939 struct drm_framebuffer;
@@ -174,8 +174,8 @@ void drm_gem_print_info(struct drm_printer *p, unsigned int indent, · 134 unmodified lines
174174
175175 int drm_gem_pin(struct drm_gem_object *obj);
176176 void drm_gem_unpin(struct drm_gem_object *obj);
177−int drm_gem_vmap(struct drm_gem_object *obj, struct dma_buf_map *map);
178−void drm_gem_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map);
177+int drm_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map);
178+void drm_gem_vunmap(struct drm_gem_object *obj, struct iosys_map *map);
179179
180180 int drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,
181181 u32 handle);
drivers/gpu/drm/drm_mipi_dbi.c+4−4
@@ -201,8 +201,8 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb, · 200 unmodified lines
201201 struct drm_rect *clip, bool swap)
202202 {
203203 struct drm_gem_object *gem = drm_gem_fb_get_obj(fb, 0);
204− struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
205− struct dma_buf_map data[DRM_FORMAT_MAX_PLANES];
204+ struct iosys_map map[DRM_FORMAT_MAX_PLANES];
205+ struct iosys_map data[DRM_FORMAT_MAX_PLANES];
206206 void *src;
207207 int ret;
208208
@@ -258,8 +258,8 @@ static void mipi_dbi_set_window_address(struct mipi_dbi_dev *dbidev, · 49 unmodified lines
258258
259259 static void mipi_dbi_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)
260260 {
261− struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
262− struct dma_buf_map data[DRM_FORMAT_MAX_PLANES];
261+ struct iosys_map map[DRM_FORMAT_MAX_PLANES];
262+ struct iosys_map data[DRM_FORMAT_MAX_PLANES];
263263 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev);
264264 unsigned int height = rect->y2 - rect->y1;
265265 unsigned int width = rect->x2 - rect->x1;
drivers/gpu/drm/drm_prime.c+2−2
@@ -674,7 +674,7 @@ EXPORT_SYMBOL(drm_gem_unmap_dma_buf); · 673 unmodified lines
674674 *
675675 * Returns 0 on success or a negative errno code otherwise.
676676 */
677−int drm_gem_dmabuf_vmap(struct dma_buf *dma_buf, struct dma_buf_map *map)
677+int drm_gem_dmabuf_vmap(struct dma_buf *dma_buf, struct iosys_map *map)
678678 {
679679 struct drm_gem_object *obj = dma_buf->priv;
680680
@@ -690,7 +690,7 @@ EXPORT_SYMBOL(drm_gem_dmabuf_vmap); · 9 unmodified lines
690690 * Releases a kernel virtual mapping. This can be used as the
691691 * &dma_buf_ops.vunmap callback. Calls into &drm_gem_object_funcs.vunmap for device specific handling.
692692 */
693−void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, struct dma_buf_map *map)
693+void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, struct iosys_map *map)
694694 {
695695 struct drm_gem_object *obj = dma_buf->priv;
696696
drivers/gpu/drm/etnaviv/etnaviv_drv.h+1−1
@@ -49,7 +49,7 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data, · 48 unmodified lines
4949
5050 int etnaviv_gem_mmap_offset(struct drm_gem_object *obj, u64 *offset);
5151 struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object *obj);
52−int etnaviv_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map);
52+int etnaviv_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map);
5353 struct drm_gem_object *etnaviv_gem_prime_import_sg_table(struct drm_device *dev,
5454 struct dma_buf_attachment *attach, struct sg_table *sg);
5555 int etnaviv_gem_prime_pin(struct drm_gem_object *obj);
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c+4−4
@@ -25,14 +25,14 @@ struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object *obj) · 24 unmodified lines
2525 return drm_prime_pages_to_sg(obj->dev, etnaviv_obj->pages, npages);
2626 }
2727
28−int etnaviv_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map)
28+int etnaviv_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
2929 {
3030 void *vaddr;
3131
3232 vaddr = etnaviv_gem_vmap(obj);
3333 if (!vaddr)
3434 return -ENOMEM;
35− dma_buf_map_set_vaddr(map, vaddr);
35+ iosys_map_set_vaddr(map, vaddr);
3636
3737 return 0;
3838 }
@@ -62,7 +62,7 @@ void etnaviv_gem_prime_unpin(struct drm_gem_object *obj) · 23 unmodified lines
6262
6363 static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)
6464 {
65− struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(etnaviv_obj->vaddr);
65+ struct iosys_map map = IOSYS_MAP_INIT_VADDR(etnaviv_obj->vaddr);
6666
6767 if (etnaviv_obj->vaddr)
6868 dma_buf_vunmap(etnaviv_obj->base.import_attach->dmabuf, &map);
@@ -77,7 +77,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj) · 8 unmodified lines
7777
7878 static void *etnaviv_gem_prime_vmap_impl(struct etnaviv_gem_object *etnaviv_obj)
7979 {
80− struct dma_buf_map map;
80+ struct iosys_map map;
8181 int ret;
8282
8383 lockdep_assert_held(&etnaviv_obj->lock);
drivers/gpu/drm/gud/gud_pipe.c+2−2
@@ -152,8 +152,8 @@ static int gud_prep_flush(struct gud_device *gdrm, struct drm_framebuffer *fb, · 151 unmodified lines
152152 {
153153 struct dma_buf_attachment *import_attach = fb->obj[0]->import_attach;
154154 u8 compression = gdrm->compression;
155− struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
156− struct dma_buf_map map_data[DRM_FORMAT_MAX_PLANES];
155+ struct iosys_map map[DRM_FORMAT_MAX_PLANES];
156+ struct iosys_map map_data[DRM_FORMAT_MAX_PLANES];
157157 void *vaddr, *buf;
158158 size_t pitch, len;
159159 int ret = 0;
drivers/gpu/drm/hyperv/hyperv_drm_modeset.c+3−2
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include "hyperv_drm.h"
2020
2121 static int hyperv_blit_to_vram_rect(struct drm_framebuffer *fb,
22− const struct dma_buf_map *map,
22+ const struct iosys_map *map,
2323 struct drm_rect *rect)
2424 {
2525 struct hyperv_drm_device *hv = to_hv(fb->dev);
@@ -38,7 +38,8 @@ static int hyperv_blit_to_vram_rect(struct drm_framebuffer *fb, · 12 unmodified lines
3838 return 0;
3939 }
4040
41−static int hyperv_blit_to_vram_fullscreen(struct drm_framebuffer *fb, const struct dma_buf_map *map)
41+static int hyperv_blit_to_vram_fullscreen(struct drm_framebuffer *fb,
42+ const struct iosys_map *map)
4243 {
4344 struct drm_rect fullscreen = {
4445 .x1 = 0,
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c+5−3
@@ -74,7 +74,8 @@ static void i915_gem_unmap_dma_buf(struct dma_buf_attachment *attachment, · 73 unmodified lines
7474 kfree(sg);
7575 }
7676
77−static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf, struct dma_buf_map *map)
77+static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf,
78+ struct iosys_map *map)
7879 {
7980 struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf);
8081 void *vaddr;
@@ -83,12 +84,13 @@ static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf, struct dma_buf_map *map · 2 unmodified lines
8384 if (IS_ERR(vaddr))
8485 return PTR_ERR(vaddr);
8586
86− dma_buf_map_set_vaddr(map, vaddr);
87+ iosys_map_set_vaddr(map, vaddr);
8788
8889 return 0;
8990 }
9091
91−static void i915_gem_dmabuf_vunmap(struct dma_buf *dma_buf, struct dma_buf_map *map)
92+static void i915_gem_dmabuf_vunmap(struct dma_buf *dma_buf,
93+ struct iosys_map *map)
9294 {
9395 struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf);
9496
drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c+3−3
@@ -266,7 +266,7 @@ static int igt_dmabuf_import(void *arg) · 265 unmodified lines
266266 struct drm_i915_gem_object *obj;
267267 struct dma_buf *dmabuf;
268268 void *obj_map, *dma_map;
269− struct dma_buf_map map;
269+ struct iosys_map map;
270270 u32 pattern[] = { 0, 0xaa, 0xcc, 0x55, 0xff };
271271 int err, i;
272272
@@ -349,7 +349,7 @@ static int igt_dmabuf_import_ownership(void *arg) · 76 unmodified lines
349349 struct drm_i915_private *i915 = arg;
350350 struct drm_i915_gem_object *obj;
351351 struct dma_buf *dmabuf;
352− struct dma_buf_map map;
352+ struct iosys_map map;
353353 void *ptr;
354354 int err;
355355
@@ -400,7 +400,7 @@ static int igt_dmabuf_export_vmap(void *arg) · 44 unmodified lines
400400 struct drm_i915_private *i915 = arg;
401401 struct drm_i915_gem_object *obj;
402402 struct dma_buf *dmabuf;
403− struct dma_buf_map map;
403+ struct iosys_map map;
404404 void *ptr;
405405 int err;
406406
drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c+3−3
@@ -61,7 +61,7 @@ static void mock_dmabuf_release(struct dma_buf *dma_buf) · 60 unmodified lines
6161 kfree(mock);
6262 }
6363
64−static int mock_dmabuf_vmap(struct dma_buf *dma_buf, struct dma_buf_map *map)
64+static int mock_dmabuf_vmap(struct dma_buf *dma_buf, struct iosys_map *map)
6565 {
6666 struct mock_dmabuf *mock = to_mock(dma_buf);
6767 void *vaddr;
@@ -69,12 +69,12 @@ static int mock_dmabuf_vmap(struct dma_buf *dma_buf, struct dma_buf_map *map) · 1 unmodified line
6969 vaddr = vm_map_ram(mock->pages, mock->npages, 0);
7070 if (!vaddr)
7171 return -ENOMEM;
72− dma_buf_map_set_vaddr(map, vaddr);
72+ iosys_map_set_vaddr(map, vaddr);
7373
7474 return 0;
7575 }
7676
77−static void mock_dmabuf_vunmap(struct dma_buf *dma_buf, struct dma_buf_map *map)
77+static void mock_dmabuf_vunmap(struct dma_buf *dma_buf, struct iosys_map *map)
7878 {
7979 struct mock_dmabuf *mock = to_mock(dma_buf);
8080
drivers/gpu/drm/lima/lima_gem.c+2−1
@@ -2,6 +2,7 @@ · 1 unmodified line
22 /* Copyright 2017-2019 Qiang Yu <yuq825@gmail.com> */
33
44 #include <linux/mm.h>
5+#include <linux/iosys-map.h>
56 #include <linux/sync_file.h>
67 #include <linux/pagemap.h>
78 #include <linux/shmem_fs.h>
@@ -182,7 +183,7 @@ static int lima_gem_pin(struct drm_gem_object *obj) · 174 unmodified lines
182183 return drm_gem_shmem_pin(&bo->base);
183184 }
184185
185−static int lima_gem_vmap(struct drm_gem_object *obj, struct dma_buf_map *map)
186+static int lima_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map)
186187 {
187188 struct lima_bo *bo = to_lima_bo(obj);
188189
drivers/gpu/drm/lima/lima_sched.c+2−2
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0 OR MIT
22 /* Copyright 2017-2019 Qiang Yu <yuq825@gmail.com> */
33
4−#include <linux/dma-buf-map.h>
4+#include <linux/iosys-map.h>
55 #include <linux/kthread.h>
66 #include <linux/slab.h>
77 #include <linux/vmalloc.h>
@@ -284,7 +284,7 @@ static void lima_sched_build_error_task_list(struct lima_sched_task *task) · 276 unmodified lines
284284 struct lima_dump_chunk_buffer *buffer_chunk;
285285 u32 size, task_size, mem_size;
286286 int i;
287− struct dma_buf_map map;
287+ struct iosys_map map;
288288 int ret;
289289
290290 mutex_lock(&dev->error_task_list_lock);
drivers/gpu/drm/mediatek/mtk_drm_gem.c+4−3
@@ -220,7 +220,7 @@ struct drm_gem_object *mtk_gem_prime_import_sg_table(struct drm_device *dev, · 219 unmodified lines
220220 return &mtk_gem->base;
221221 }
222222
223−int mtk_drm_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map)
223+int mtk_drm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
224224 {
225225 struct mtk_drm_gem_obj *mtk_gem = to_mtk_gem_obj(obj);
226226 struct sg_table *sgt = NULL;
@@ -247,12 +247,13 @@ int mtk_drm_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map) · 20 unmodified lines
247247
248248 out:
249249 kfree(sgt);
250− dma_buf_map_set_vaddr(map, mtk_gem->kvaddr);
250+ iosys_map_set_vaddr(map, mtk_gem->kvaddr);
251251
252252 return 0;
253253 }
254254
255−void mtk_drm_gem_prime_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map)
255+void mtk_drm_gem_prime_vunmap(struct drm_gem_object *obj,
256+ struct iosys_map *map)
256257 {
257258 struct mtk_drm_gem_obj *mtk_gem = to_mtk_gem_obj(obj);
258259 void *vaddr = map->vaddr;
drivers/gpu/drm/mediatek/mtk_drm_gem.h+3−2
@@ -42,7 +42,8 @@ int mtk_drm_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev, · 41 unmodified lines
4242 struct sg_table *mtk_gem_prime_get_sg_table(struct drm_gem_object *obj);
4343 struct drm_gem_object *mtk_gem_prime_import_sg_table(struct drm_device *dev,
4444 struct dma_buf_attachment *attach, struct sg_table *sg);
45−int mtk_drm_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map);
46−void mtk_drm_gem_prime_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map);
45+int mtk_drm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map);
46+void mtk_drm_gem_prime_vunmap(struct drm_gem_object *obj,
47+ struct iosys_map *map);
4748
4849 #endif
drivers/gpu/drm/mgag200/mgag200_mode.c+2−2
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 */
1010
1111 #include <linux/delay.h>
12−#include <linux/dma-buf-map.h>
12+#include <linux/iosys-map.h>
1313
1414 #include <drm/drm_atomic_helper.h>
1515 #include <drm/drm_atomic_state_helper.h>
@@ -845,7 +845,7 @@ mgag200_simple_display_pipe_mode_valid(struct drm_simple_display_pipe *pipe, · 829 unmodified lines
845845
846846 static void
847847 mgag200_handle_damage(struct mga_device *mdev, struct drm_framebuffer *fb,
848− struct drm_rect *clip, const struct dma_buf_map *map)
848+ struct drm_rect *clip, const struct iosys_map *map)
849849 {
850850 void __iomem *dst = mdev->vram;
851851 void *vmap = map->vaddr; /* TODO: Use mapping abstraction properly */
drivers/gpu/drm/msm/msm_drv.h+2−2
@@ -309,8 +309,8 @@ void msm_gem_shrinker_init(struct drm_device *dev); · 308 unmodified lines
309309 void msm_gem_shrinker_cleanup(struct drm_device *dev);
310310
311311 struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj);
312−int msm_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map);
313−void msm_gem_prime_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map);
312+int msm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map);
313+void msm_gem_prime_vunmap(struct drm_gem_object *obj, struct iosys_map *map);
314314 struct drm_gem_object *msm_gem_prime_import_sg_table(struct drm_device *dev,
315315 struct dma_buf_attachment *attach, struct sg_table *sg);
316316 int msm_gem_prime_pin(struct drm_gem_object *obj);
drivers/gpu/drm/msm/msm_gem_prime.c+3−3
@@ -22,19 +22,19 @@ struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj) · 21 unmodified lines
2222 return drm_prime_pages_to_sg(obj->dev, msm_obj->pages, npages);
2323 }
2424
25−int msm_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map)
25+int msm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
2626 {
2727 void *vaddr;
2828
2929 vaddr = msm_gem_get_vaddr(obj);
3030 if (IS_ERR(vaddr))
3131 return PTR_ERR(vaddr);
32− dma_buf_map_set_vaddr(map, vaddr);
32+ iosys_map_set_vaddr(map, vaddr);
3333
3434 return 0;
3535 }
3636
37−void msm_gem_prime_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map)
37+void msm_gem_prime_vunmap(struct drm_gem_object *obj, struct iosys_map *map)
3838 {
3939 msm_gem_put_vaddr(obj);
4040 }
drivers/gpu/drm/panfrost/panfrost_perfcnt.c+7−6
@@ -1,16 +1,17 @@
11 // SPDX-License-Identifier: GPL-2.0
22 /* Copyright 2019 Collabora Ltd */
33
4−#include <drm/drm_file.h>
5−#include <drm/drm_gem_shmem_helper.h>
6−#include <drm/panfrost_drm.h>
74 #include <linux/completion.h>
8−#include <linux/dma-buf-map.h>
95 #include <linux/iopoll.h>
6+#include <linux/iosys-map.h>
107 #include <linux/pm_runtime.h>
118 #include <linux/slab.h>
129 #include <linux/uaccess.h>
1310
11+#include <drm/drm_file.h>
12+#include <drm/drm_gem_shmem_helper.h>
13+#include <drm/panfrost_drm.h>
14+
1415 #include "panfrost_device.h"
1516 #include "panfrost_features.h"
1617 #include "panfrost_gem.h"
@@ -73,7 +74,7 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev, · 56 unmodified lines
7374 {
7475 struct panfrost_file_priv *user = file_priv->driver_priv;
7576 struct panfrost_perfcnt *perfcnt = pfdev->perfcnt;
76− struct dma_buf_map map;
77+ struct iosys_map map;
7778 struct drm_gem_shmem_object *bo;
7879 u32 cfg, as;
7980 int ret;
@@ -181,7 +182,7 @@ static int panfrost_perfcnt_disable_locked(struct panfrost_device *pfdev, · 101 unmodified lines
181182 {
182183 struct panfrost_file_priv *user = file_priv->driver_priv;
183184 struct panfrost_perfcnt *perfcnt = pfdev->perfcnt;
184− struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(perfcnt->buf);
185+ struct iosys_map map = IOSYS_MAP_INIT_VADDR(perfcnt->buf);
185186
186187 if (user != perfcnt->user)
187188 return -EINVAL;
drivers/gpu/drm/qxl/qxl_display.c+4−4
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525
2626 #include <linux/crc32.h>
2727 #include <linux/delay.h>
28−#include <linux/dma-buf-map.h>
28+#include <linux/iosys-map.h>
2929
3030 #include <drm/drm_drv.h>
3131 #include <drm/drm_atomic.h>
@@ -566,8 +566,8 @@ static struct qxl_bo *qxl_create_cursor(struct qxl_device *qdev, · 534 unmodified lines
566566 {
567567 static const u32 size = 64 * 64 * 4;
568568 struct qxl_bo *cursor_bo;
569− struct dma_buf_map cursor_map;
570− struct dma_buf_map user_map;
569+ struct iosys_map cursor_map;
570+ struct iosys_map user_map;
571571 struct qxl_cursor cursor;
572572 int ret;
573573
@@ -1183,7 +1183,7 @@ int qxl_create_monitors_object(struct qxl_device *qdev) · 609 unmodified lines
11831183 {
11841184 int ret;
11851185 struct drm_gem_object *gobj;
1186− struct dma_buf_map map;
1186+ struct iosys_map map;
11871187 int monitors_config_size = sizeof(struct qxl_monitors_config) +
11881188 qxl_num_crtc * sizeof(struct qxl_head);
11891189
drivers/gpu/drm/qxl/qxl_draw.c+3−3
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2121 */
2222
23−#include <linux/dma-buf-map.h>
23+#include <linux/iosys-map.h>
2424
2525 #include <drm/drm_fourcc.h>
2626
@@ -44,7 +44,7 @@ static struct qxl_rect *drawable_set_clipping(struct qxl_device *qdev, · 17 unmodified lines
4444 unsigned int num_clips,
4545 struct qxl_bo *clips_bo)
4646 {
47− struct dma_buf_map map;
47+ struct iosys_map map;
4848 struct qxl_clip_rects *dev_clips;
4949 int ret;
5050
@@ -146,7 +146,7 @@ void qxl_draw_dirty_fb(struct qxl_device *qdev, · 95 unmodified lines
146146 int stride = fb->pitches[0];
147147 /* depth is not actually interesting, we don't mask with it */
148148 int depth = fb->format->cpp[0] * 8;
149− struct dma_buf_map surface_map;
149+ struct iosys_map surface_map;
150150 uint8_t *surface_base;
151151 struct qxl_release *release;
152152 struct qxl_bo *clips_bo;
drivers/gpu/drm/qxl/qxl_drv.h+5−5
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 * Definitions taken from spice-protocol, plus kernel driver specific bits.
3131 */
3232
33−#include <linux/dma-buf-map.h>
33+#include <linux/iosys-map.h>
3434 #include <linux/dma-fence.h>
3535 #include <linux/firmware.h>
3636 #include <linux/platform_device.h>
@@ -50,7 +50,7 @@ · 13 unmodified lines
5050
5151 #include "qxl_dev.h"
5252
53−struct dma_buf_map;
53+struct iosys_map;
5454
5555 #define DRIVER_AUTHOR "Dave Airlie"
5656
@@ -81,7 +81,7 @@ struct qxl_bo { · 24 unmodified lines
8181 /* Protected by tbo.reserved */
8282 struct ttm_place placements[3];
8383 struct ttm_placement placement;
84− struct dma_buf_map map;
84+ struct iosys_map map;
8585 void *kptr;
8686 unsigned int map_count;
8787 int type;
@@ -431,9 +431,9 @@ struct sg_table *qxl_gem_prime_get_sg_table(struct drm_gem_object *obj); · 343 unmodified lines
431431 struct drm_gem_object *qxl_gem_prime_import_sg_table(
432432 struct drm_device *dev, struct dma_buf_attachment *attach,
433433 struct sg_table *sgt);
434−int qxl_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map);
434+int qxl_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map);
435435 void qxl_gem_prime_vunmap(struct drm_gem_object *obj,
436− struct dma_buf_map *map);
436+ struct iosys_map *map);
437437
438438 /* qxl_irq.c */
439439 int qxl_irq_init(struct qxl_device *qdev);
drivers/gpu/drm/qxl/qxl_object.c+4−4
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 * Alon Levy
2424 */
2525
26−#include <linux/dma-buf-map.h>
26+#include <linux/iosys-map.h>
2727 #include <linux/io-mapping.h>
2828
2929 #include "qxl_drv.h"
@@ -158,7 +158,7 @@ int qxl_bo_create(struct qxl_device *qdev, unsigned long size, · 128 unmodified lines
158158 return 0;
159159 }
160160
161−int qxl_bo_vmap_locked(struct qxl_bo *bo, struct dma_buf_map *map)
161+int qxl_bo_vmap_locked(struct qxl_bo *bo, struct iosys_map *map)
162162 {
163163 int r;
164164
@@ -184,7 +184,7 @@ out: · 19 unmodified lines
184184 return 0;
185185 }
186186
187−int qxl_bo_vmap(struct qxl_bo *bo, struct dma_buf_map *map)
187+int qxl_bo_vmap(struct qxl_bo *bo, struct iosys_map *map)
188188 {
189189 int r;
190190
@@ -210,7 +210,7 @@ void *qxl_bo_kmap_atomic_page(struct qxl_device *qdev, · 19 unmodified lines
210210 void *rptr;
211211 int ret;
212212 struct io_mapping *map;
213− struct dma_buf_map bo_map;
213+ struct iosys_map bo_map;
214214
215215 if (bo->tbo.resource->mem_type == TTM_PL_VRAM)
216216 map = qdev->vram_mapping;
drivers/gpu/drm/qxl/qxl_object.h+2−2
@@ -59,8 +59,8 @@ extern int qxl_bo_create(struct qxl_device *qdev, · 58 unmodified lines
5959 u32 priority,
6060 struct qxl_surface *surf,
6161 struct qxl_bo **bo_ptr);
62−int qxl_bo_vmap(struct qxl_bo *bo, struct dma_buf_map *map);
63−int qxl_bo_vmap_locked(struct qxl_bo *bo, struct dma_buf_map *map);
62+int qxl_bo_vmap(struct qxl_bo *bo, struct iosys_map *map);
63+int qxl_bo_vmap_locked(struct qxl_bo *bo, struct iosys_map *map);
6464 int qxl_bo_vunmap(struct qxl_bo *bo);
6565 void qxl_bo_vunmap_locked(struct qxl_bo *bo);
6666 void *qxl_bo_kmap_atomic_page(struct qxl_device *qdev, struct qxl_bo *bo, int page_offset);
drivers/gpu/drm/qxl/qxl_prime.c+2−2
@@ -54,7 +54,7 @@ struct drm_gem_object *qxl_gem_prime_import_sg_table( · 53 unmodified lines
5454 return ERR_PTR(-ENOSYS);
5555 }
5656
57−int qxl_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map)
57+int qxl_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
5858 {
5959 struct qxl_bo *bo = gem_to_qxl_bo(obj);
6060 int ret;
@@ -67,7 +67,7 @@ int qxl_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map) · 6 unmodified lines
6767 }
6868
6969 void qxl_gem_prime_vunmap(struct drm_gem_object *obj,
70− struct dma_buf_map *map)
70+ struct iosys_map *map)
7171 {
7272 struct qxl_bo *bo = gem_to_qxl_bo(obj);
7373
drivers/gpu/drm/radeon/radeon_gem.c+1−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 * Jerome Glisse
2727 */
2828
29+#include <linux/iosys-map.h>
2930 #include <linux/pci.h>
3031
3132 #include <drm/drm_device.h>
drivers/gpu/drm/rockchip/rockchip_drm_gem.c+5−4
@@ -510,7 +510,7 @@ err_free_rk_obj: · 509 unmodified lines
510510 return ERR_PTR(ret);
511511 }
512512
513−int rockchip_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map)
513+int rockchip_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
514514 {
515515 struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj);
516516
@@ -519,18 +519,19 @@ int rockchip_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map) · 2 unmodified lines
519519 pgprot_writecombine(PAGE_KERNEL));
520520 if (!vaddr)
521521 return -ENOMEM;
522− dma_buf_map_set_vaddr(map, vaddr);
522+ iosys_map_set_vaddr(map, vaddr);
523523 return 0;
524524 }
525525
526526 if (rk_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING)
527527 return -ENOMEM;
528− dma_buf_map_set_vaddr(map, rk_obj->kvaddr);
528+ iosys_map_set_vaddr(map, rk_obj->kvaddr);
529529
530530 return 0;
531531 }
532532
533−void rockchip_gem_prime_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map)
533+void rockchip_gem_prime_vunmap(struct drm_gem_object *obj,
534+ struct iosys_map *map)
534535 {
535536 struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj);
536537
drivers/gpu/drm/rockchip/rockchip_drm_gem.h+3−2
@@ -31,8 +31,9 @@ struct drm_gem_object * · 30 unmodified lines
3131 rockchip_gem_prime_import_sg_table(struct drm_device *dev,
3232 struct dma_buf_attachment *attach,
3333 struct sg_table *sg);
34−int rockchip_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map);
35−void rockchip_gem_prime_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map);
34+int rockchip_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map);
35+void rockchip_gem_prime_vunmap(struct drm_gem_object *obj,
36+ struct iosys_map *map);
3637
3738 struct rockchip_gem_object *
3839 rockchip_gem_create_object(struct drm_device *drm, unsigned int size,
drivers/gpu/drm/tegra/gem.c+5−5
@@ -174,7 +174,7 @@ static void tegra_bo_unpin(struct host1x_bo_mapping *map) · 173 unmodified lines
174174 static void *tegra_bo_mmap(struct host1x_bo *bo)
175175 {
176176 struct tegra_bo *obj = host1x_to_tegra_bo(bo);
177− struct dma_buf_map map;
177+ struct iosys_map map;
178178 int ret;
179179
180180 if (obj->vaddr) {
@@ -191,7 +191,7 @@ static void *tegra_bo_mmap(struct host1x_bo *bo) · 10 unmodified lines
191191 static void tegra_bo_munmap(struct host1x_bo *bo, void *addr)
192192 {
193193 struct tegra_bo *obj = host1x_to_tegra_bo(bo);
194− struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(addr);
194+ struct iosys_map map = IOSYS_MAP_INIT_VADDR(addr);
195195
196196 if (obj->vaddr)
197197 return;
@@ -699,17 +699,17 @@ static int tegra_gem_prime_mmap(struct dma_buf *buf, struct vm_area_struct *vma) · 501 unmodified lines
699699 return __tegra_gem_mmap(gem, vma);
700700 }
701701
702−static int tegra_gem_prime_vmap(struct dma_buf *buf, struct dma_buf_map *map)
702+static int tegra_gem_prime_vmap(struct dma_buf *buf, struct iosys_map *map)
703703 {
704704 struct drm_gem_object *gem = buf->priv;
705705 struct tegra_bo *bo = to_tegra_bo(gem);
706706
707− dma_buf_map_set_vaddr(map, bo->vaddr);
707+ iosys_map_set_vaddr(map, bo->vaddr);
708708
709709 return 0;
710710 }
711711
712−static void tegra_gem_prime_vunmap(struct dma_buf *buf, struct dma_buf_map *map)
712+static void tegra_gem_prime_vunmap(struct dma_buf *buf, struct iosys_map *map)
713713 {
714714 }
715715
drivers/gpu/drm/tiny/cirrus.c+5−3
@@ -16,7 +16,7 @@ · 15 unmodified lines
1616 * Copyright 1999-2001 Jeff Garzik <jgarzik@pobox.com>
1717 */
1818
19−#include <linux/dma-buf-map.h>
19+#include <linux/iosys-map.h>
2020 #include <linux/module.h>
2121 #include <linux/pci.h>
2222
@@ -312,7 +312,8 @@ static int cirrus_mode_set(struct cirrus_device *cirrus, · 289 unmodified lines
312312 return 0;
313313 }
314314
315−static int cirrus_fb_blit_rect(struct drm_framebuffer *fb, const struct dma_buf_map *map,
315+static int cirrus_fb_blit_rect(struct drm_framebuffer *fb,
316+ const struct iosys_map *map,
316317 struct drm_rect *rect)
317318 {
318319 struct cirrus_device *cirrus = to_cirrus(fb->dev);
@@ -344,7 +345,8 @@ static int cirrus_fb_blit_rect(struct drm_framebuffer *fb, const struct dma_buf_ · 25 unmodified lines
344345 return 0;
345346 }
346347
347−static int cirrus_fb_blit_fullscreen(struct drm_framebuffer *fb, const struct dma_buf_map *map)
348+static int cirrus_fb_blit_fullscreen(struct drm_framebuffer *fb,
349+ const struct iosys_map *map)
348350 {
349351 struct drm_rect fullscreen = {
350352 .x1 = 0,
drivers/gpu/drm/tiny/gm12u320.c+4−3
@@ -95,7 +95,7 @@ struct gm12u320_device { · 94 unmodified lines
9595 struct drm_rect rect;
9696 int frame;
9797 int draw_status_timeout;
98− struct dma_buf_map src_map;
98+ struct iosys_map src_map;
9999 } fb_update;
100100 };
101101
@@ -395,7 +395,8 @@ err: · 293 unmodified lines
395395 GM12U320_ERR("Frame update error: %d\n", ret);
396396 }
397397
398−static void gm12u320_fb_mark_dirty(struct drm_framebuffer *fb, const struct dma_buf_map *map,
398+static void gm12u320_fb_mark_dirty(struct drm_framebuffer *fb,
399+ const struct iosys_map *map,
399400 struct drm_rect *dirty)
400401 {
401402 struct gm12u320_device *gm12u320 = to_gm12u320(fb->dev);
@@ -438,7 +439,7 @@ static void gm12u320_stop_fb_update(struct gm12u320_device *gm12u320) · 36 unmodified lines
438439 mutex_lock(&gm12u320->fb_update.lock);
439440 old_fb = gm12u320->fb_update.fb;
440441 gm12u320->fb_update.fb = NULL;
441− dma_buf_map_clear(&gm12u320->fb_update.src_map);
442+ iosys_map_clear(&gm12u320->fb_update.src_map);
442443 mutex_unlock(&gm12u320->fb_update.lock);
443444
444445 drm_framebuffer_put(old_fb);
drivers/gpu/drm/ttm/ttm_bo_util.c+8−8
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 #include <drm/ttm/ttm_placement.h>
3434 #include <drm/drm_cache.h>
3535 #include <drm/drm_vma_manager.h>
36−#include <linux/dma-buf-map.h>
36+#include <linux/iosys-map.h>
3737 #include <linux/io.h>
3838 #include <linux/highmem.h>
3939 #include <linux/wait.h>
@@ -93,7 +93,7 @@ void ttm_move_memcpy(bool clear, · 53 unmodified lines
9393 {
9494 const struct ttm_kmap_iter_ops *dst_ops = dst_iter->ops;
9595 const struct ttm_kmap_iter_ops *src_ops = src_iter->ops;
96− struct dma_buf_map src_map, dst_map;
96+ struct iosys_map src_map, dst_map;
9797 pgoff_t i;
9898
9999 /* Single TTM move. NOP */
@@ -385,7 +385,7 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map) · 285 unmodified lines
385385 }
386386 EXPORT_SYMBOL(ttm_bo_kunmap);
387387
388−int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map)
388+int ttm_bo_vmap(struct ttm_buffer_object *bo, struct iosys_map *map)
389389 {
390390 struct ttm_resource *mem = bo->resource;
391391 int ret;
@@ -413,7 +413,7 @@ int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map) · 21 unmodified lines
413413 if (!vaddr_iomem)
414414 return -ENOMEM;
415415
416− dma_buf_map_set_vaddr_iomem(map, vaddr_iomem);
416+ iosys_map_set_vaddr_iomem(map, vaddr_iomem);
417417
418418 } else {
419419 struct ttm_operation_ctx ctx = {
@@ -437,25 +437,25 @@ int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map) · 17 unmodified lines
437437 if (!vaddr)
438438 return -ENOMEM;
439439
440− dma_buf_map_set_vaddr(map, vaddr);
440+ iosys_map_set_vaddr(map, vaddr);
441441 }
442442
443443 return 0;
444444 }
445445 EXPORT_SYMBOL(ttm_bo_vmap);
446446
447−void ttm_bo_vunmap(struct ttm_buffer_object *bo, struct dma_buf_map *map)
447+void ttm_bo_vunmap(struct ttm_buffer_object *bo, struct iosys_map *map)
448448 {
449449 struct ttm_resource *mem = bo->resource;
450450
451− if (dma_buf_map_is_null(map))
451+ if (iosys_map_is_null(map))
452452 return;
453453
454454 if (!map->is_iomem)
455455 vunmap(map->vaddr);
456456 else if (!mem->bus.addr)
457457 iounmap(map->vaddr_iomem);
458− dma_buf_map_clear(map);
458+ iosys_map_clear(map);
459459
460460 ttm_mem_io_free(bo->bdev, bo->resource);
461461 }
drivers/gpu/drm/ttm/ttm_resource.c+21−21
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * Authors: Christian König
2323 */
2424
25−#include <linux/dma-buf-map.h>
25+#include <linux/iosys-map.h>
2626 #include <linux/io-mapping.h>
2727 #include <linux/scatterlist.h>
2828
@@ -209,7 +209,7 @@ void ttm_resource_manager_debug(struct ttm_resource_manager *man, · 180 unmodified lines
209209 EXPORT_SYMBOL(ttm_resource_manager_debug);
210210
211211 static void ttm_kmap_iter_iomap_map_local(struct ttm_kmap_iter *iter,
212− struct dma_buf_map *dmap,
212+ struct iosys_map *dmap,
213213 pgoff_t i)
214214 {
215215 struct ttm_kmap_iter_iomap *iter_io =
@@ -236,11 +236,11 @@ retry: · 20 unmodified lines
236236 addr = io_mapping_map_local_wc(iter_io->iomap, iter_io->cache.offs +
237237 (((resource_size_t)i - iter_io->cache.i)
238238 << PAGE_SHIFT));
239− dma_buf_map_set_vaddr_iomem(dmap, addr);
239+ iosys_map_set_vaddr_iomem(dmap, addr);
240240 }
241241
242242 static void ttm_kmap_iter_iomap_unmap_local(struct ttm_kmap_iter *iter,
243− struct dma_buf_map *map)
243+ struct iosys_map *map)
244244 {
245245 io_mapping_unmap_local(map->vaddr_iomem);
246246 }
@@ -291,14 +291,14 @@ EXPORT_SYMBOL(ttm_kmap_iter_iomap_init); · 44 unmodified lines
291291 */
292292
293293 static void ttm_kmap_iter_linear_io_map_local(struct ttm_kmap_iter *iter,
294− struct dma_buf_map *dmap,
294+ struct iosys_map *dmap,
295295 pgoff_t i)
296296 {
297297 struct ttm_kmap_iter_linear_io *iter_io =
298298 container_of(iter, typeof(*iter_io), base);
299299
300300 *dmap = iter_io->dmap;
301− dma_buf_map_incr(dmap, i * PAGE_SIZE);
301+ iosys_map_incr(dmap, i * PAGE_SIZE);
302302 }
303303
304304 static const struct ttm_kmap_iter_ops ttm_kmap_iter_linear_io_ops = {
@@ -334,7 +334,7 @@ ttm_kmap_iter_linear_io_init(struct ttm_kmap_iter_linear_io *iter_io, · 29 unmodified lines
334334 }
335335
336336 if (mem->bus.addr) {
337− dma_buf_map_set_vaddr(&iter_io->dmap, mem->bus.addr);
337+ iosys_map_set_vaddr(&iter_io->dmap, mem->bus.addr);
338338 iter_io->needs_unmap = false;
339339 } else {
340340 size_t bus_size = (size_t)mem->num_pages << PAGE_SHIFT;
@@ -342,23 +342,23 @@ ttm_kmap_iter_linear_io_init(struct ttm_kmap_iter_linear_io *iter_io, · 1 unmodified line
342342 iter_io->needs_unmap = true;
343343 memset(&iter_io->dmap, 0, sizeof(iter_io->dmap));
344344 if (mem->bus.caching == ttm_write_combined)
345− dma_buf_map_set_vaddr_iomem(&iter_io->dmap,
346− ioremap_wc(mem->bus.offset,
347− bus_size));
345+ iosys_map_set_vaddr_iomem(&iter_io->dmap,
346+ ioremap_wc(mem->bus.offset,
347+ bus_size));
348348 else if (mem->bus.caching == ttm_cached)
349− dma_buf_map_set_vaddr(&iter_io->dmap,
350− memremap(mem->bus.offset, bus_size,
351− MEMREMAP_WB |
352− MEMREMAP_WT |
353− MEMREMAP_WC));
349+ iosys_map_set_vaddr(&iter_io->dmap,
350+ memremap(mem->bus.offset, bus_size,
351+ MEMREMAP_WB |
352+ MEMREMAP_WT |
353+ MEMREMAP_WC));
354354
355355 /* If uncached requested or if mapping cached or wc failed */
356− if (dma_buf_map_is_null(&iter_io->dmap))
357− dma_buf_map_set_vaddr_iomem(&iter_io->dmap,
358− ioremap(mem->bus.offset,
359− bus_size));
356+ if (iosys_map_is_null(&iter_io->dmap))
357+ iosys_map_set_vaddr_iomem(&iter_io->dmap,
358+ ioremap(mem->bus.offset,
359+ bus_size));
360360
361− if (dma_buf_map_is_null(&iter_io->dmap)) {
361+ if (iosys_map_is_null(&iter_io->dmap)) {
362362 ret = -ENOMEM;
363363 goto out_io_free;
364364 }
@@ -387,7 +387,7 @@ ttm_kmap_iter_linear_io_fini(struct ttm_kmap_iter_linear_io *iter_io, · 22 unmodified lines
387387 struct ttm_device *bdev,
388388 struct ttm_resource *mem)
389389 {
390− if (iter_io->needs_unmap && dma_buf_map_is_set(&iter_io->dmap)) {
390+ if (iter_io->needs_unmap && iosys_map_is_set(&iter_io->dmap)) {
391391 if (iter_io->dmap.is_iomem)
392392 iounmap(iter_io->dmap.vaddr_iomem);
393393 else
drivers/gpu/drm/ttm/ttm_tt.c+4−4
@@ -406,18 +406,18 @@ void ttm_tt_mgr_init(unsigned long num_pages, unsigned long num_dma32_pages) · 405 unmodified lines
406406 }
407407
408408 static void ttm_kmap_iter_tt_map_local(struct ttm_kmap_iter *iter,
409− struct dma_buf_map *dmap,
409+ struct iosys_map *dmap,
410410 pgoff_t i)
411411 {
412412 struct ttm_kmap_iter_tt *iter_tt =
413413 container_of(iter, typeof(*iter_tt), base);
414414
415− dma_buf_map_set_vaddr(dmap, kmap_local_page_prot(iter_tt->tt->pages[i],
416− iter_tt->prot));
415+ iosys_map_set_vaddr(dmap, kmap_local_page_prot(iter_tt->tt->pages[i],
416+ iter_tt->prot));
417417 }
418418
419419 static void ttm_kmap_iter_tt_unmap_local(struct ttm_kmap_iter *iter,
420− struct dma_buf_map *map)
420+ struct iosys_map *map)
421421 {
422422 kunmap_local(map->vaddr);
423423 }
drivers/gpu/drm/udl/udl_modeset.c+2−1
@@ -264,7 +264,8 @@ static int udl_aligned_damage_clip(struct drm_rect *clip, int x, int y, · 263 unmodified lines
264264 return 0;
265265 }
266266
267−static int udl_handle_damage(struct drm_framebuffer *fb, const struct dma_buf_map *map,
267+static int udl_handle_damage(struct drm_framebuffer *fb,
268+ const struct iosys_map *map,
268269 int x, int y, int width, int height)
269270 {
270271 struct drm_device *dev = fb->dev;
drivers/gpu/drm/vboxvideo/vbox_mode.c+2−2
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 * Hans de Goede <hdegoede@redhat.com>
1111 */
1212
13−#include <linux/dma-buf-map.h>
13+#include <linux/iosys-map.h>
1414 #include <linux/export.h>
1515
1616 #include <drm/drm_atomic.h>
@@ -398,7 +398,7 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane, · 381 unmodified lines
398398 u32 height = new_state->crtc_h;
399399 struct drm_shadow_plane_state *shadow_plane_state =
400400 to_drm_shadow_plane_state(new_state);
401− struct dma_buf_map map = shadow_plane_state->data[0];
401+ struct iosys_map map = shadow_plane_state->data[0];
402402 u8 *src = map.vaddr; /* TODO: Use mapping abstraction properly */
403403 size_t data_size, mask_size;
404404 u32 flags;
drivers/gpu/drm/vkms/vkms_composer.c+2−2
@@ -157,7 +157,7 @@ static void compose_plane(struct vkms_composer *primary_composer, · 156 unmodified lines
157157 void *vaddr;
158158 void (*pixel_blend)(const u8 *p_src, u8 *p_dst);
159159
160− if (WARN_ON(dma_buf_map_is_null(&primary_composer->map[0])))
160+ if (WARN_ON(iosys_map_is_null(&primary_composer->map[0])))
161161 return;
162162
163163 vaddr = plane_composer->map[0].vaddr;
@@ -187,7 +187,7 @@ static int compose_active_planes(void **vaddr_out, · 23 unmodified lines
187187 }
188188 }
189189
190− if (WARN_ON(dma_buf_map_is_null(&primary_composer->map[0])))
190+ if (WARN_ON(iosys_map_is_null(&primary_composer->map[0])))
191191 return -EINVAL;
192192
193193 vaddr = primary_composer->map[0].vaddr;
drivers/gpu/drm/vkms/vkms_drv.h+3−3
@@ -21,14 +21,14 @@ · 20 unmodified lines
2121 #define YRES_MAX 8192
2222
2323 struct vkms_writeback_job {
24− struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
25− struct dma_buf_map data[DRM_FORMAT_MAX_PLANES];
24+ struct iosys_map map[DRM_FORMAT_MAX_PLANES];
25+ struct iosys_map data[DRM_FORMAT_MAX_PLANES];
2626 };
2727
2828 struct vkms_composer {
2929 struct drm_framebuffer fb;
3030 struct drm_rect src, dst;
31− struct dma_buf_map map[4];
31+ struct iosys_map map[4];
3232 unsigned int offset;
3333 unsigned int pitch;
3434 unsigned int cpp;
drivers/gpu/drm/vkms/vkms_plane.c+1−1
@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0+
22
3−#include <linux/dma-buf-map.h>
3+#include <linux/iosys-map.h>
44
55 #include <drm/drm_atomic.h>
66 #include <drm/drm_atomic_helper.h>
drivers/gpu/drm/vkms/vkms_writeback.c+1−1
@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0+
22
3−#include <linux/dma-buf-map.h>
3+#include <linux/iosys-map.h>
44
55 #include <drm/drm_atomic.h>
66 #include <drm/drm_fourcc.h>
drivers/gpu/drm/xen/xen_drm_front_gem.c+4−3
@@ -280,7 +280,8 @@ xen_drm_front_gem_import_sg_table(struct drm_device *dev, · 279 unmodified lines
280280 return &xen_obj->base;
281281 }
282282
283−int xen_drm_front_gem_prime_vmap(struct drm_gem_object *gem_obj, struct dma_buf_map *map)
283+int xen_drm_front_gem_prime_vmap(struct drm_gem_object *gem_obj,
284+ struct iosys_map *map)
284285 {
285286 struct xen_gem_object *xen_obj = to_xen_gem_obj(gem_obj);
286287 void *vaddr;
@@ -293,13 +294,13 @@ int xen_drm_front_gem_prime_vmap(struct drm_gem_object *gem_obj, struct dma_buf_ · 6 unmodified lines
293294 VM_MAP, PAGE_KERNEL);
294295 if (!vaddr)
295296 return -ENOMEM;
296− dma_buf_map_set_vaddr(map, vaddr);
297+ iosys_map_set_vaddr(map, vaddr);
297298
298299 return 0;
299300 }
300301
301302 void xen_drm_front_gem_prime_vunmap(struct drm_gem_object *gem_obj,
302− struct dma_buf_map *map)
303+ struct iosys_map *map)
303304 {
304305 vunmap(map->vaddr);
305306 }
drivers/gpu/drm/xen/xen_drm_front_gem.h+3−3
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #define __XEN_DRM_FRONT_GEM_H
1313
1414 struct dma_buf_attachment;
15−struct dma_buf_map;
15+struct iosys_map;
1616 struct drm_device;
1717 struct drm_gem_object;
1818 struct sg_table;
@@ -32,9 +32,9 @@ struct page **xen_drm_front_gem_get_pages(struct drm_gem_object *obj); · 13 unmodified lines
3232 void xen_drm_front_gem_free_object_unlocked(struct drm_gem_object *gem_obj);
3333
3434 int xen_drm_front_gem_prime_vmap(struct drm_gem_object *gem_obj,
35− struct dma_buf_map *map);
35+ struct iosys_map *map);
3636
3737 void xen_drm_front_gem_prime_vunmap(struct drm_gem_object *gem_obj,
38− struct dma_buf_map *map);
38+ struct iosys_map *map);
3939
4040 #endif /* __XEN_DRM_FRONT_GEM_H */
drivers/media/common/videobuf2/videobuf2-dma-contig.c+4−4
@@ -99,7 +99,7 @@ static void *vb2_dc_vaddr(struct vb2_buffer *vb, void *buf_priv) · 98 unmodified lines
9999 return buf->vaddr;
100100
101101 if (buf->db_attach) {
102− struct dma_buf_map map;
102+ struct iosys_map map;
103103
104104 if (!dma_buf_vmap(buf->db_attach->dmabuf, &map))
105105 buf->vaddr = map.vaddr;
@@ -446,7 +446,7 @@ vb2_dc_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf, · 340 unmodified lines
446446 return 0;
447447 }
448448
449−static int vb2_dc_dmabuf_ops_vmap(struct dma_buf *dbuf, struct dma_buf_map *map)
449+static int vb2_dc_dmabuf_ops_vmap(struct dma_buf *dbuf, struct iosys_map *map)
450450 {
451451 struct vb2_dc_buf *buf;
452452 void *vaddr;
@@ -456,7 +456,7 @@ static int vb2_dc_dmabuf_ops_vmap(struct dma_buf *dbuf, struct dma_buf_map *map) · 3 unmodified lines
456456 if (!vaddr)
457457 return -EINVAL;
458458
459− dma_buf_map_set_vaddr(map, vaddr);
459+ iosys_map_set_vaddr(map, vaddr);
460460
461461 return 0;
462462 }
@@ -737,7 +737,7 @@ static void vb2_dc_unmap_dmabuf(void *mem_priv) · 274 unmodified lines
737737 {
738738 struct vb2_dc_buf *buf = mem_priv;
739739 struct sg_table *sgt = buf->dma_sgt;
740− struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(buf->vaddr);
740+ struct iosys_map map = IOSYS_MAP_INIT_VADDR(buf->vaddr);
741741
742742 if (WARN_ON(!buf->db_attach)) {
743743 pr_err("trying to unpin a not attached buffer\n");
drivers/media/common/videobuf2/videobuf2-dma-sg.c+5−4
@@ -303,7 +303,7 @@ static void vb2_dma_sg_put_userptr(void *buf_priv) · 302 unmodified lines
303303 static void *vb2_dma_sg_vaddr(struct vb2_buffer *vb, void *buf_priv)
304304 {
305305 struct vb2_dma_sg_buf *buf = buf_priv;
306− struct dma_buf_map map;
306+ struct iosys_map map;
307307 int ret;
308308
309309 BUG_ON(!buf);
@@ -492,11 +492,12 @@ vb2_dma_sg_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf, · 182 unmodified lines
492492 return 0;
493493 }
494494
495−static int vb2_dma_sg_dmabuf_ops_vmap(struct dma_buf *dbuf, struct dma_buf_map *map)
495+static int vb2_dma_sg_dmabuf_ops_vmap(struct dma_buf *dbuf,
496+ struct iosys_map *map)
496497 {
497498 struct vb2_dma_sg_buf *buf = dbuf->priv;
498499
499− dma_buf_map_set_vaddr(map, buf->vaddr);
500+ iosys_map_set_vaddr(map, buf->vaddr);
500501
501502 return 0;
502503 }
@@ -581,7 +582,7 @@ static void vb2_dma_sg_unmap_dmabuf(void *mem_priv) · 78 unmodified lines
581582 {
582583 struct vb2_dma_sg_buf *buf = mem_priv;
583584 struct sg_table *sgt = buf->dma_sgt;
584− struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(buf->vaddr);
585+ struct iosys_map map = IOSYS_MAP_INIT_VADDR(buf->vaddr);
585586
586587 if (WARN_ON(!buf->db_attach)) {
587588 pr_err("trying to unpin a not attached buffer\n");
drivers/media/common/videobuf2/videobuf2-vmalloc.c+6−5
@@ -312,11 +312,12 @@ static void vb2_vmalloc_dmabuf_ops_release(struct dma_buf *dbuf) · 311 unmodified lines
312312 vb2_vmalloc_put(dbuf->priv);
313313 }
314314
315−static int vb2_vmalloc_dmabuf_ops_vmap(struct dma_buf *dbuf, struct dma_buf_map *map)
315+static int vb2_vmalloc_dmabuf_ops_vmap(struct dma_buf *dbuf,
316+ struct iosys_map *map)
316317 {
317318 struct vb2_vmalloc_buf *buf = dbuf->priv;
318319
319− dma_buf_map_set_vaddr(map, buf->vaddr);
320+ iosys_map_set_vaddr(map, buf->vaddr);
320321
321322 return 0;
322323 }
@@ -372,7 +373,7 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(struct vb2_buffer *vb, · 49 unmodified lines
372373 static int vb2_vmalloc_map_dmabuf(void *mem_priv)
373374 {
374375 struct vb2_vmalloc_buf *buf = mem_priv;
375− struct dma_buf_map map;
376+ struct iosys_map map;
376377 int ret;
377378
378379 ret = dma_buf_vmap(buf->dbuf, &map);
@@ -386,7 +387,7 @@ static int vb2_vmalloc_map_dmabuf(void *mem_priv) · 7 unmodified lines
386387 static void vb2_vmalloc_unmap_dmabuf(void *mem_priv)
387388 {
388389 struct vb2_vmalloc_buf *buf = mem_priv;
389− struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(buf->vaddr);
390+ struct iosys_map map = IOSYS_MAP_INIT_VADDR(buf->vaddr);
390391
391392 dma_buf_vunmap(buf->dbuf, &map);
392393 buf->vaddr = NULL;
@@ -395,7 +396,7 @@ static void vb2_vmalloc_unmap_dmabuf(void *mem_priv) · 2 unmodified lines
395396 static void vb2_vmalloc_detach_dmabuf(void *mem_priv)
396397 {
397398 struct vb2_vmalloc_buf *buf = mem_priv;
398− struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(buf->vaddr);
399+ struct iosys_map map = IOSYS_MAP_INIT_VADDR(buf->vaddr);
399400
400401 if (buf->vaddr)
401402 dma_buf_vunmap(buf->dbuf, &map);
drivers/misc/fastrpc.c+2−2
@@ -587,11 +587,11 @@ static void fastrpc_dma_buf_detatch(struct dma_buf *dmabuf, · 586 unmodified lines
587587 kfree(a);
588588 }
589589
590−static int fastrpc_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map)
590+static int fastrpc_vmap(struct dma_buf *dmabuf, struct iosys_map *map)
591591 {
592592 struct fastrpc_buf *buf = dmabuf->priv;
593593
594− dma_buf_map_set_vaddr(map, buf->virt);
594+ iosys_map_set_vaddr(map, buf->virt);
595595
596596 return 0;
597597 }
include/drm/drm_cache.h+3−3
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535
3636 #include <linux/scatterlist.h>
3737
38−struct dma_buf_map;
38+struct iosys_map;
3939
4040 void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
4141 void drm_clflush_sg(struct sg_table *st);
@@ -74,7 +74,7 @@ static inline bool drm_arch_can_wc_memory(void) · 32 unmodified lines
7474
7575 void drm_memcpy_init_early(void);
7676
77−void drm_memcpy_from_wc(struct dma_buf_map *dst,
78− const struct dma_buf_map *src,
77+void drm_memcpy_from_wc(struct iosys_map *dst,
78+ const struct iosys_map *src,
7979 unsigned long len);
8080 #endif
include/drm/drm_client.h+4−3
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 #ifndef _DRM_CLIENT_H_
44 #define _DRM_CLIENT_H_
55
6−#include <linux/dma-buf-map.h>
6+#include <linux/iosys-map.h>
77 #include <linux/lockdep.h>
88 #include <linux/mutex.h>
99 #include <linux/types.h>
@@ -144,7 +144,7 @@ struct drm_client_buffer { · 134 unmodified lines
144144 /**
145145 * @map: Virtual address for the buffer
146146 */
147− struct dma_buf_map map;
147+ struct iosys_map map;
148148
149149 /**
150150 * @fb: DRM framebuffer
@@ -156,7 +156,8 @@ struct drm_client_buffer * · 5 unmodified lines
156156 drm_client_framebuffer_create(struct drm_client_dev *client, u32 width, u32 height, u32 format);
157157 void drm_client_framebuffer_delete(struct drm_client_buffer *buffer);
158158 int drm_client_framebuffer_flush(struct drm_client_buffer *buffer, struct drm_rect *rect);
159−int drm_client_buffer_vmap(struct drm_client_buffer *buffer, struct dma_buf_map *map);
159+int drm_client_buffer_vmap(struct drm_client_buffer *buffer,
160+ struct iosys_map *map);
160161 void drm_client_buffer_vunmap(struct drm_client_buffer *buffer);
161162
162163 int drm_client_modeset_create(struct drm_client_dev *client);
include/drm/drm_gem.h+3−3
@@ -39,7 +39,7 @@ · 38 unmodified lines
3939
4040 #include <drm/drm_vma_manager.h>
4141
42−struct dma_buf_map;
42+struct iosys_map;
4343 struct drm_gem_object;
4444
4545 /**
@@ -139,7 +139,7 @@ struct drm_gem_object_funcs { · 93 unmodified lines
139139 *
140140 * This callback is optional.
141141 */
142− int (*vmap)(struct drm_gem_object *obj, struct dma_buf_map *map);
142+ int (*vmap)(struct drm_gem_object *obj, struct iosys_map *map);
143143
144144 /**
145145 * @vunmap:
@@ -149,7 +149,7 @@ struct drm_gem_object_funcs { · 3 unmodified lines
149149 *
150150 * This callback is optional.
151151 */
152− void (*vunmap)(struct drm_gem_object *obj, struct dma_buf_map *map);
152+ void (*vunmap)(struct drm_gem_object *obj, struct iosys_map *map);
153153
154154 /**
155155 * @mmap:
include/drm/drm_gem_atomic_helper.h+3−3
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 #ifndef __DRM_GEM_ATOMIC_HELPER_H__
44 #define __DRM_GEM_ATOMIC_HELPER_H__
55
6−#include <linux/dma-buf-map.h>
6+#include <linux/iosys-map.h>
77
88 #include <drm/drm_fourcc.h>
99 #include <drm/drm_plane.h>
@@ -59,7 +59,7 @@ struct drm_shadow_plane_state { · 49 unmodified lines
5959 * The memory mappings stored in map should be established in the plane's
6060 * prepare_fb callback and removed in the cleanup_fb callback.
6161 */
62− struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
62+ struct iosys_map map[DRM_FORMAT_MAX_PLANES];
6363
6464 /**
6565 * @data: Address of each framebuffer BO's data
@@ -67,7 +67,7 @@ struct drm_shadow_plane_state { · 1 unmodified line
6767 * The address of the data stored in each mapping. This is different
6868 * for framebuffers with non-zero offset fields.
6969 */
70− struct dma_buf_map data[DRM_FORMAT_MAX_PLANES];
70+ struct iosys_map data[DRM_FORMAT_MAX_PLANES];
7171 };
7272
7373 /**
include/drm/drm_gem_cma_helper.h+4−2
@@ -38,7 +38,8 @@ void drm_gem_cma_free(struct drm_gem_cma_object *cma_obj); · 37 unmodified lines
3838 void drm_gem_cma_print_info(const struct drm_gem_cma_object *cma_obj,
3939 struct drm_printer *p, unsigned int indent);
4040 struct sg_table *drm_gem_cma_get_sg_table(struct drm_gem_cma_object *cma_obj);
41−int drm_gem_cma_vmap(struct drm_gem_cma_object *cma_obj, struct dma_buf_map *map);
41+int drm_gem_cma_vmap(struct drm_gem_cma_object *cma_obj,
42+ struct iosys_map *map);
4243 int drm_gem_cma_mmap(struct drm_gem_cma_object *cma_obj, struct vm_area_struct *vma);
4344
4445 extern const struct vm_operations_struct drm_gem_cma_vm_ops;
@@ -106,7 +107,8 @@ static inline struct sg_table *drm_gem_cma_object_get_sg_table(struct drm_gem_ob · 61 unmodified lines
106107 * Returns:
107108 * 0 on success or a negative error code on failure.
108109 */
109−static inline int drm_gem_cma_object_vmap(struct drm_gem_object *obj, struct dma_buf_map *map)
110+static inline int drm_gem_cma_object_vmap(struct drm_gem_object *obj,
111+ struct iosys_map *map)
110112 {
111113 struct drm_gem_cma_object *cma_obj = to_drm_gem_cma_obj(obj);
112114
include/drm/drm_gem_framebuffer_helper.h+4−4
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #define __DRM_GEM_FB_HELPER_H__
33
44 #include <linux/dma-buf.h>
5−#include <linux/dma-buf-map.h>
5+#include <linux/iosys-map.h>
66
77 #include <drm/drm_fourcc.h>
88
@@ -40,10 +40,10 @@ drm_gem_fb_create_with_dirty(struct drm_device *dev, struct drm_file *file, · 31 unmodified lines
4040 const struct drm_mode_fb_cmd2 *mode_cmd);
4141
4242 int drm_gem_fb_vmap(struct drm_framebuffer *fb,
43− struct dma_buf_map map[static DRM_FORMAT_MAX_PLANES],
44− struct dma_buf_map data[DRM_FORMAT_MAX_PLANES]);
43+ struct iosys_map map[static DRM_FORMAT_MAX_PLANES],
44+ struct iosys_map data[DRM_FORMAT_MAX_PLANES]);
4545 void drm_gem_fb_vunmap(struct drm_framebuffer *fb,
46− struct dma_buf_map map[static DRM_FORMAT_MAX_PLANES]);
46+ struct iosys_map map[static DRM_FORMAT_MAX_PLANES]);
4747 int drm_gem_fb_begin_cpu_access(struct drm_framebuffer *fb, enum dma_data_direction dir);
4848 void drm_gem_fb_end_cpu_access(struct drm_framebuffer *fb, enum dma_data_direction dir);
4949
include/drm/drm_gem_shmem_helper.h+8−4
@@ -113,8 +113,10 @@ int drm_gem_shmem_get_pages(struct drm_gem_shmem_object *shmem); · 112 unmodified lines
113113 void drm_gem_shmem_put_pages(struct drm_gem_shmem_object *shmem);
114114 int drm_gem_shmem_pin(struct drm_gem_shmem_object *shmem);
115115 void drm_gem_shmem_unpin(struct drm_gem_shmem_object *shmem);
116−int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem, struct dma_buf_map *map);
117−void drm_gem_shmem_vunmap(struct drm_gem_shmem_object *shmem, struct dma_buf_map *map);
116+int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem,
117+ struct iosys_map *map);
118+void drm_gem_shmem_vunmap(struct drm_gem_shmem_object *shmem,
119+ struct iosys_map *map);
118120 int drm_gem_shmem_mmap(struct drm_gem_shmem_object *shmem, struct vm_area_struct *vma);
119121
120122 int drm_gem_shmem_madvise(struct drm_gem_shmem_object *shmem, int madv);
@@ -226,7 +228,8 @@ static inline struct sg_table *drm_gem_shmem_object_get_sg_table(struct drm_gem_ · 105 unmodified lines
226228 * Returns:
227229 * 0 on success or a negative error code on failure.
228230 */
229−static inline int drm_gem_shmem_object_vmap(struct drm_gem_object *obj, struct dma_buf_map *map)
231+static inline int drm_gem_shmem_object_vmap(struct drm_gem_object *obj,
232+ struct iosys_map *map)
230233 {
231234 struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj);
232235
@@ -241,7 +244,8 @@ static inline int drm_gem_shmem_object_vmap(struct drm_gem_object *obj, struct d · 8 unmodified lines
241244 * This function wraps drm_gem_shmem_vunmap(). Drivers that employ the shmem helpers should
242245 * use it as their &drm_gem_object_funcs.vunmap handler.
243246 */
244−static inline void drm_gem_shmem_object_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map)
247+static inline void drm_gem_shmem_object_vunmap(struct drm_gem_object *obj,
248+ struct iosys_map *map)
245249 {
246250 struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj);
247251
include/drm/drm_gem_ttm_helper.h+3−3
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include <drm/ttm/ttm_bo_api.h>
1111 #include <drm/ttm/ttm_bo_driver.h>
1212
13−struct dma_buf_map;
13+struct iosys_map;
1414
1515 #define drm_gem_ttm_of_gem(gem_obj) \
1616 container_of(gem_obj, struct ttm_buffer_object, base)
@@ -18,9 +18,9 @@ struct dma_buf_map; · 1 unmodified line
1818 void drm_gem_ttm_print_info(struct drm_printer *p, unsigned int indent,
1919 const struct drm_gem_object *gem);
2020 int drm_gem_ttm_vmap(struct drm_gem_object *gem,
21− struct dma_buf_map *map);
21+ struct iosys_map *map);
2222 void drm_gem_ttm_vunmap(struct drm_gem_object *gem,
23− struct dma_buf_map *map);
23+ struct iosys_map *map);
2424 int drm_gem_ttm_mmap(struct drm_gem_object *gem,
2525 struct vm_area_struct *vma);
2626
include/drm/drm_gem_vram_helper.h+5−4
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include <drm/ttm/ttm_bo_driver.h>
1313
1414 #include <linux/container_of.h>
15−#include <linux/dma-buf-map.h>
15+#include <linux/iosys-map.h>
1616
1717 struct drm_mode_create_dumb;
1818 struct drm_plane;
@@ -51,7 +51,7 @@ struct vm_area_struct; · 32 unmodified lines
5151 */
5252 struct drm_gem_vram_object {
5353 struct ttm_buffer_object bo;
54− struct dma_buf_map map;
54+ struct iosys_map map;
5555
5656 /**
5757 * @vmap_use_count:
@@ -97,8 +97,9 @@ void drm_gem_vram_put(struct drm_gem_vram_object *gbo); · 39 unmodified lines
9797 s64 drm_gem_vram_offset(struct drm_gem_vram_object *gbo);
9898 int drm_gem_vram_pin(struct drm_gem_vram_object *gbo, unsigned long pl_flag);
9999 int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo);
100−int drm_gem_vram_vmap(struct drm_gem_vram_object *gbo, struct dma_buf_map *map);
101−void drm_gem_vram_vunmap(struct drm_gem_vram_object *gbo, struct dma_buf_map *map);
100+int drm_gem_vram_vmap(struct drm_gem_vram_object *gbo, struct iosys_map *map);
101+void drm_gem_vram_vunmap(struct drm_gem_vram_object *gbo,
102+ struct iosys_map *map);
102103
103104 int drm_gem_vram_fill_create_dumb(struct drm_file *file,
104105 struct drm_device *dev,
include/drm/drm_prime.h+3−3
@@ -54,7 +54,7 @@ struct device; · 53 unmodified lines
5454 struct dma_buf_export_info;
5555 struct dma_buf;
5656 struct dma_buf_attachment;
57−struct dma_buf_map;
57+struct iosys_map;
5858
5959 enum dma_data_direction;
6060
@@ -83,8 +83,8 @@ struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach, · 22 unmodified lines
8383 void drm_gem_unmap_dma_buf(struct dma_buf_attachment *attach,
8484 struct sg_table *sgt,
8585 enum dma_data_direction dir);
86−int drm_gem_dmabuf_vmap(struct dma_buf *dma_buf, struct dma_buf_map *map);
87−void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, struct dma_buf_map *map);
86+int drm_gem_dmabuf_vmap(struct dma_buf *dma_buf, struct iosys_map *map);
87+void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, struct iosys_map *map);
8888
8989 int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);
9090 int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma);
include/drm/ttm/ttm_bo_api.h+5−5
@@ -47,7 +47,7 @@ struct ttm_global; · 46 unmodified lines
4747
4848 struct ttm_device;
4949
50−struct dma_buf_map;
50+struct iosys_map;
5151
5252 struct drm_mm_node;
5353
@@ -481,17 +481,17 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map); · 427 unmodified lines
481481 * ttm_bo_vmap
482482 *
483483 * @bo: The buffer object.
484− * @map: pointer to a struct dma_buf_map representing the map.
484+ * @map: pointer to a struct iosys_map representing the map.
485485 *
486486 * Sets up a kernel virtual mapping, using ioremap or vmap to the
487487 * data in the buffer object. The parameter @map returns the virtual
488− * address as struct dma_buf_map. Unmap the buffer with ttm_bo_vunmap().
488+ * address as struct iosys_map. Unmap the buffer with ttm_bo_vunmap().
489489 *
490490 * Returns
491491 * -ENOMEM: Out of memory.
492492 * -EINVAL: Invalid range.
493493 */
494−int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map);
494+int ttm_bo_vmap(struct ttm_buffer_object *bo, struct iosys_map *map);
495495
496496 /**
497497 * ttm_bo_vunmap
@@ -501,7 +501,7 @@ int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map); · 3 unmodified lines
501501 *
502502 * Unmaps a kernel map set up by ttm_bo_vmap().
503503 */
504−void ttm_bo_vunmap(struct ttm_buffer_object *bo, struct dma_buf_map *map);
504+void ttm_bo_vunmap(struct ttm_buffer_object *bo, struct iosys_map *map);
505505
506506 /**
507507 * ttm_bo_mmap_obj - mmap memory backed by a ttm buffer object.
include/drm/ttm/ttm_kmap_iter.h+5−5
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 #include <linux/types.h>
99
1010 struct ttm_kmap_iter;
11−struct dma_buf_map;
11+struct iosys_map;
1212
1313 /**
1414 * struct ttm_kmap_iter_ops - Ops structure for a struct
@@ -24,22 +24,22 @@ struct ttm_kmap_iter_ops { · 9 unmodified lines
2424 * kmap_local semantics.
2525 * @res_iter: Pointer to the struct ttm_kmap_iter representing
2626 * the resource.
27− * @dmap: The struct dma_buf_map holding the virtual address after
27+ * @dmap: The struct iosys_map holding the virtual address after
2828 * the operation.
2929 * @i: The location within the resource to map. PAGE_SIZE granularity.
3030 */
3131 void (*map_local)(struct ttm_kmap_iter *res_iter,
32− struct dma_buf_map *dmap, pgoff_t i);
32+ struct iosys_map *dmap, pgoff_t i);
3333 /**
3434 * unmap_local() - Unmap a PAGE_SIZE part of the resource previously
3535 * mapped using kmap_local.
3636 * @res_iter: Pointer to the struct ttm_kmap_iter representing
3737 * the resource.
38− * @dmap: The struct dma_buf_map holding the virtual address after
38+ * @dmap: The struct iosys_map holding the virtual address after
3939 * the operation.
4040 */
4141 void (*unmap_local)(struct ttm_kmap_iter *res_iter,
42− struct dma_buf_map *dmap);
42+ struct iosys_map *dmap);
4343 bool maps_tt;
4444 };
4545
include/drm/ttm/ttm_resource.h+3−3
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727
2828 #include <linux/types.h>
2929 #include <linux/mutex.h>
30−#include <linux/dma-buf-map.h>
30+#include <linux/iosys-map.h>
3131 #include <linux/dma-fence.h>
3232 #include <drm/drm_print.h>
3333 #include <drm/ttm/ttm_caching.h>
@@ -41,7 +41,7 @@ struct ttm_resource; · 7 unmodified lines
4141 struct ttm_place;
4242 struct ttm_buffer_object;
4343 struct ttm_placement;
44−struct dma_buf_map;
44+struct iosys_map;
4545 struct io_mapping;
4646 struct sg_table;
4747 struct scatterlist;
@@ -207,7 +207,7 @@ struct ttm_kmap_iter_iomap { · 159 unmodified lines
207207 */
208208 struct ttm_kmap_iter_linear_io {
209209 struct ttm_kmap_iter base;
210− struct dma_buf_map dmap;
210+ struct iosys_map dmap;
211211 bool needs_unmap;
212212 };
213213
include/linux/dma-buf-map.h+0−266
@@ -1,266 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/*
3− * Pointer to dma-buf-mapped memory, plus helpers.
4− */
5−
6−#ifndef __DMA_BUF_MAP_H__
7−#define __DMA_BUF_MAP_H__
8−
9−#include <linux/io.h>
10−#include <linux/string.h>
11−
12−/**
13− * DOC: overview
14− *
15− * Calling dma-buf's vmap operation returns a pointer to the buffer's memory.
16− * Depending on the location of the buffer, users may have to access it with
17− * I/O operations or memory load/store operations. For example, copying to
18− * system memory could be done with memcpy(), copying to I/O memory would be
19− * done with memcpy_toio().
20− *
21− * .. code-block:: c
22− *
23− * void *vaddr = ...; // pointer to system memory
24− * memcpy(vaddr, src, len);
25− *
26− * void *vaddr_iomem = ...; // pointer to I/O memory
27− * memcpy_toio(vaddr, _iomem, src, len);
28− *
29− * When using dma-buf's vmap operation, the returned pointer is encoded as
30− * :c:type:`struct dma_buf_map <dma_buf_map>`.
31− * :c:type:`struct dma_buf_map <dma_buf_map>` stores the buffer's address in
32− * system or I/O memory and a flag that signals the required method of
33− * accessing the buffer. Use the returned instance and the helper functions
34− * to access the buffer's memory in the correct way.
35− *
36− * The type :c:type:`struct dma_buf_map <dma_buf_map>` and its helpers are
37− * actually independent from the dma-buf infrastructure. When sharing buffers
38− * among devices, drivers have to know the location of the memory to access
39− * the buffers in a safe way. :c:type:`struct dma_buf_map <dma_buf_map>`
40− * solves this problem for dma-buf and its users. If other drivers or
41− * sub-systems require similar functionality, the type could be generalized
42− * and moved to a more prominent header file.
43− *
44− * Open-coding access to :c:type:`struct dma_buf_map <dma_buf_map>` is
45− * considered bad style. Rather then accessing its fields directly, use one
46− * of the provided helper functions, or implement your own. For example,
47− * instances of :c:type:`struct dma_buf_map <dma_buf_map>` can be initialized
48− * statically with DMA_BUF_MAP_INIT_VADDR(), or at runtime with
49− * dma_buf_map_set_vaddr(). These helpers will set an address in system memory.
50− *
51− * .. code-block:: c
52− *
53− * struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(0xdeadbeaf);
54− *
55− * dma_buf_map_set_vaddr(&map. 0xdeadbeaf);
56− *
57− * To set an address in I/O memory, use dma_buf_map_set_vaddr_iomem().
58− *
59− * .. code-block:: c
60− *
61− * dma_buf_map_set_vaddr_iomem(&map. 0xdeadbeaf);
62− *
63− * Instances of struct dma_buf_map do not have to be cleaned up, but
64− * can be cleared to NULL with dma_buf_map_clear(). Cleared mappings
65− * always refer to system memory.
66− *
67− * .. code-block:: c
68− *
69− * dma_buf_map_clear(&map);
70− *
71− * Test if a mapping is valid with either dma_buf_map_is_set() or
72− * dma_buf_map_is_null().
73− *
74− * .. code-block:: c
75− *
76− * if (dma_buf_map_is_set(&map) != dma_buf_map_is_null(&map))
77− * // always true
78− *
79− * Instances of :c:type:`struct dma_buf_map <dma_buf_map>` can be compared
80− * for equality with dma_buf_map_is_equal(). Mappings the point to different
81− * memory spaces, system or I/O, are never equal. That's even true if both
82− * spaces are located in the same address space, both mappings contain the
83− * same address value, or both mappings refer to NULL.
84− *
85− * .. code-block:: c
86− *
87− * struct dma_buf_map sys_map; // refers to system memory
88− * struct dma_buf_map io_map; // refers to I/O memory
89− *
90− * if (dma_buf_map_is_equal(&sys_map, &io_map))
91− * // always false
92− *
93− * A set up instance of struct dma_buf_map can be used to access or manipulate
94− * the buffer memory. Depending on the location of the memory, the provided
95− * helpers will pick the correct operations. Data can be copied into the memory
96− * with dma_buf_map_memcpy_to(). The address can be manipulated with
97− * dma_buf_map_incr().
98− *
99− * .. code-block:: c
100− *
101− * const void *src = ...; // source buffer
102− * size_t len = ...; // length of src
103− *
104− * dma_buf_map_memcpy_to(&map, src, len);
105− * dma_buf_map_incr(&map, len); // go to first byte after the memcpy
106− */
107−
108−/**
109− * struct dma_buf_map - Pointer to vmap'ed dma-buf memory.
110− * @vaddr_iomem: The buffer's address if in I/O memory
111− * @vaddr: The buffer's address if in system memory
112− * @is_iomem: True if the dma-buf memory is located in I/O
113− * memory, or false otherwise.
114− */
115−struct dma_buf_map {
116− union {
117− void __iomem *vaddr_iomem;
118− void *vaddr;
119− };
120− bool is_iomem;
121−};
122−
123−/**
124− * DMA_BUF_MAP_INIT_VADDR - Initializes struct dma_buf_map to an address in system memory
125− * @vaddr_: A system-memory address
126− */
127−#define DMA_BUF_MAP_INIT_VADDR(vaddr_) \
128− { \
129− .vaddr = (vaddr_), \
130− .is_iomem = false, \
131− }
132−
133−/**
134− * dma_buf_map_set_vaddr - Sets a dma-buf mapping structure to an address in system memory
135− * @map: The dma-buf mapping structure
136− * @vaddr: A system-memory address
137− *
138− * Sets the address and clears the I/O-memory flag.
139− */
140−static inline void dma_buf_map_set_vaddr(struct dma_buf_map *map, void *vaddr)
141−{
142− map->vaddr = vaddr;
143− map->is_iomem = false;
144−}
145−
146−/**
147− * dma_buf_map_set_vaddr_iomem - Sets a dma-buf mapping structure to an address in I/O memory
148− * @map: The dma-buf mapping structure
149− * @vaddr_iomem: An I/O-memory address
150− *
151− * Sets the address and the I/O-memory flag.
152− */
153−static inline void dma_buf_map_set_vaddr_iomem(struct dma_buf_map *map,
154− void __iomem *vaddr_iomem)
155−{
156− map->vaddr_iomem = vaddr_iomem;
157− map->is_iomem = true;
158−}
159−
160−/**
161− * dma_buf_map_is_equal - Compares two dma-buf mapping structures for equality
162− * @lhs: The dma-buf mapping structure
163− * @rhs: A dma-buf mapping structure to compare with
164− *
165− * Two dma-buf mapping structures are equal if they both refer to the same type of memory
166− * and to the same address within that memory.
167− *
168− * Returns:
169− * True is both structures are equal, or false otherwise.
170− */
171−static inline bool dma_buf_map_is_equal(const struct dma_buf_map *lhs,
172− const struct dma_buf_map *rhs)
173−{
174− if (lhs->is_iomem != rhs->is_iomem)
175− return false;
176− else if (lhs->is_iomem)
177− return lhs->vaddr_iomem == rhs->vaddr_iomem;
178− else
179− return lhs->vaddr == rhs->vaddr;
180−}
181−
182−/**
183− * dma_buf_map_is_null - Tests for a dma-buf mapping to be NULL
184− * @map: The dma-buf mapping structure
185− *
186− * Depending on the state of struct dma_buf_map.is_iomem, tests if the
187− * mapping is NULL.
188− *
189− * Returns:
190− * True if the mapping is NULL, or false otherwise.
191− */
192−static inline bool dma_buf_map_is_null(const struct dma_buf_map *map)
193−{
194− if (map->is_iomem)
195− return !map->vaddr_iomem;
196− return !map->vaddr;
197−}
198−
199−/**
200− * dma_buf_map_is_set - Tests is the dma-buf mapping has been set
201− * @map: The dma-buf mapping structure
202− *
203− * Depending on the state of struct dma_buf_map.is_iomem, tests if the
204− * mapping has been set.
205− *
206− * Returns:
207− * True if the mapping is been set, or false otherwise.
208− */
209−static inline bool dma_buf_map_is_set(const struct dma_buf_map *map)
210−{
211− return !dma_buf_map_is_null(map);
212−}
213−
214−/**
215− * dma_buf_map_clear - Clears a dma-buf mapping structure
216− * @map: The dma-buf mapping structure
217− *
218− * Clears all fields to zero; including struct dma_buf_map.is_iomem. So
219− * mapping structures that were set to point to I/O memory are reset for
220− * system memory. Pointers are cleared to NULL. This is the default.
221− */
222−static inline void dma_buf_map_clear(struct dma_buf_map *map)
223−{
224− if (map->is_iomem) {
225− map->vaddr_iomem = NULL;
226− map->is_iomem = false;
227− } else {
228− map->vaddr = NULL;
229− }
230−}
231−
232−/**
233− * dma_buf_map_memcpy_to - Memcpy into dma-buf mapping
234− * @dst: The dma-buf mapping structure
235− * @src: The source buffer
236− * @len: The number of byte in src
237− *
238− * Copies data into a dma-buf mapping. The source buffer is in system
239− * memory. Depending on the buffer's location, the helper picks the correct
240− * method of accessing the memory.
241− */
242−static inline void dma_buf_map_memcpy_to(struct dma_buf_map *dst, const void *src, size_t len)
243−{
244− if (dst->is_iomem)
245− memcpy_toio(dst->vaddr_iomem, src, len);
246− else
247− memcpy(dst->vaddr, src, len);
248−}
249−
250−/**
251− * dma_buf_map_incr - Increments the address stored in a dma-buf mapping
252− * @map: The dma-buf mapping structure
253− * @incr: The number of bytes to increment
254− *
255− * Increments the address stored in a dma-buf mapping. Depending on the
256− * buffer's location, the correct value will be updated.
257− */
258−static inline void dma_buf_map_incr(struct dma_buf_map *map, size_t incr)
259−{
260− if (map->is_iomem)
261− map->vaddr_iomem += incr;
262− else
263− map->vaddr += incr;
264−}
265−
266−#endif /* __DMA_BUF_MAP_H__ */
include/linux/dma-buf.h+6−6
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #ifndef __DMA_BUF_H__
1414 #define __DMA_BUF_H__
1515
16−#include <linux/dma-buf-map.h>
16+#include <linux/iosys-map.h>
1717 #include <linux/file.h>
1818 #include <linux/err.h>
1919 #include <linux/scatterlist.h>
@@ -283,8 +283,8 @@ struct dma_buf_ops { · 263 unmodified lines
283283 */
284284 int (*mmap)(struct dma_buf *, struct vm_area_struct *vma);
285285
286− int (*vmap)(struct dma_buf *dmabuf, struct dma_buf_map *map);
287− void (*vunmap)(struct dma_buf *dmabuf, struct dma_buf_map *map);
286+ int (*vmap)(struct dma_buf *dmabuf, struct iosys_map *map);
287+ void (*vunmap)(struct dma_buf *dmabuf, struct iosys_map *map);
288288 };
289289
290290 /**
@@ -347,7 +347,7 @@ struct dma_buf { · 56 unmodified lines
347347 * @vmap_ptr:
348348 * The current vmap ptr if @vmapping_counter > 0. Protected by @lock.
349349 */
350− struct dma_buf_map vmap_ptr;
350+ struct iosys_map vmap_ptr;
351351
352352 /**
353353 * @exp_name:
@@ -628,6 +628,6 @@ int dma_buf_end_cpu_access(struct dma_buf *dma_buf, · 274 unmodified lines
628628
629629 int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *,
630630 unsigned long);
631−int dma_buf_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map);
632−void dma_buf_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map);
631+int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map);
632+void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map);
633633 #endif /* __DMA_BUF_H__ */
include/linux/iosys-map.h+257−0
@@ -0,0 +1,257 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
2+/*
3+ * Pointer abstraction for IO/system memory
4+ */
5+
6+#ifndef __IOSYS_MAP_H__
7+#define __IOSYS_MAP_H__
8+
9+#include <linux/io.h>
10+#include <linux/string.h>
11+
12+/**
13+ * DOC: overview
14+ *
15+ * When accessing a memory region, depending on its location, users may have to
16+ * access it with I/O operations or memory load/store operations. For example,
17+ * copying to system memory could be done with memcpy(), copying to I/O memory
18+ * would be done with memcpy_toio().
19+ *
20+ * .. code-block:: c
21+ *
22+ * void *vaddr = ...; // pointer to system memory
23+ * memcpy(vaddr, src, len);
24+ *
25+ * void *vaddr_iomem = ...; // pointer to I/O memory
26+ * memcpy_toio(vaddr, _iomem, src, len);
27+ *
28+ * The user of such pointer may not have information about the mapping of that
29+ * region or may want to have a single code path to handle operations on that
30+ * buffer, regardless if it's located in system or IO memory. The type
31+ * :c:type:`struct iosys_map <iosys_map>` and its helpers abstract that so the
32+ * buffer can be passed around to other drivers or have separate duties inside
33+ * the same driver for allocation, read and write operations.
34+ *
35+ * Open-coding access to :c:type:`struct iosys_map <iosys_map>` is considered
36+ * bad style. Rather then accessing its fields directly, use one of the provided
37+ * helper functions, or implement your own. For example, instances of
38+ * :c:type:`struct iosys_map <iosys_map>` can be initialized statically with
39+ * IOSYS_MAP_INIT_VADDR(), or at runtime with iosys_map_set_vaddr(). These
40+ * helpers will set an address in system memory.
41+ *
42+ * .. code-block:: c
43+ *
44+ * struct iosys_map map = IOSYS_MAP_INIT_VADDR(0xdeadbeaf);
45+ *
46+ * iosys_map_set_vaddr(&map, 0xdeadbeaf);
47+ *
48+ * To set an address in I/O memory, use iosys_map_set_vaddr_iomem().
49+ *
50+ * .. code-block:: c
51+ *
52+ * iosys_map_set_vaddr_iomem(&map, 0xdeadbeaf);
53+ *
54+ * Instances of struct iosys_map do not have to be cleaned up, but
55+ * can be cleared to NULL with iosys_map_clear(). Cleared mappings
56+ * always refer to system memory.
57+ *
58+ * .. code-block:: c
59+ *
60+ * iosys_map_clear(&map);
61+ *
62+ * Test if a mapping is valid with either iosys_map_is_set() or
63+ * iosys_map_is_null().
64+ *
65+ * .. code-block:: c
66+ *
67+ * if (iosys_map_is_set(&map) != iosys_map_is_null(&map))
68+ * // always true
69+ *
70+ * Instances of :c:type:`struct iosys_map <iosys_map>` can be compared for
71+ * equality with iosys_map_is_equal(). Mappings that point to different memory
72+ * spaces, system or I/O, are never equal. That's even true if both spaces are
73+ * located in the same address space, both mappings contain the same address
74+ * value, or both mappings refer to NULL.
75+ *
76+ * .. code-block:: c
77+ *
78+ * struct iosys_map sys_map; // refers to system memory
79+ * struct iosys_map io_map; // refers to I/O memory
80+ *
81+ * if (iosys_map_is_equal(&sys_map, &io_map))
82+ * // always false
83+ *
84+ * A set up instance of struct iosys_map can be used to access or manipulate the
85+ * buffer memory. Depending on the location of the memory, the provided helpers
86+ * will pick the correct operations. Data can be copied into the memory with
87+ * iosys_map_memcpy_to(). The address can be manipulated with iosys_map_incr().
88+ *
89+ * .. code-block:: c
90+ *
91+ * const void *src = ...; // source buffer
92+ * size_t len = ...; // length of src
93+ *
94+ * iosys_map_memcpy_to(&map, src, len);
95+ * iosys_map_incr(&map, len); // go to first byte after the memcpy
96+ */
97+
98+/**
99+ * struct iosys_map - Pointer to IO/system memory
100+ * @vaddr_iomem: The buffer's address if in I/O memory
101+ * @vaddr: The buffer's address if in system memory
102+ * @is_iomem: True if the buffer is located in I/O memory, or false
103+ * otherwise.
104+ */
105+struct iosys_map {
106+ union {
107+ void __iomem *vaddr_iomem;
108+ void *vaddr;
109+ };
110+ bool is_iomem;
111+};
112+
113+/**
114+ * IOSYS_MAP_INIT_VADDR - Initializes struct iosys_map to an address in system memory
115+ * @vaddr_: A system-memory address
116+ */
117+#define IOSYS_MAP_INIT_VADDR(vaddr_) \
118+ { \
119+ .vaddr = (vaddr_), \
120+ .is_iomem = false, \
121+ }
122+
123+/**
124+ * iosys_map_set_vaddr - Sets a iosys mapping structure to an address in system memory
125+ * @map: The iosys_map structure
126+ * @vaddr: A system-memory address
127+ *
128+ * Sets the address and clears the I/O-memory flag.
129+ */
130+static inline void iosys_map_set_vaddr(struct iosys_map *map, void *vaddr)
131+{
132+ map->vaddr = vaddr;
133+ map->is_iomem = false;
134+}
135+
136+/**
137+ * iosys_map_set_vaddr_iomem - Sets a iosys mapping structure to an address in I/O memory
138+ * @map: The iosys_map structure
139+ * @vaddr_iomem: An I/O-memory address
140+ *
141+ * Sets the address and the I/O-memory flag.
142+ */
143+static inline void iosys_map_set_vaddr_iomem(struct iosys_map *map,
144+ void __iomem *vaddr_iomem)
145+{
146+ map->vaddr_iomem = vaddr_iomem;
147+ map->is_iomem = true;
148+}
149+
150+/**
151+ * iosys_map_is_equal - Compares two iosys mapping structures for equality
152+ * @lhs: The iosys_map structure
153+ * @rhs: A iosys_map structure to compare with
154+ *
155+ * Two iosys mapping structures are equal if they both refer to the same type of memory
156+ * and to the same address within that memory.
157+ *
158+ * Returns:
159+ * True is both structures are equal, or false otherwise.
160+ */
161+static inline bool iosys_map_is_equal(const struct iosys_map *lhs,
162+ const struct iosys_map *rhs)
163+{
164+ if (lhs->is_iomem != rhs->is_iomem)
165+ return false;
166+ else if (lhs->is_iomem)
167+ return lhs->vaddr_iomem == rhs->vaddr_iomem;
168+ else
169+ return lhs->vaddr == rhs->vaddr;
170+}
171+
172+/**
173+ * iosys_map_is_null - Tests for a iosys mapping to be NULL
174+ * @map: The iosys_map structure
175+ *
176+ * Depending on the state of struct iosys_map.is_iomem, tests if the
177+ * mapping is NULL.
178+ *
179+ * Returns:
180+ * True if the mapping is NULL, or false otherwise.
181+ */
182+static inline bool iosys_map_is_null(const struct iosys_map *map)
183+{
184+ if (map->is_iomem)
185+ return !map->vaddr_iomem;
186+ return !map->vaddr;
187+}
188+
189+/**
190+ * iosys_map_is_set - Tests if the iosys mapping has been set
191+ * @map: The iosys_map structure
192+ *
193+ * Depending on the state of struct iosys_map.is_iomem, tests if the
194+ * mapping has been set.
195+ *
196+ * Returns:
197+ * True if the mapping is been set, or false otherwise.
198+ */
199+static inline bool iosys_map_is_set(const struct iosys_map *map)
200+{
201+ return !iosys_map_is_null(map);
202+}
203+
204+/**
205+ * iosys_map_clear - Clears a iosys mapping structure
206+ * @map: The iosys_map structure
207+ *
208+ * Clears all fields to zero, including struct iosys_map.is_iomem, so
209+ * mapping structures that were set to point to I/O memory are reset for
210+ * system memory. Pointers are cleared to NULL. This is the default.
211+ */
212+static inline void iosys_map_clear(struct iosys_map *map)
213+{
214+ if (map->is_iomem) {
215+ map->vaddr_iomem = NULL;
216+ map->is_iomem = false;
217+ } else {
218+ map->vaddr = NULL;
219+ }
220+}
221+
222+/**
223+ * iosys_map_memcpy_to - Memcpy into iosys mapping
224+ * @dst: The iosys_map structure
225+ * @src: The source buffer
226+ * @len: The number of byte in src
227+ *
228+ * Copies data into a iosys mapping. The source buffer is in system
229+ * memory. Depending on the buffer's location, the helper picks the correct
230+ * method of accessing the memory.
231+ */
232+static inline void iosys_map_memcpy_to(struct iosys_map *dst, const void *src,
233+ size_t len)
234+{
235+ if (dst->is_iomem)
236+ memcpy_toio(dst->vaddr_iomem, src, len);
237+ else
238+ memcpy(dst->vaddr, src, len);
239+}
240+
241+/**
242+ * iosys_map_incr - Increments the address stored in a iosys mapping
243+ * @map: The iosys_map structure
244+ * @incr: The number of bytes to increment
245+ *
246+ * Increments the address stored in a iosys mapping. Depending on the
247+ * buffer's location, the correct value will be updated.
248+ */
249+static inline void iosys_map_incr(struct iosys_map *map, size_t incr)
250+{
251+ if (map->is_iomem)
252+ map->vaddr_iomem += incr;
253+ else
254+ map->vaddr += incr;
255+}
256+
257+#endif /* __IOSYS_MAP_H__ */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t