From 7edc3e3b975b5b3b1de313f43670738acbcc8e1d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 8 Mar 2019 08:17:13 -0800 Subject: drm: Add helpers for locking an array of BO reservations. Now that we have the reservation object in the GEM object, it's easy to provide a helper for this common case. Noticed while reviewing panfrost and lima drivers. This particular version came out of v3d, which in turn was a copy from vc4. v2: Fix kerneldoc warnings. Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20190308161716.2466-2-eric@anholt.net Acked-by: Rob Herring (v1) --- include/drm/drm_gem.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/drm/drm_gem.h') diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 25f1ff2df464..2955aaab3dca 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -384,6 +384,10 @@ void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages, struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle); long drm_gem_reservation_object_wait(struct drm_file *filep, u32 handle, bool wait_all, unsigned long timeout); +int drm_gem_lock_reservations(struct drm_gem_object **objs, int count, + struct ww_acquire_ctx *acquire_ctx); +void drm_gem_unlock_reservations(struct drm_gem_object **objs, int count, + struct ww_acquire_ctx *acquire_ctx); int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, u32 handle, u64 *offset); int drm_gem_dumb_destroy(struct drm_file *file, -- cgit v1.2.3