drm/cma-helper: Add DRM_GEM_CMA_VMAP_DRIVER_OPS
authorNoralf Trønnes <noralf@tronnes.org>
Sat, 10 Nov 2018 14:56:46 +0000 (15:56 +0100)
committerNoralf Trønnes <noralf@tronnes.org>
Tue, 20 Nov 2018 13:57:25 +0000 (14:57 +0100)
commitb9068cde51eea189c2c3560a9a8ae83f7b213c9c
treea0fccbb4bbbdb067c68070e53d64844659b9f70e
parentb39b5394fabc79acbaafb26b777fd348c868bf7e
drm/cma-helper: Add DRM_GEM_CMA_VMAP_DRIVER_OPS

This adds functionality to the CMA helper which ensures that the kernel
virtual address is set on the CMA GEM object also for imported buffers.

The drivers have been audited to ensure that none set ->vaddr on imported
buffers, making the conditional dma_buf_vunmap() call in
drm_gem_cma_free_object() safe.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20181110145647.17580-5-noralf@tronnes.org
drivers/gpu/drm/drm_gem_cma_helper.c
include/drm/drm_gem_cma_helper.h