@@ -214,6 +214,8 @@ static struct drm_driver driver = {
.gem_init_object = ast_gem_init_object,
.gem_free_object = ast_gem_free_object,
+ .gem_open_object = ast_gem_open_object,
+ .gem_close_object = ast_gem_close_object,
.dumb_create = ast_dumb_create,
.dumb_map_offset = ast_dumb_mmap_offset,
.dumb_destroy = drm_gem_dumb_destroy,
@@ -325,6 +325,10 @@ extern int ast_dumb_create(struct drm_file *file,
extern int ast_gem_init_object(struct drm_gem_object *obj);
extern void ast_gem_free_object(struct drm_gem_object *obj);
+extern int ast_gem_open_object(struct drm_gem_object *obj,
+ struct drm_file *file_priv);
+extern void ast_gem_close_object(struct drm_gem_object *obj,
+ struct drm_file *file_priv);
extern int ast_dumb_mmap_offset(struct drm_file *file,
struct drm_device *dev,
uint32_t handle,
@@ -477,6 +477,21 @@ void ast_gem_free_object(struct drm_gem_object *obj)
ast_bo_unref(&ast_bo);
}
+int ast_gem_open_object(struct drm_gem_object *obj,
+ struct drm_file *file_priv)
+{
+ struct ast_bo *ast_bo = gem_to_ast_bo(obj);
+
+ return drm_vma_node_allow(&ast_bo->bo.vma_node, file_priv->filp);
+}
+
+void ast_gem_close_object(struct drm_gem_object *obj,
+ struct drm_file *file_priv)
+{
+ struct ast_bo *ast_bo = gem_to_ast_bo(obj);
+
+ drm_vma_node_revoke(&ast_bo->bo.vma_node, file_priv->filp);
+}
static inline u64 ast_bo_mmap_offset(struct ast_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/ast/ast_drv.c | 2 ++ drivers/gpu/drm/ast/ast_drv.h | 4 ++++ drivers/gpu/drm/ast/ast_main.c | 15 +++++++++++++++ 3 files changed, 21 insertions(+)