[PATCH 07/16] drm/qxl: implement mmap access managament

David Herrmann dh.herrmann at gmail.com
Tue Aug 13 12:38:28 PDT 2013


Correctly allow and revoke buffer access on each open/close via the new
VMA offset manager.

Cc: Dave Airlie <airlied at redhat.com>
Signed-off-by: David Herrmann <dh.herrmann at gmail.com>
---
 drivers/gpu/drm/qxl/qxl_gem.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/qxl/qxl_gem.c b/drivers/gpu/drm/qxl/qxl_gem.c
index a235693..fb38a5e 100644
--- a/drivers/gpu/drm/qxl/qxl_gem.c
+++ b/drivers/gpu/drm/qxl/qxl_gem.c
@@ -129,12 +129,17 @@ void qxl_gem_object_unpin(struct drm_gem_object *obj)
 
 int qxl_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_priv)
 {
-	return 0;
+	struct qxl_bo *qobj = obj->driver_private;
+
+	return drm_vma_node_allow(&qobj->tbo.vma_node, file_priv->filp);
 }
 
 void qxl_gem_object_close(struct drm_gem_object *obj,
 			  struct drm_file *file_priv)
 {
+	struct qxl_bo *qobj = obj->driver_private;
+
+	drm_vma_node_revoke(&qobj->tbo.vma_node, file_priv->filp);
 }
 
 int qxl_gem_init(struct qxl_device *qdev)
-- 
1.8.3.4



More information about the dri-devel mailing list