From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org, tzimmermann@suse.de
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH 5/9] drm/qxl: avoid accessing iosys_map internals.
Date: Thu, 22 May 2025 16:52:14 +1000 [thread overview]
Message-ID: <20250522065519.318013-6-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 avoid touching the iosys_map internals.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/qxl/qxl_display.c | 14 +++++++-------
drivers/gpu/drm/qxl/qxl_draw.c | 4 ++--
drivers/gpu/drm/qxl/qxl_object.c | 8 ++++----
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 70aff64ced87..e833b0bbff47 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -602,16 +602,16 @@ static struct qxl_bo *qxl_create_cursor(struct qxl_device *qdev,
cursor.chunk.next_chunk = 0;
cursor.chunk.prev_chunk = 0;
cursor.chunk.data_size = size;
- if (cursor_map.is_iomem) {
- memcpy_toio(cursor_map.vaddr_iomem,
+ if (iosys_map_is_iomem(&cursor_map)) {
+ memcpy_toio(iosys_map_ioptr(&cursor_map),
&cursor, sizeof(cursor));
- memcpy_toio(cursor_map.vaddr_iomem + sizeof(cursor),
- user_map.vaddr, size);
+ memcpy_toio(iosys_map_ioptr(&cursor_map) + sizeof(cursor),
+ iosys_map_ptr(&user_map), size);
} else {
- memcpy(cursor_map.vaddr,
+ memcpy(iosys_map_ptr(&cursor_map),
&cursor, sizeof(cursor));
- memcpy(cursor_map.vaddr + sizeof(cursor),
- user_map.vaddr, size);
+ memcpy(iosys_map_ptr(&cursor_map) + sizeof(cursor),
+ iosys_map_ptr(&user_map), size);
}
qxl_bo_vunmap_and_unpin(user_bo);
diff --git a/drivers/gpu/drm/qxl/qxl_draw.c b/drivers/gpu/drm/qxl/qxl_draw.c
index 3a3e127ce297..6000936bc8d0 100644
--- a/drivers/gpu/drm/qxl/qxl_draw.c
+++ b/drivers/gpu/drm/qxl/qxl_draw.c
@@ -52,7 +52,7 @@ static struct qxl_rect *drawable_set_clipping(struct qxl_device *qdev,
ret = qxl_bo_vmap_locked(clips_bo, &map);
if (ret)
return NULL;
- dev_clips = map.vaddr; /* TODO: Use mapping abstraction properly */
+ dev_clips = iosys_map_ptr(&map); /* TODO: Use mapping abstraction properly */
dev_clips->num_rects = num_clips;
dev_clips->chunk.next_chunk = 0;
@@ -206,7 +206,7 @@ void qxl_draw_dirty_fb(struct qxl_device *qdev,
ret = qxl_bo_vmap_locked(bo, &surface_map);
if (ret)
goto out_release_backoff;
- surface_base = surface_map.vaddr; /* TODO: Use mapping abstraction properly */
+ surface_base = iosys_map_ptr(&surface_map); /* TODO: Use mapping abstraction properly */
ret = qxl_image_init(qdev, release, dimage, surface_base,
left - dumb_shadow_offset,
diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c
index 66635c55cf85..dcc1f6393885 100644
--- a/drivers/gpu/drm/qxl/qxl_object.c
+++ b/drivers/gpu/drm/qxl/qxl_object.c
@@ -172,10 +172,10 @@ int qxl_bo_vmap_locked(struct qxl_bo *bo, struct iosys_map *map)
bo->map_count = 1;
/* TODO: Remove kptr in favor of map everywhere. */
- if (bo->map.is_iomem)
- bo->kptr = (void *)bo->map.vaddr_iomem;
+ if (iosys_map_is_iomem(&bo->map))
+ bo->kptr = (void *)iosys_map_ioptr(&bo->map);
else
- bo->kptr = bo->map.vaddr;
+ bo->kptr = iosys_map_ptr(&bo->map);
out:
*map = bo->map;
@@ -230,7 +230,7 @@ void *qxl_bo_kmap_atomic_page(struct qxl_device *qdev,
ret = qxl_bo_vmap_locked(bo, &bo_map);
if (ret)
return NULL;
- rptr = bo_map.vaddr; /* TODO: Use mapping abstraction properly */
+ rptr = iosys_map_ptr(&bo_map); /* TODO: Use mapping abstraction properly */
rptr += page_offset * PAGE_SIZE;
return rptr;
--
2.49.0
next prev parent reply other threads:[~2025-05-22 6:57 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 ` Dave Airlie [this message]
2025-05-22 13:39 ` [PATCH 5/9] drm/qxl: avoid accessing iosys_map internals Lucas De Marchi
2025-05-22 6:52 ` [PATCH 6/9] drm/ttm: " Dave Airlie
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-6-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.