summaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_fops.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-11-10 12:28:56 +0100
committerDave Airlie <airlied@linux.ie>2005-11-10 12:28:56 +0100
commit3f9df54d6386bb632ffc00665489bb3bb3bf6ff2 (patch)
tree1fdd818d7c58ebc80e4b0006d0b40b7467c1d881 /drivers/char/drm/drm_fops.c
parentdrm: rename driver hooks more understandably (diff)
downloadlinux-3f9df54d6386bb632ffc00665489bb3bb3bf6ff2.tar.xz
linux-3f9df54d6386bb632ffc00665489bb3bb3bf6ff2.zip
drm: remove drm_init.c it is no longer needed
Move drm_cpu_valid into drm_fops.c Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_fops.c')
-rw-r--r--drivers/char/drm/drm_fops.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/char/drm/drm_fops.c b/drivers/char/drm/drm_fops.c
index f57f7d1a281e..28f01305377f 100644
--- a/drivers/char/drm/drm_fops.c
+++ b/drivers/char/drm/drm_fops.c
@@ -322,6 +322,23 @@ int drm_release(struct inode *inode, struct file *filp)
EXPORT_SYMBOL(drm_release);
/**
+ * Check whether DRI will run on this CPU.
+ *
+ * \return non-zero if the DRI will run on this CPU, or zero otherwise.
+ */
+static int drm_cpu_valid(void)
+{
+#if defined(__i386__)
+ if (boot_cpu_data.x86 == 3)
+ return 0; /* No cmpxchg on a 386 */
+#endif
+#if defined(__sparc__) && !defined(__sparc_v9__)
+ return 0; /* No cmpxchg before v9 sparc. */
+#endif
+ return 1;
+}
+
+/**
* Called whenever a process opens /dev/drm.
*
* \param inode device inode.