OSDN Git Service

drm/drm_vma_manager: Add drm_vma_node_allow_once()
authorNirmoy Das <nirmoy.das@intel.com>
Tue, 17 Jan 2023 17:52:35 +0000 (18:52 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 19 Jan 2023 13:16:55 +0000 (14:16 +0100)
commit899d3a3c19ac0e5da013ce34833dccb97d19b5e4
tree349a6ff4ccd24f2e5088f53b062856063dd8c00c
parent2293a73ad4f3b6c37c06713ff1b67659d92ef43d
drm/drm_vma_manager: Add drm_vma_node_allow_once()

Currently there is no easy way for a drm driver to safely check and allow
drm_vma_offset_node for a drm file just once. Allow drm drivers to call
non-refcounted version of drm_vma_node_allow() so that a driver doesn't
need to keep track of each drm_vma_node_allow() to call subsequent
drm_vma_node_revoke() to prevent memory leak.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Suggested-by: Chris Wilson <chris.p.wilson@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://lore.kernel.org/r/20230117175236.22317-1-nirmoy.das@intel.com
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/drm_vma_manager.c
include/drm/drm_vma_manager.h