@@ -193,6 +193,10 @@ int cirrus_device_init(struct cirrus_device *cdev,
void cirrus_device_fini(struct cirrus_device *cdev);
int cirrus_gem_init_object(struct drm_gem_object *obj);
void cirrus_gem_free_object(struct drm_gem_object *obj);
+int cirrus_gem_open_object(struct drm_gem_object *obj,
+ struct drm_file *file_priv);
+void cirrus_gem_close_object(struct drm_gem_object *obj,
+ struct drm_file *file_priv);
int cirrus_dumb_mmap_offset(struct drm_file *file,
struct drm_device *dev,
uint32_t handle,
@@ -284,6 +284,21 @@ void cirrus_gem_free_object(struct drm_gem_object *obj)
cirrus_bo_unref(&cirrus_bo);
}
+int cirrus_gem_open_object(struct drm_gem_object *obj,
+ struct drm_file *file_priv)
+{
+ struct cirrus_bo *bo = gem_to_cirrus_bo(obj);
+
+ return drm_vma_node_allow(&bo->bo.vma_node, file_priv->filp);
+}
+
+void cirrus_gem_close_object(struct drm_gem_object *obj,
+ struct drm_file *file_priv)
+{
+ struct cirrus_bo *bo = gem_to_cirrus_bo(obj);
+
+ drm_vma_node_revoke(&bo->bo.vma_node, file_priv->filp);
+}
static inline u64 cirrus_bo_mmap_offset(struct cirrus_bo *bo)
{
Correctly allow and revoke buffer access on each open/close via the new VMA offset manager. Cc: Dave Airlie <airlied@redhat.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com> --- drivers/gpu/drm/cirrus/cirrus_drv.h | 4 ++++ drivers/gpu/drm/cirrus/cirrus_main.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+)