Correctly allow and revoke buffer access on each open/close via the new VMA offset manager. Cc: Dave Airlie <airlied@xxxxxxxxxx> Signed-off-by: David Herrmann <dh.herrmann@xxxxxxxxx> --- drivers/gpu/drm/cirrus/cirrus_drv.h | 4 ++++ drivers/gpu/drm/cirrus/cirrus_main.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h index bae5560..6af655a 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.h +++ b/drivers/gpu/drm/cirrus/cirrus_drv.h @@ -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, diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c index 3a7a0ef..345e77b 100644 --- a/drivers/gpu/drm/cirrus/cirrus_main.c +++ b/drivers/gpu/drm/cirrus/cirrus_main.c @@ -291,6 +291,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) { -- 1.8.3.2 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel