[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240502090149.6b33817e@collabora.com>
Date: Thu, 2 May 2024 09:01:49 +0200
From: Boris Brezillon <boris.brezillon@...labora.com>
To: Adrián Larumbe <adrian.larumbe@...labora.com>
Cc: Qiang Yu <yuq825@...il.com>, Maarten Lankhorst
<maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>, Rob Herring <robh@...nel.org>, Steven
Price <steven.price@....com>, Sumit Semwal <sumit.semwal@...aro.org>,
Christian Koenig= <christian.koenig@....com>, Dmitry Osipenko
<dmitry.osipenko@...labora.com>, Zack Rusin <zack.rusin@...adcom.com>,
kernel@...labora.com, dri-devel@...ts.freedesktop.org,
lima@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, linaro-mm-sig@...ts.linaro.org
Subject: Re: [PATCH v3 2/2] drm/gem-shmem: Add import attachment warning to
locked pin function
On Wed, 1 May 2024 07:56:00 +0100
Adrián Larumbe <adrian.larumbe@...labora.com> wrote:
> Commit ec144244a43f ("drm/gem-shmem: Acquire reservation lock in GEM
> pin/unpin callbacks") moved locking DRM object's dma reservation to
> drm_gem_shmem_object_pin, and made drm_gem_shmem_pin_locked public, so we
> need to make sure the non-NULL check warning is also added to the latter.
>
> Signed-off-by: Adrián Larumbe <adrian.larumbe@...labora.com>
> ---
> drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
> index 177773bcdbfd..ad5d9f704e15 100644
> --- a/drivers/gpu/drm/drm_gem_shmem_helper.c
> +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
> @@ -233,6 +233,8 @@ int drm_gem_shmem_pin_locked(struct drm_gem_shmem_object *shmem)
>
> dma_resv_assert_held(shmem->base.resv);
>
> + drm_WARN_ON(shmem->base.dev, shmem->base.import_attach);
If we add a WARN_ON() here, we can probably drop the one in
drm_gem_shmem_pin(), and do the same for drm_gem_shmem_unpin[_locked]()
to keep things consistent.
> +
> ret = drm_gem_shmem_get_pages(shmem);
>
> return ret;
Powered by blists - more mailing lists