]> git.baikalelectronics.ru Git - kernel.git/commit
drm/shmem-helpers: vunmap: Don't put pages for dma-buf
authorNoralf Trønnes <noralf@tronnes.org>
Fri, 19 Feb 2021 12:22:03 +0000 (13:22 +0100)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Thu, 11 Mar 2021 10:11:33 +0000 (11:11 +0100)
commit6232f50185134587d8ee1a5a9489aca6099c2d1c
treeb270b07463485ccd4da6b4d230280c6c8a84784a
parent85ad32237b300cf2fb7af4b27891577d41489916
drm/shmem-helpers: vunmap: Don't put pages for dma-buf

dma-buf importing was reworked in commit 42e85ccd66ff
("drm/shmem-helpers: Simplify dma-buf importing"). Before that commit
drm_gem_shmem_prime_import_sg_table() did set ->pages_use_count=1 and
drm_gem_shmem_vunmap_locked() could call drm_gem_shmem_put_pages()
unconditionally. Now without the use count set, put pages is called also
on dma-bufs. Fix this by only putting pages if it's not imported.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Fixes: 42e85ccd66ff ("drm/shmem-helpers: Simplify dma-buf importing")
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210219122203.51130-1-noralf@tronnes.org
(cherry picked from commit cdea72518a2b38207146e92e1c9e2fac15975679)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
drivers/gpu/drm/drm_gem_shmem_helper.c