summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/drm_atomic.h
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2008-10-03 16:59:11 +0000
committerrnoland <rnoland@FreeBSD.org>2008-10-03 16:59:11 +0000
commitbbc754f502e8dc966e5d05fc4fd4d91d4c136d83 (patch)
tree2d4185c3ec896efd0d1b2735041e6ddeb6a750f1 /sys/dev/drm/drm_atomic.h
parentbbe0e181656adf606748968f5803bb8cbc7d83c8 (diff)
downloadFreeBSD-src-bbc754f502e8dc966e5d05fc4fd4d91d4c136d83.zip
FreeBSD-src-bbc754f502e8dc966e5d05fc4fd4d91d4c136d83.tar.gz
resync to git master
This reverts a private patch which is causing issues with many Intel chipsets. I will review that patch and see what we need to do to fix it up later, but for the time being, we will just get these chips working again. This update contains a lot of code cleanup and is post gem merge (no, we don't have gem support). It should prove much easier to read the code now. A lot of thanks goes to vehemens for that work. I have adapted the code to use cdevpriv for tracking per open file data. That alleviates the old ugly hack that we used to try and accomplish the task and helped to clean up the open / close behavior a good bit. This also replaces the hack that was put in place a year or so ago to prevent radeons from locking up with AIGLX enabled. I have had a couple of radeon testers report that it still works as expected, though I no longer have radeon hardware to test with myself. Other various fixes from the linux crew and Intel, many of which are muddled in with the gem merge. Approved by: jhb (mentor) Obtained from: mesa/drm git master MFC after: 2 weeks
Diffstat (limited to 'sys/dev/drm/drm_atomic.h')
-rw-r--r--sys/dev/drm/drm_atomic.h53
1 files changed, 0 insertions, 53 deletions
diff --git a/sys/dev/drm/drm_atomic.h b/sys/dev/drm/drm_atomic.h
index cf9d206..e8cd818 100644
--- a/sys/dev/drm/drm_atomic.h
+++ b/sys/dev/drm/drm_atomic.h
@@ -36,65 +36,12 @@ __FBSDID("$FreeBSD$");
typedef u_int32_t atomic_t;
-#ifdef __FreeBSD__
#define atomic_set(p, v) (*(p) = (v))
#define atomic_read(p) (*(p))
#define atomic_inc(p) atomic_add_int(p, 1)
#define atomic_dec(p) atomic_subtract_int(p, 1)
#define atomic_add(n, p) atomic_add_int(p, n)
#define atomic_sub(n, p) atomic_subtract_int(p, n)
-#else /* __FreeBSD__ */
-/* FIXME */
-#define atomic_set(p, v) (*(p) = (v))
-#define atomic_read(p) (*(p))
-#define atomic_inc(p) (*(p) += 1)
-#define atomic_dec(p) (*(p) -= 1)
-#define atomic_add(n, p) (*(p) += (n))
-#define atomic_sub(n, p) (*(p) -= (n))
-/* FIXME */
-#define atomic_add_int(p, v) *(p) += v
-#define atomic_subtract_int(p, v) *(p) -= v
-#define atomic_set_int(p, bits) *(p) |= (bits)
-#define atomic_clear_int(p, bits) *(p) &= ~(bits)
-#endif /* !__FreeBSD__ */
-
-#if !defined(__FreeBSD_version) || (__FreeBSD_version < 500000)
-#if defined(__i386__)
-/* The extra atomic functions from 5.0 haven't been merged to 4.x */
-static __inline int
-atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
-{
- int res = exp;
-
- __asm __volatile (
- " lock ; "
- " cmpxchgl %1,%2 ; "
- " setz %%al ; "
- " movzbl %%al,%0 ; "
- "1: "
- "# atomic_cmpset_int"
- : "+a" (res) /* 0 (result) */
- : "r" (src), /* 1 */
- "m" (*(dst)) /* 2 */
- : "memory");
-
- return (res);
-}
-#else /* __i386__ */
-static __inline int
-atomic_cmpset_int(__volatile__ int *dst, int old, int new)
-{
- int s = splhigh();
- if (*dst==old) {
- *dst = new;
- splx(s);
- return 1;
- }
- splx(s);
- return 0;
-}
-#endif /* !__i386__ */
-#endif /* !__FreeBSD_version || __FreeBSD_version < 500000 */
static __inline atomic_t
test_and_set_bit(int b, volatile void *p)
OpenPOWER on IntegriCloud