]> git.baikalelectronics.ru Git - kernel.git/commit
drm/client: Depend on GEM object kmap ref-counting
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 20 Nov 2020 10:25:38 +0000 (11:25 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 24 Nov 2020 08:27:54 +0000 (09:27 +0100)
commit915c8c1c4b20805c3a5031356162298acc867727
tree08051f0fac71454beb280418a93226e9c9ac6529
parent865e171e3192cfe893d3c9829e3021ff5758334a
drm/client: Depend on GEM object kmap ref-counting

DRM client's vmap/vunmap functions don't allow for multiple vmap
operations. Calling drm_client_buffer_vmap() twice returns the same
mapping, then calling drm_client_buffer_vunmap() twice already unmaps
on the first call. This leads to unbalanced vmap refcounts. Fix this
by calling drm_gem_vmap() unconditionally in drm_client_buffer_vmap().

All drivers that support DRM clients have to implement correct ref-
counting for their vmap operations, or not vunmap at all. This is the
case for drivers that use CMA, SHMEM and VRAM helpers, and QXL. Other
drivers are not affected.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20201120102545.4047-4-tzimmermann@suse.de
drivers/gpu/drm/drm_client.c