summaryrefslogtreecommitdiff
path: root/bsd-core/drm_fops.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-11-06 01:41:47 +0000
committerEric Anholt <anholt@freebsd.org>2004-11-06 01:41:47 +0000
commitc9202c89653b8dac2ac322c3d3a7389945e1c94c (patch)
treeda57c01384977ea6a2962cfaac9c7c426da2c0f8 /bsd-core/drm_fops.c
parent39a23640b2de9e59e99d48e6de8c9edae0231856 (diff)
Commit WIP of BSD conversion to core model. Compiles for r128, radeon, but
doesn't run yet. Moves the ioctl definitions for these two drivers back to the shared code -- they aren't OS-specific.
Diffstat (limited to 'bsd-core/drm_fops.c')
-rw-r--r--bsd-core/drm_fops.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/bsd-core/drm_fops.c b/bsd-core/drm_fops.c
index 2c447992..072a6e22 100644
--- a/bsd-core/drm_fops.c
+++ b/bsd-core/drm_fops.c
@@ -33,7 +33,7 @@
#include "drmP.h"
-drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, DRM_STRUCTPROC *p)
+drm_file_t *drm_find_file_by_proc(drm_device_t *dev, DRM_STRUCTPROC *p)
{
#if __FreeBSD_version >= 500021
uid_t uid = p->td_ucred->cr_svuid;
@@ -52,8 +52,8 @@ drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, DRM_STRUCTPROC *p)
return NULL;
}
-/* DRM(open_helper) is called whenever a process opens /dev/drm. */
-int DRM(open_helper)(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p,
+/* drm_open_helper is called whenever a process opens /dev/drm. */
+int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p,
drm_device_t *dev)
{
int m = minor(kdev);
@@ -66,11 +66,11 @@ int DRM(open_helper)(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p,
DRM_DEBUG("pid = %d, minor = %d\n", DRM_CURRENTPID, m);
DRM_LOCK();
- priv = DRM(find_file_by_proc)(dev, p);
+ priv = drm_find_file_by_proc(dev, p);
if (priv) {
priv->refs++;
} else {
- priv = (drm_file_t *) DRM(alloc)(sizeof(*priv), DRM_MEM_FILES);
+ priv = (drm_file_t *)drm_alloc(sizeof(*priv), DRM_MEM_FILES);
if (priv == NULL) {
DRM_UNLOCK();
return DRM_ERR(ENOMEM);
@@ -86,12 +86,11 @@ int DRM(open_helper)(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p,
priv->refs = 1;
priv->minor = m;
- priv->devXX = dev;
priv->ioctl_count = 0;
priv->authenticated = !DRM_SUSER(p);
- if (dev->fn_tbl.open_helper)
- dev->fn_tbl.open_helper(dev, priv);
+ if (dev->open_helper)
+ dev->open_helper(dev, priv);
TAILQ_INSERT_TAIL(&dev->files, priv, link);
}
@@ -103,15 +102,15 @@ int DRM(open_helper)(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p,
}
-/* The DRM(read) and DRM(poll) are stubs to prevent spurious errors
+/* The drm_read and drm_poll are stubs to prevent spurious errors
* on older X Servers (4.3.0 and earlier) */
-int DRM(read)(struct cdev *kdev, struct uio *uio, int ioflag)
+int drm_read(struct cdev *kdev, struct uio *uio, int ioflag)
{
return 0;
}
-int DRM(poll)(struct cdev *kdev, int events, DRM_STRUCTPROC *p)
+int drm_poll(struct cdev *kdev, int events, DRM_STRUCTPROC *p)
{
return 0;
}