* [Buildroot] [PATCH 0/3] libdrm: ARMv4/ARMv5 compatibility fixes
@ 2016-03-22 21:28 Thomas Petazzoni
2016-03-22 21:28 ` [Buildroot] [PATCH 1/3] libdrm: reformat patch 0001 with Git Thomas Petazzoni
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-03-22 21:28 UTC (permalink / raw)
To: buildroot
Hello,
What prompted me to do this small patch series is this pending patch
from Bernd: http://patchwork.ozlabs.org/patch/559218/. It really
annoyed me to have to propagate this dependency that DRI support is
not available on ARMv4/ARMv5.
So I investigated, and found out that it was caused by one of our
patches on libdrm, which introduces ARMv6+ instructions. Since the CAS
stuff in libdrm is only an optimization, we can safely really on the
slow path for ARMv4/ARMv5. The CAS path is not an optimization for
Vivante GPUs for some reason, but since Vivante GPUs are only found in
ARMv6+ based SoCs anyway, we don't really care.
Fixing this patch allows:
(1) To revert a former patch done on the X.org server to take into
account this ARMv6+ dependency.
(2) Discard Bernd's patch
(3) Avoid future patches needed to propagate this ARMv6+ dependency.
Best regards,
Thomas
Thomas Petazzoni (3):
libdrm: reformat patch 0001 with Git
libdrm: adjust the ARM patch to work on ARMv4/ARMv5
Revert "package/x11r7/xserver_xorg-server: dri needs arm >= v6"
.../0001-Add-ARM-support-into-xf86drm.h.patch | 56 ++++++++++++++++++++++
package/libdrm/0001-update-arm.patch | 37 --------------
.../xserver_xorg-server/xserver_xorg-server.mk | 3 +-
3 files changed, 57 insertions(+), 39 deletions(-)
create mode 100644 package/libdrm/0001-Add-ARM-support-into-xf86drm.h.patch
delete mode 100644 package/libdrm/0001-update-arm.patch
--
2.6.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 1/3] libdrm: reformat patch 0001 with Git
2016-03-22 21:28 [Buildroot] [PATCH 0/3] libdrm: ARMv4/ARMv5 compatibility fixes Thomas Petazzoni
@ 2016-03-22 21:28 ` Thomas Petazzoni
2016-03-22 21:29 ` [Buildroot] [PATCH 2/3] libdrm: adjust the ARM patch to work on ARMv4/ARMv5 Thomas Petazzoni
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-03-22 21:28 UTC (permalink / raw)
To: buildroot
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
...tch => 0001-Add-ARM-support-into-xf86drm.h.patch} | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
rename package/libdrm/{0001-update-arm.patch => 0001-Add-ARM-support-into-xf86drm.h.patch} (69%)
diff --git a/package/libdrm/0001-update-arm.patch b/package/libdrm/0001-Add-ARM-support-into-xf86drm.h.patch
similarity index 69%
rename from package/libdrm/0001-update-arm.patch
rename to package/libdrm/0001-Add-ARM-support-into-xf86drm.h.patch
index 1a95a14..99a02a8 100644
--- a/package/libdrm/0001-update-arm.patch
+++ b/package/libdrm/0001-Add-ARM-support-into-xf86drm.h.patch
@@ -1,17 +1,24 @@
-[Adapted from yocto project]
+From c0950d73c8aa13f057707fb7933c65c147349376 Mon Sep 17 00:00:00 2001
+From: Lauren Post <lauren.post@freescale.com>
+Date: Tue, 22 Mar 2016 22:08:25 +0100
+Subject: [PATCH] Add ARM support into xf86drm.h
-Add ARM support into xf86drm.h. This provides support for Xorg interface.
-Without this the vivante samples will hang during close requiring a reboot
+This provides support for Xorg interface. Without this the vivante
+samples will hang during close requiring a reboot
+[Adapted from yocto project]
Upstream-Status: Pending
-
Signed-off-by: Lauren Post <lauren.post@freescale.com>
Signed-off-by: Evan Kotara <evan.kotara@freescale.com>
+---
+ xf86drm.h | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
diff --git a/xf86drm.h b/xf86drm.h
+index 481d882..1cc0075 100644
--- a/xf86drm.h
+++ b/xf86drm.h
-@@ -461,6 +461,23 @@ do { register unsigned int __old __asm("
+@@ -469,6 +469,23 @@ do { register unsigned int __old __asm("o0"); \
: "cr0", "memory"); \
} while (0)
@@ -35,3 +42,6 @@ diff --git a/xf86drm.h b/xf86drm.h
#endif /* architecture */
#endif /* __GNUC__ >= 2 */
+--
+2.6.4
+
--
2.6.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 2/3] libdrm: adjust the ARM patch to work on ARMv4/ARMv5
2016-03-22 21:28 [Buildroot] [PATCH 0/3] libdrm: ARMv4/ARMv5 compatibility fixes Thomas Petazzoni
2016-03-22 21:28 ` [Buildroot] [PATCH 1/3] libdrm: reformat patch 0001 with Git Thomas Petazzoni
@ 2016-03-22 21:29 ` Thomas Petazzoni
2016-03-22 21:29 ` [Buildroot] [PATCH 3/3] Revert "package/x11r7/xserver_xorg-server: dri needs arm >= v6" Thomas Petazzoni
2016-03-26 17:54 ` [Buildroot] [PATCH 0/3] libdrm: ARMv4/ARMv5 compatibility fixes Thomas Petazzoni
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-03-22 21:29 UTC (permalink / raw)
To: buildroot
The ARM patch that was added in commit
94841d87fd2ff8ebf7af84d49e5095074958febf ("libdrm: fix support for
xserver with Vivante drivers") makes the assumption that ldrex/strex
is available on ARM. While this is true on ARMv6+, it is not true on
ARMv4/ARMv5. Due to this, we had to make follow-up commits like
7bac31ceea1b52986b1773a1bd4841110672f923
("package/x11r7/xserver_xorg-server: dri needs arm >= v6") and more is
needed in the reverse dependencies to disable DRI usage on
ARMv4/ARMv5.
In fact, it turns out that the CAS code in libdrm is only an
optimization, and it will gracefully fall back to a system call based
lock/unlock mechanism.
So we simply change the patch to only provide the optimized CAS
implementation on ARMv6+. The original reason for this patch was to
fix Vivante drivers, and Vivante GPUs are only used in ARMv6+ cores,
so we should be fine (famous last words).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
.../0001-Add-ARM-support-into-xf86drm.h.patch | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/package/libdrm/0001-Add-ARM-support-into-xf86drm.h.patch b/package/libdrm/0001-Add-ARM-support-into-xf86drm.h.patch
index 99a02a8..3c00e9c 100644
--- a/package/libdrm/0001-Add-ARM-support-into-xf86drm.h.patch
+++ b/package/libdrm/0001-Add-ARM-support-into-xf86drm.h.patch
@@ -1,4 +1,4 @@
-From c0950d73c8aa13f057707fb7933c65c147349376 Mon Sep 17 00:00:00 2001
+From 2e3dd0040e676530f7e735fab335ff449b9b3f4d Mon Sep 17 00:00:00 2001
From: Lauren Post <lauren.post@freescale.com>
Date: Tue, 22 Mar 2016 22:08:25 +0100
Subject: [PATCH] Add ARM support into xf86drm.h
@@ -10,19 +10,28 @@ samples will hang during close requiring a reboot
Upstream-Status: Pending
Signed-off-by: Lauren Post <lauren.post@freescale.com>
Signed-off-by: Evan Kotara <evan.kotara@freescale.com>
+[Thomas: change CAS code to only be used on ARMv6/ARMv7, and not
+ARMv4/ARMv5, which don't support ldrex/strex. If no CAS implementation
+is provided libdrm falls back to a system call for locking/unlocking.]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
- xf86drm.h | 17 +++++++++++++++++
- 1 file changed, 17 insertions(+)
+ xf86drm.h | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
diff --git a/xf86drm.h b/xf86drm.h
-index 481d882..1cc0075 100644
+index 481d882..72341f6 100644
--- a/xf86drm.h
+++ b/xf86drm.h
-@@ -469,6 +469,23 @@ do { register unsigned int __old __asm("o0"); \
+@@ -469,6 +469,28 @@ do { register unsigned int __old __asm("o0"); \
: "cr0", "memory"); \
} while (0)
-+#elif defined(__arm__)
++# elif defined (__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
++ || defined (__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
++ || defined (__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \
++ || defined (__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
++ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
++ || defined(__ARM_ARCH_7EM__)
+ #undef DRM_DEV_MODE
+ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
+
--
2.6.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 3/3] Revert "package/x11r7/xserver_xorg-server: dri needs arm >= v6"
2016-03-22 21:28 [Buildroot] [PATCH 0/3] libdrm: ARMv4/ARMv5 compatibility fixes Thomas Petazzoni
2016-03-22 21:28 ` [Buildroot] [PATCH 1/3] libdrm: reformat patch 0001 with Git Thomas Petazzoni
2016-03-22 21:29 ` [Buildroot] [PATCH 2/3] libdrm: adjust the ARM patch to work on ARMv4/ARMv5 Thomas Petazzoni
@ 2016-03-22 21:29 ` Thomas Petazzoni
2016-03-26 17:54 ` [Buildroot] [PATCH 0/3] libdrm: ARMv4/ARMv5 compatibility fixes Thomas Petazzoni
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-03-22 21:29 UTC (permalink / raw)
To: buildroot
This reverts commit 7bac31ceea1b52986b1773a1bd4841110672f923.
This commit is no longer needed, since libdrm no longer needs arm >=
v6 support thanks to the fix to the CAS implementation.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/x11r7/xserver_xorg-server/xserver_xorg-server.mk | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/package/x11r7/xserver_xorg-server/xserver_xorg-server.mk b/package/x11r7/xserver_xorg-server/xserver_xorg-server.mk
index 3f6cda7..617bcbc 100644
--- a/package/x11r7/xserver_xorg-server/xserver_xorg-server.mk
+++ b/package/x11r7/xserver_xorg-server/xserver_xorg-server.mk
@@ -130,8 +130,7 @@ else # modular
XSERVER_XORG_SERVER_CONF_OPTS += --disable-kdrive --disable-xfbdev
endif
-# libdrm locking macros use armv6+ instructions on arm
-ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER)n$(BR2_ARM_CPU_ARMV4)$(BR2_ARM_CPU_ARMV5),yn)
+ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),y)
XSERVER_XORG_SERVER_CONF_OPTS += --enable-dri --enable-glx
XSERVER_XORG_SERVER_DEPENDENCIES += mesa3d xproto_xf86driproto
else
--
2.6.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 0/3] libdrm: ARMv4/ARMv5 compatibility fixes
2016-03-22 21:28 [Buildroot] [PATCH 0/3] libdrm: ARMv4/ARMv5 compatibility fixes Thomas Petazzoni
` (2 preceding siblings ...)
2016-03-22 21:29 ` [Buildroot] [PATCH 3/3] Revert "package/x11r7/xserver_xorg-server: dri needs arm >= v6" Thomas Petazzoni
@ 2016-03-26 17:54 ` Thomas Petazzoni
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-03-26 17:54 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 22 Mar 2016 22:28:58 +0100, Thomas Petazzoni wrote:
> libdrm: reformat patch 0001 with Git
> libdrm: adjust the ARM patch to work on ARMv4/ARMv5
> Revert "package/x11r7/xserver_xorg-server: dri needs arm >= v6"
I've applied those three patches.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-26 17:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 21:28 [Buildroot] [PATCH 0/3] libdrm: ARMv4/ARMv5 compatibility fixes Thomas Petazzoni
2016-03-22 21:28 ` [Buildroot] [PATCH 1/3] libdrm: reformat patch 0001 with Git Thomas Petazzoni
2016-03-22 21:29 ` [Buildroot] [PATCH 2/3] libdrm: adjust the ARM patch to work on ARMv4/ARMv5 Thomas Petazzoni
2016-03-22 21:29 ` [Buildroot] [PATCH 3/3] Revert "package/x11r7/xserver_xorg-server: dri needs arm >= v6" Thomas Petazzoni
2016-03-26 17:54 ` [Buildroot] [PATCH 0/3] libdrm: ARMv4/ARMv5 compatibility fixes Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox