Hello all,
It's time for another Android fueled round of fixes. Mostly trivial and self explanatory patches enough to get things building (rather quietly) on Android 5, x86_64
The series can be found at in branch for-android at https://github.com/evelikov/libdrm/
Cheers, Emil
freedreno/Android.mk | 3 --- intel/Android.mk | 1 - libdrm.h | 2 +- nouveau/Android.mk | 3 --- radeon/Android.mk | 3 --- tests/modetest/Makefile.am | 6 +++--- tests/util/Makefile.am | 13 +++++++------ xf86drm.c | 4 ++-- 8 files changed, 13 insertions(+), 22 deletions(-)
Chih-Wei Huang (1): android: remove duplicate libdrm in LOCAL_SHARED_LIBRARIES
Emil Velikov (5): util: add WARN_CFLAGS, rename the c*flags vars modetest: move includes into AM_CPPFLAGS libdrm: fix the Android 64bit build drmOpenDevice: silence compiler warning drmGetStats: silence compiler warning
Signed-off-by: Emil Velikov emil.l.velikov@gmail.com --- tests/util/Makefile.am | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/tests/util/Makefile.am b/tests/util/Makefile.am index f8e0b17..aaaf932 100644 --- a/tests/util/Makefile.am +++ b/tests/util/Makefile.am @@ -1,13 +1,14 @@ include Makefile.sources
-noinst_LTLIBRARIES = \ - libutil.la - -libutil_la_CPPFLAGS = \ +AM_CPPFLAGS = \ -I$(top_srcdir)/include/drm \ -I$(top_srcdir)
-libutil_la_CFLAGS = \ - $(CAIRO_CFLAGS) +AM_CFLAGS = \ + $(CAIRO_CFLAGS) \ + $(WARN_CFLAGS) + +noinst_LTLIBRARIES = \ + libutil.la
libutil_la_SOURCES = $(UTIL_FILES)
Signed-off-by: Emil Velikov emil.l.velikov@gmail.com --- tests/modetest/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/modetest/Makefile.am b/tests/modetest/Makefile.am index 40dad3e..a8b9a3a 100644 --- a/tests/modetest/Makefile.am +++ b/tests/modetest/Makefile.am @@ -1,12 +1,12 @@ include Makefile.sources
-AM_CFLAGS = $(filter-out -Wpointer-arith, $(WARN_CFLAGS)) - -AM_CFLAGS += \ +AM_CPPFLAGS = \ -I$(top_srcdir)/include/drm \ -I$(top_srcdir)/tests \ -I$(top_srcdir)
+AM_CFLAGS = $(filter-out -Wpointer-arith, $(WARN_CFLAGS)) + if HAVE_INSTALL_TESTS bin_PROGRAMS = \ modetest
With 64bit bionic mmap now handles 64bit offset, thus we no longer need the __mmap2 trick.
Fix from Chih-Wei Huang, over at the google forums.
Cc: Chih-Wei Huang cwhuang@android-x86.org Signed-off-by: Emil Velikov emil.l.velikov@gmail.com --- libdrm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdrm.h b/libdrm.h index acfada5..6c3cd59 100644 --- a/libdrm.h +++ b/libdrm.h @@ -45,7 +45,7 @@
#include <sys/mman.h>
-#if defined(ANDROID) +#if defined(ANDROID) && !defined(__LP64__) #include <errno.h> /* for EINVAL */
extern void *__mmap2(void *, size_t, int, int, int, size_t);
On Thu, Jan 29, 2015 at 10:47 AM, Emil Velikov emil.l.velikov@gmail.com wrote:
With 64bit bionic mmap now handles 64bit offset, thus we no longer need the __mmap2 trick.
Fix from Chih-Wei Huang, over at the google forums.
Cc: Chih-Wei Huang cwhuang@android-x86.org Signed-off-by: Emil Velikov emil.l.velikov@gmail.com
libdrm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdrm.h b/libdrm.h index acfada5..6c3cd59 100644 --- a/libdrm.h +++ b/libdrm.h @@ -45,7 +45,7 @@
#include <sys/mman.h>
-#if defined(ANDROID) +#if defined(ANDROID) && !defined(__LP64__) #include <errno.h> /* for EINVAL */
extern void *__mmap2(void *, size_t, int, int, int, size_t);
It seems like you're be better off just using mmap64 instead of __mpap2?
Stéphane
On 29/01/15 19:00, Stéphane Marchesin wrote:
On Thu, Jan 29, 2015 at 10:47 AM, Emil Velikov emil.l.velikov@gmail.com wrote:
With 64bit bionic mmap now handles 64bit offset, thus we no longer need the __mmap2 trick.
Fix from Chih-Wei Huang, over at the google forums.
Cc: Chih-Wei Huang cwhuang@android-x86.org Signed-off-by: Emil Velikov emil.l.velikov@gmail.com
libdrm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdrm.h b/libdrm.h index acfada5..6c3cd59 100644 --- a/libdrm.h +++ b/libdrm.h @@ -45,7 +45,7 @@
#include <sys/mman.h>
-#if defined(ANDROID) +#if defined(ANDROID) && !defined(__LP64__) #include <errno.h> /* for EINVAL */
extern void *__mmap2(void *, size_t, int, int, int, size_t);
It seems like you're be better off just using mmap64 instead of __mpap2?
I was thinking about that but decided against it due to:
- For 64bit platforms - mmap64 maps directly to mmap [1].
- For other platforms (kitkat at least) mmap64 does a costly (according to the man page) syscall (don't recall the name).
- Some systems may be lacking mmap64.
Quite a noobie on the topic so I might be completely wrong :)
Thanks Emil
[1] https://android.googlesource.com/platform/bionic.git/+/38fcbbb35a40c46e96b4d...
Under 64bit Android the compiler throws a -Wsign-compare warning. Typecast the variable dev to silence the build.
Signed-off-by: Emil Velikov emil.l.velikov@gmail.com --- xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xf86drm.c b/xf86drm.c index 345325a..b41c1d8 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -394,7 +394,7 @@ wait_for_udev: /* Check if the device node is not what we expect it to be, and recreate it * and try again if so. */ - if (st.st_rdev != dev) { + if (st.st_rdev != (dev_t)dev) { if (!isroot) return DRM_ERR_NOT_ROOT; remove(buf);
drm_stats_t::count is of type unsigned long, while i is an int. Make the latter an unsigned int. Spotted as -Wsign-compare warning while building under Android 5.
Signed-off-by: Emil Velikov emil.l.velikov@gmail.com --- xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xf86drm.c b/xf86drm.c index b41c1d8..cc79ab6 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -2213,7 +2213,7 @@ int drmGetClient(int fd, int idx, int *auth, int *pid, int *uid, int drmGetStats(int fd, drmStatsT *stats) { drm_stats_t s; - int i; + unsigned int i;
if (drmIoctl(fd, DRM_IOCTL_GET_STATS, &s)) return -errno;
From: Chih-Wei Huang cwhuang@linux.org.tw
Signed-off-by: Chih-Wei Huang cwhuang@linux.org.tw --- freedreno/Android.mk | 3 --- intel/Android.mk | 1 - nouveau/Android.mk | 3 --- radeon/Android.mk | 3 --- 4 files changed, 10 deletions(-)
diff --git a/freedreno/Android.mk b/freedreno/Android.mk index 243a1e2..22520fb 100644 --- a/freedreno/Android.mk +++ b/freedreno/Android.mk @@ -24,7 +24,4 @@ LOCAL_CFLAGS := \ LOCAL_COPY_HEADERS := $(LIBDRM_FREEDRENO_H_FILES) LOCAL_COPY_HEADERS_TO := freedreno
-LOCAL_SHARED_LIBRARIES := \ - libdrm - include $(BUILD_SHARED_LIBRARY) diff --git a/intel/Android.mk b/intel/Android.mk index f2f21b9..bf6e822 100644 --- a/intel/Android.mk +++ b/intel/Android.mk @@ -49,7 +49,6 @@ LOCAL_COPY_HEADERS := $(LIBDRM_INTEL_H_FILES) LOCAL_COPY_HEADERS_TO := libdrm
LOCAL_SHARED_LIBRARIES := \ - libdrm \ libpciaccess
include $(BUILD_SHARED_LIBRARY) diff --git a/nouveau/Android.mk b/nouveau/Android.mk index 734fc21..93c9ec2 100644 --- a/nouveau/Android.mk +++ b/nouveau/Android.mk @@ -24,7 +24,4 @@ LOCAL_CFLAGS := \ LOCAL_COPY_HEADERS := $(LIBDRM_NOUVEAU_H_FILES) LOCAL_COPY_HEADERS_TO := libdrm
-LOCAL_SHARED_LIBRARIES := \ - libdrm - include $(BUILD_SHARED_LIBRARY) diff --git a/radeon/Android.mk b/radeon/Android.mk index 9cba546..71c58bd 100644 --- a/radeon/Android.mk +++ b/radeon/Android.mk @@ -24,7 +24,4 @@ LOCAL_CFLAGS := \ LOCAL_COPY_HEADERS := $(LIBDRM_RADEON_H_FILES) LOCAL_COPY_HEADERS_TO := libdrm
-LOCAL_SHARED_LIBRARIES := \ - libdrm - include $(BUILD_SHARED_LIBRARY)
Required by strcmp, otherwise we'll error out of the build with the following commit.
Signed-off-by: Emil Velikov emil.l.velikov@gmail.com --- tests/util/format.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/tests/util/format.c b/tests/util/format.c index c365ceb..52b3f97 100644 --- a/tests/util/format.c +++ b/tests/util/format.c @@ -29,6 +29,7 @@
#include <stdint.h> #include <stdlib.h> +#include <string.h>
#include <drm_fourcc.h>
Signed-off-by: Emil Velikov emil.l.velikov@gmail.com --- tests/util/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/util/Makefile.am b/tests/util/Makefile.am index aaaf932..1d71c40 100644 --- a/tests/util/Makefile.am +++ b/tests/util/Makefile.am @@ -6,7 +6,8 @@ AM_CPPFLAGS = \
AM_CFLAGS = \ $(CAIRO_CFLAGS) \ - $(WARN_CFLAGS) + $(filter-out -Wpointer-arith, $(WARN_CFLAGS)) +
noinst_LTLIBRARIES = \ libutil.la
Grr... git send-email did not keep the fix of the patches :\
This one should be "PATCH 0.1/6" while "util: silence pointer arithmetic warnings" - "PATCH 1.1/6".
Cheers, Emil
On 06/02/15 19:42, Emil Velikov wrote:
Required by strcmp, otherwise we'll error out of the build with the following commit.
Signed-off-by: Emil Velikov emil.l.velikov@gmail.com
tests/util/format.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/tests/util/format.c b/tests/util/format.c index c365ceb..52b3f97 100644 --- a/tests/util/format.c +++ b/tests/util/format.c @@ -29,6 +29,7 @@
#include <stdint.h> #include <stdlib.h> +#include <string.h>
#include <drm_fourcc.h>
dri-devel@lists.freedesktop.org