]> 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)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 25 Feb 2021 09:33:39 +0000 (10:33 +0100)
commitcdea72518a2b38207146e92e1c9e2fac15975679
treed391515e9bcdf079d30ac5dedd3e7cc9c385d7ed
parentc129b49825530942f344ed3e0e6a72568ad3e3e2
drm/shmem-helpers: vunmap: Don't put pages for dma-buf

dma-buf importing was reworked in commit 7d2cd72a9aa3
("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: 7d2cd72a9aa3 ("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>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210219122203.51130-1-noralf@tronnes.org
drivers/gpu/drm/drm_gem_shmem_helper.c