All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org, tzimmermann@suse.de
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH 6/9] drm/ttm: avoid accessing iosys_map internals.
Date: Thu, 22 May 2025 16:52:15 +1000	[thread overview]
Message-ID: <20250522065519.318013-7-airlied@gmail.com> (raw)
In-Reply-To: <20250522065519.318013-1-airlied@gmail.com>

From: Dave Airlie <airlied@redhat.com>

This uses the new accessors to use iosys_map.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/ttm/ttm_bo_util.c  | 12 ++++++------
 drivers/gpu/drm/ttm/ttm_resource.c |  8 ++++----
 drivers/gpu/drm/ttm/ttm_tt.c       |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 15cab9bda17f..ba7075fa9876 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -99,10 +99,10 @@ void ttm_move_memcpy(bool clear,
 	if (clear) {
 		for (i = 0; i < num_pages; ++i) {
 			dst_ops->map_local(dst_iter, &dst_map, i);
-			if (dst_map.is_iomem)
-				memset_io(dst_map.vaddr_iomem, 0, PAGE_SIZE);
+			if (iosys_map_is_iomem(&dst_map))
+				memset_io(iosys_map_ioptr(&dst_map), 0, PAGE_SIZE);
 			else
-				memset(dst_map.vaddr, 0, PAGE_SIZE);
+				memset(iosys_map_ptr(&dst_map), 0, PAGE_SIZE);
 			if (dst_ops->unmap_local)
 				dst_ops->unmap_local(dst_iter, &dst_map);
 		}
@@ -544,10 +544,10 @@ void ttm_bo_vunmap(struct ttm_buffer_object *bo, struct iosys_map *map)
 	if (iosys_map_is_null(map))
 		return;
 
-	if (!map->is_iomem)
-		vunmap(map->vaddr);
+	if (!iosys_map_is_iomem(map))
+		vunmap(iosys_map_ptr(map));
 	else if (!mem->bus.addr)
-		iounmap(map->vaddr_iomem);
+		iounmap(iosys_map_ioptr(map));
 	iosys_map_clear(map);
 
 	ttm_mem_io_free(bo->bdev, bo->resource);
diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c
index 769b0ca9be47..0e7b4c6c16f8 100644
--- a/drivers/gpu/drm/ttm/ttm_resource.c
+++ b/drivers/gpu/drm/ttm/ttm_resource.c
@@ -742,7 +742,7 @@ static void ttm_kmap_iter_iomap_map_local(struct ttm_kmap_iter *iter,
 static void ttm_kmap_iter_iomap_unmap_local(struct ttm_kmap_iter *iter,
 					    struct iosys_map *map)
 {
-	io_mapping_unmap_local(map->vaddr_iomem);
+	io_mapping_unmap_local(iosys_map_ioptr(map));
 }
 
 static const struct ttm_kmap_iter_ops ttm_kmap_iter_io_ops = {
@@ -886,10 +886,10 @@ ttm_kmap_iter_linear_io_fini(struct ttm_kmap_iter_linear_io *iter_io,
 			     struct ttm_resource *mem)
 {
 	if (iter_io->needs_unmap && iosys_map_is_set(&iter_io->dmap)) {
-		if (iter_io->dmap.is_iomem)
-			iounmap(iter_io->dmap.vaddr_iomem);
+		if (iosys_map_is_iomem(&iter_io->dmap))
+			iounmap(iosys_map_ioptr(&iter_io->dmap));
 		else
-			memunmap(iter_io->dmap.vaddr);
+			memunmap(iosys_map_ptr(&iter_io->dmap));
 	}
 
 	ttm_mem_io_free(bdev, mem);
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index df0aa6c4b8b8..ff9856e41b43 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -495,7 +495,7 @@ static void ttm_kmap_iter_tt_map_local(struct ttm_kmap_iter *iter,
 static void ttm_kmap_iter_tt_unmap_local(struct ttm_kmap_iter *iter,
 					 struct iosys_map *map)
 {
-	kunmap_local(map->vaddr);
+	kunmap_local(iosys_map_ptr(map));
 }
 
 static const struct ttm_kmap_iter_ops ttm_kmap_iter_tt_ops = {
-- 
2.49.0


  parent reply	other threads:[~2025-05-22  6:58 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-22  6:52 iosys-map: refactor to reduce struct size Dave Airlie
2025-05-22  6:52 ` [PATCH 1/9] iosys-map: add new accessor interfaces and use them internally Dave Airlie
2025-05-22 11:58   ` Thomas Zimmermann
2025-05-22 13:34     ` Lucas De Marchi
2025-05-22 14:00       ` Thomas Zimmermann
2025-05-22  6:52 ` [PATCH 2/9] udmabuf: use new iosys_map accessors Dave Airlie
2025-05-22  6:52 ` [PATCH 3/9] firmware/tegra: avoid accessing iosys_map internals Dave Airlie
2025-05-23  0:32   ` kernel test robot
2025-05-22  6:52 ` [PATCH 4/9] drm/xe: avoid accessing internals of iosys_map Dave Airlie
2025-05-22 13:56   ` Lucas De Marchi
2025-05-22  6:52 ` [PATCH 5/9] drm/qxl: avoid accessing iosys_map internals Dave Airlie
2025-05-22 13:39   ` Lucas De Marchi
2025-05-22  6:52 ` Dave Airlie [this message]
2025-05-22  6:52 ` [PATCH 7/9] drm: " Dave Airlie
2025-05-22  6:52 ` [PATCH 8/9] iosys: hide internal details of implementation Dave Airlie
2025-05-22 12:05   ` Thomas Zimmermann
2025-05-22 23:30   ` kernel test robot
2025-05-22  6:52 ` [PATCH 9/9] iosys_map: embed the is_iomem bit into the pointer Dave Airlie
2025-05-22  8:48   ` Jani Nikula
2025-05-22 12:10   ` Thomas Zimmermann
2025-05-22 15:09   ` Lucas De Marchi
2025-05-22 20:32     ` Dave Airlie
2025-05-22 21:05       ` Lucas De Marchi
2025-05-23 12:31         ` Jocelyn Falempe
2025-05-26  6:39     ` Thomas Zimmermann
2025-05-26  7:58       ` Dave Airlie
2025-05-26  8:14         ` Thomas Zimmermann
2025-05-22  7:13 ` iosys-map: refactor to reduce struct size Dave Airlie
2025-05-22  7:20 ` ✓ CI.Patch_applied: success for series starting with [1/9] iosys-map: add new accessor interfaces and use them internally Patchwork
2025-05-22  7:20 ` ✗ CI.checkpatch: warning " Patchwork
2025-05-22  7:21 ` ✗ CI.KUnit: failure " Patchwork
2025-05-22 12:00 ` iosys-map: refactor to reduce struct size Thomas Zimmermann
2025-05-22 13:59 ` Lucas De Marchi
2025-06-27 17:31 ` Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250522065519.318013-7-airlied@gmail.com \
    --to=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.