summaryrefslogtreecommitdiff
path: root/linux-core/drm_fops.c
diff options
context:
space:
mode:
authorJon Smirl <jonsmirl@yahoo.com>2004-10-15 20:36:15 +0000
committerJon Smirl <jonsmirl@yahoo.com>2004-10-15 20:36:15 +0000
commit91aa32742c49db0c553b5836afd28c8ea2436014 (patch)
treec4031fe1630f01beca3a5e23b885290ae38f232b /linux-core/drm_fops.c
parentfa50e2b5132b84353ae964a39c3b10ea270d15e8 (diff)
Move drm_cpu_valid out of drm_init. drm_init is empty now.
Diffstat (limited to 'linux-core/drm_fops.c')
-rw-r--r--linux-core/drm_fops.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c
index 54cebbcb..ca4f9c89 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -191,6 +191,23 @@ int drm_stub_open(struct inode *inode, struct file *filp)
}
/**
+ * 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.