summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/drm/drm_drv.c14
-rw-r--r--sys/dev/pci/drm/drm_fops.c65
-rw-r--r--sys/dev/pci/drm/files.drm3
-rw-r--r--sys/sys/conf.h6
4 files changed, 18 insertions, 70 deletions
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c
index 34e24c8a90c..418d6b3800c 100644
--- a/sys/dev/pci/drm/drm_drv.c
+++ b/sys/dev/pci/drm/drm_drv.c
@@ -24,6 +24,7 @@
*
* Authors:
* Rickard E. (Rik) Faith <faith@valinux.com>
+ * Daryll Strauss <daryll@valinux.com>
* Gareth Hughes <gareth@valinux.com>
*
*/
@@ -230,6 +231,19 @@ drm_find_description(int vendor, int device, drm_pci_id_list_t *idlist)
return NULL;
}
+struct drm_file *
+drm_find_file_by_minor(struct drm_device *dev, int minor)
+{
+ struct drm_file *priv;
+
+ DRM_SPINLOCK_ASSERT(&dev->dev_lock);
+
+ TAILQ_FOREACH(priv, &dev->files, link)
+ if (priv->minor == minor)
+ break;
+ return (priv);
+}
+
int
drm_firstopen(struct drm_device *dev)
{
diff --git a/sys/dev/pci/drm/drm_fops.c b/sys/dev/pci/drm/drm_fops.c
deleted file mode 100644
index ebf4989bf25..00000000000
--- a/sys/dev/pci/drm/drm_fops.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Rickard E. (Rik) Faith <faith@valinux.com>
- * Daryll Strauss <daryll@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-/** @file drm_fops.c
- * Support code for dealing with the file privates associated with each
- * open of the DRM device.
- */
-
-#include "drmP.h"
-
-struct drm_file *
-drm_find_file_by_minor(struct drm_device *dev, int minor)
-{
- struct drm_file *priv;
-
- DRM_SPINLOCK_ASSERT(&dev->dev_lock);
-
- TAILQ_FOREACH(priv, &dev->files, link)
- if (priv->minor == minor)
- return (priv);
- return (NULL);
-}
-
-/* The drm_read and drm_poll are stubs to prevent spurious errors
- * on older X Servers (4.3.0 and earlier) */
-
-int
-drmread(dev_t kdev, struct uio *uio, int ioflag)
-{
- return 0;
-}
-
-int
-drmpoll(dev_t kdev, int events, struct proc *p)
-{
- return 0;
-}
diff --git a/sys/dev/pci/drm/files.drm b/sys/dev/pci/drm/files.drm
index 92b5108f5f2..07ac131f421 100644
--- a/sys/dev/pci/drm/files.drm
+++ b/sys/dev/pci/drm/files.drm
@@ -1,5 +1,5 @@
# $NetBSD: files.drm,v 1.2 2007/03/28 11:29:37 jmcneill Exp $
-# $OpenBSD: files.drm,v 1.5 2008/11/11 21:06:18 oga Exp $
+# $OpenBSD: files.drm,v 1.6 2008/11/17 00:40:04 oga Exp $
# direct rendering modules
define drmbase
@@ -10,7 +10,6 @@ file dev/pci/drm/drm_context.c drmbase
file dev/pci/drm/drm_dma.c drmbase
file dev/pci/drm/drm_drawable.c drmbase
file dev/pci/drm/drm_drv.c drmbase needs-flag
-file dev/pci/drm/drm_fops.c drmbase
file dev/pci/drm/drm_ioctl.c drmbase
file dev/pci/drm/drm_irq.c drmbase
file dev/pci/drm/drm_lock.c drmbase
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index c8bf0d2636a..7b228231ae2 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.90 2008/06/14 21:31:46 mbalmer Exp $ */
+/* $OpenBSD: conf.h,v 1.91 2008/11/17 00:40:04 oga Exp $ */
/* $NetBSD: conf.h,v 1.33 1996/05/03 20:03:32 christos Exp $ */
/*-
@@ -513,9 +513,9 @@ void randomattach(void);
/* open, close, read, ioctl, poll, mmap, nokqfilter */
#define cdev_drm_init(c,n) { \
- dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
+ dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
- (dev_type_stop((*))) enodev, 0, dev_init(c,n,poll), \
+ (dev_type_stop((*))) enodev, 0, (dev_type_poll((*))) enodev, \
dev_init(c,n,mmap), 0, D_CLONE }
/* open, close, ioctl */