From: Boris Brezillon <boris.brezillon@collabora.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dmitry.osipenko@collabora.com, airlied@gmail.com,
simona@ffwll.ch, mripard@kernel.org,
maarten.lankhorst@linux.intel.com,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/client: Do not pin in drm_client_buffer_vmap()
Date: Mon, 14 Apr 2025 12:02:25 +0200 [thread overview]
Message-ID: <20250414120225.39d43086@collabora.com> (raw)
In-Reply-To: <20250404132907.225803-2-tzimmermann@suse.de>
On Fri, 4 Apr 2025 15:23:31 +0200
Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Pin and vmap are two distict operations. Do not mix them.
>
> The helper drm_client_buffer_vmap() maps the pages for fbdev-dma
> and fbdev-shmem. In both cases, the vmap operation ensures that
> the pages are available until the vunmap happens. And as the pages
> in DMA or SHMEM areas cannot be moved, there is no reason to call
> pin. Hence remove the pin call.
>
> Update drm_client_buffer_vunmap() accordingly.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
> drivers/gpu/drm/drm_client.c | 22 +++++-----------------
> 1 file changed, 5 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c
> index f1de7faf9fb45..154693066a127 100644
> --- a/drivers/gpu/drm/drm_client.c
> +++ b/drivers/gpu/drm/drm_client.c
> @@ -303,34 +303,23 @@ EXPORT_SYMBOL(drm_client_buffer_vunmap_local);
> * Returns:
> * 0 on success, or a negative errno code otherwise.
> */
> -int
> -drm_client_buffer_vmap(struct drm_client_buffer *buffer,
> - struct iosys_map *map_copy)
> +int drm_client_buffer_vmap(struct drm_client_buffer *buffer,
> + struct iosys_map *map_copy)
> {
> struct drm_gem_object *gem = buffer->gem;
> struct iosys_map *map = &buffer->map;
> int ret;
>
> drm_gem_lock(gem);
> -
> - ret = drm_gem_pin_locked(gem);
> - if (ret)
> - goto err_drm_gem_pin_locked;
> ret = drm_gem_vmap_locked(gem, map);
> - if (ret)
> - goto err_drm_gem_vmap;
> -
> drm_gem_unlock(gem);
>
> + if (ret)
> + return ret;
> +
> *map_copy = *map;
>
> return 0;
> -
> -err_drm_gem_vmap:
> - drm_gem_unpin_locked(buffer->gem);
> -err_drm_gem_pin_locked:
> - drm_gem_unlock(gem);
> - return ret;
> }
> EXPORT_SYMBOL(drm_client_buffer_vmap);
>
> @@ -349,7 +338,6 @@ void drm_client_buffer_vunmap(struct drm_client_buffer *buffer)
>
> drm_gem_lock(gem);
> drm_gem_vunmap_locked(gem, map);
> - drm_gem_unpin_locked(gem);
> drm_gem_unlock(gem);
> }
> EXPORT_SYMBOL(drm_client_buffer_vunmap);
next prev parent reply other threads:[~2025-04-14 10:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-04 13:23 [PATCH 0/4] drm: Restrict GEM's pin/unpin to PRIME Thomas Zimmermann
2025-04-04 13:23 ` [PATCH 1/4] drm/client: Do not pin in drm_client_buffer_vmap() Thomas Zimmermann
2025-04-14 10:02 ` Boris Brezillon [this message]
2025-04-14 10:31 ` Dmitry Osipenko
2025-04-04 13:23 ` [PATCH 2/4] drm/gem-vram: Do not set pin and unpin callbacks Thomas Zimmermann
2025-04-14 10:32 ` Dmitry Osipenko
2025-04-04 13:23 ` [PATCH 3/4] drm/gem-vram: Un-export pin helpers Thomas Zimmermann
2025-04-14 10:32 ` Dmitry Osipenko
2025-04-04 13:23 ` [PATCH 4/4] drm/gem: Inline drm_gem_pin() into PRIME helpers Thomas Zimmermann
2025-04-14 10:37 ` Dmitry Osipenko
2025-04-14 8:21 ` [PATCH 0/4] drm: Restrict GEM's pin/unpin to PRIME Thomas Zimmermann
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=20250414120225.39d43086@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=airlied@gmail.com \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--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.