summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2013-06-07 20:46:16 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2013-06-07 20:46:16 +0000
commitb5eb995ea27dc816484505244c7aef178f6ac040 (patch)
treecf5013ccd0dbe0ee67adab36592b1573ac2891e4 /sys/uvm
parent4d536be368ceb6ab24e88330ed0aecc489be7945 (diff)
Add proper mmap(2) support for drm(4)/inteldrm(4). This changes the
DRM_I915_GEM_MMAP and DRM_I915_GEM_MMAP_GTT ioctls to be compatible with Linux. This also is the first step that moves us away from accessing all graphics memory through the GTT, which should make things faster. ok tedu@ (for the uvm bits)
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_device.c13
-rw-r--r--sys/uvm/uvm_device.h3
2 files changed, 14 insertions, 2 deletions
diff --git a/sys/uvm/uvm_device.c b/sys/uvm/uvm_device.c
index 9d9a2cdac38..316d932d2cf 100644
--- a/sys/uvm/uvm_device.c
+++ b/sys/uvm/uvm_device.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_device.c,v 1.42 2013/05/30 16:29:46 tedu Exp $ */
+/* $OpenBSD: uvm_device.c,v 1.43 2013/06/07 20:46:14 kettenis Exp $ */
/* $NetBSD: uvm_device.c,v 1.30 2000/11/25 06:27:59 chs Exp $ */
/*
@@ -50,6 +50,8 @@
#include <uvm/uvm.h>
#include <uvm/uvm_device.h>
+#include "drm.h"
+
/*
* private global data structure
*
@@ -104,6 +106,9 @@ udv_attach(void *arg, vm_prot_t accessprot, voff_t off, vsize_t size)
dev_t device = *((dev_t *)arg);
struct uvm_device *udv, *lcv;
paddr_t (*mapfn)(dev_t, off_t, int);
+#if NDRM > 0
+ struct uvm_object *obj;
+#endif
/*
* before we do anything, ensure this device supports mmap
@@ -122,6 +127,12 @@ udv_attach(void *arg, vm_prot_t accessprot, voff_t off, vsize_t size)
if (off < 0)
return(NULL);
+#if NDRM > 0
+ obj = udv_attach_drm(arg, accessprot, off, size);
+ if (obj)
+ return(obj);
+#endif
+
/*
* Check that the specified range of the device allows the
* desired protection.
diff --git a/sys/uvm/uvm_device.h b/sys/uvm/uvm_device.h
index e31455e8102..03bc37df44f 100644
--- a/sys/uvm/uvm_device.h
+++ b/sys/uvm/uvm_device.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_device.h,v 1.8 2002/03/14 01:27:18 millert Exp $ */
+/* $OpenBSD: uvm_device.h,v 1.9 2013/06/07 20:46:14 kettenis Exp $ */
/* $NetBSD: uvm_device.h,v 1.9 2000/05/28 10:21:55 drochner Exp $ */
/*
@@ -71,6 +71,7 @@ struct uvm_device {
*/
struct uvm_object *udv_attach(void *, vm_prot_t, voff_t, vsize_t);
+struct uvm_object *udv_attach_drm(void *, vm_prot_t, voff_t, vsize_t);
#endif /* _KERNEL */