logrotate: enable selinux support
[buildroot-gz.git] / package / libdrm / 0001-Add-ARM-support-into-xf86drm.h.patch
blob3c00e9c73af22644bb8f8c9f69556ffdf29036d7
1 From 2e3dd0040e676530f7e735fab335ff449b9b3f4d Mon Sep 17 00:00:00 2001
2 From: Lauren Post <lauren.post@freescale.com>
3 Date: Tue, 22 Mar 2016 22:08:25 +0100
4 Subject: [PATCH] Add ARM support into xf86drm.h
6 This provides support for Xorg interface. Without this the vivante
7 samples will hang during close requiring a reboot
9 [Adapted from yocto project]
10 Upstream-Status: Pending
11 Signed-off-by: Lauren Post <lauren.post@freescale.com>
12 Signed-off-by: Evan Kotara <evan.kotara@freescale.com>
13 [Thomas: change CAS code to only be used on ARMv6/ARMv7, and not
14 ARMv4/ARMv5, which don't support ldrex/strex. If no CAS implementation
15 is provided libdrm falls back to a system call for locking/unlocking.]
16 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
17 ---
18 xf86drm.h | 22 ++++++++++++++++++++++
19 1 file changed, 22 insertions(+)
21 diff --git a/xf86drm.h b/xf86drm.h
22 index 481d882..72341f6 100644
23 --- a/xf86drm.h
24 +++ b/xf86drm.h
25 @@ -469,6 +469,28 @@ do { register unsigned int __old __asm("o0"); \
26 : "cr0", "memory"); \
27 } while (0)
29 +# elif defined (__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
30 + || defined (__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
31 + || defined (__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \
32 + || defined (__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
33 + || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
34 + || defined(__ARM_ARCH_7EM__)
35 + #undef DRM_DEV_MODE
36 + #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
38 + #define DRM_CAS(lock,old,new,__ret) \
39 + do { \
40 + __asm__ __volatile__ ( \
41 + "1: ldrex %0, [%1]\n" \
42 + " teq %0, %2\n" \
43 + " ite eq\n" \
44 + " strexeq %0, %3, [%1]\n" \
45 + " movne %0, #1\n" \
46 + : "=&r" (__ret) \
47 + : "r" (lock), "r" (old), "r" (new) \
48 + : "cc","memory"); \
49 + } while (0)
51 #endif /* architecture */
52 #endif /* __GNUC__ >= 2 */
54 --
55 2.6.4