[PATCH v2 15/20] drm/qxl: implement mmap access managament

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/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.2

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux