From 91aa32742c49db0c553b5836afd28c8ea2436014 Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Fri, 15 Oct 2004 20:36:15 +0000 Subject: Move drm_cpu_valid out of drm_init. drm_init is empty now. --- linux-core/drm_fops.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'linux-core/drm_fops.c') 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 @@ -190,6 +190,23 @@ int drm_stub_open(struct inode *inode, struct file *filp) return err; } +/** + * 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. * -- cgit v1.2.3