History

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>

Nirmoy Das committed 3 years ago

Commit 899d3a31 parent 2293a732 files · +55 −22Browse files

Showing the changes to include/drm (1 of 2 files). Show all

Unified · Split

include/drm/drm_vma_manager.h+1−0
@@ -74,6 +74,7 @@ void drm_vma_offset_remove(struct drm_vma_offset_manager *mgr, · 73 unmodified lines
7474 struct drm_vma_offset_node *node);
7575
7676 int drm_vma_node_allow(struct drm_vma_offset_node *node, struct drm_file *tag);
77+int drm_vma_node_allow_once(struct drm_vma_offset_node *node, struct drm_file *tag);
7778 void drm_vma_node_revoke(struct drm_vma_offset_node *node,
7879 struct drm_file *tag);
7980 bool drm_vma_node_is_allowed(struct drm_vma_offset_node *node,