Skip to contentSkip to conversation

Android support

PATCH In review Tapani Pälli 6 participants 14 messages Oct 8, 2012 – Oct 14, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

cover Android support

Upstreaming old set of patches here to enable Android support in libdrm. Some little rebasing was required for the first one.

Chad Versace (2):
libdrm,intel: Factor source file lists into sources.mk libdrm,intel: Add Android makefiles (v2)

Haitao Huang (1):
Android.mk: use LOCAL_COPY_HEADERS to export headers.

 Android.mk        | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Makefile.am       |  9 ++++----
 intel/Android.mk  | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++
 intel/Makefile.am |  9 ++++----
 intel/sources.mk  | 30 +++++++++++++++++++++++++++
 sources.mk        | 30 +++++++++++++++++++++++++++
 6 files changed, 187 insertions(+), 10 deletions(-)
 create mode 100644 Android.mk
 create mode 100644 intel/Android.mk
 create mode 100644 intel/sources.mk
 create mode 100644 sources.mk
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 1/3 libdrm,intel: Factor source file lists into sources.mk

From: Chad Versace <[email protected]>

Factor the source file list for libdrm.so from Makefile.am into sources.mk. Ditto for libdrm_intel.so.

This is in preparation for adding support for Android. The sources.mk's will be shared between autotools and Android.

Rationale: The most commonly changed parts of any makefile are the source lists. So, by sharing the lists between the two build systems, we can reduce the frequency at which modifications to the Linux build breaks the Android build.

---
 Makefile.am       |  9 ++++-----
 intel/Makefile.am |  9 ++++-----
 intel/sources.mk  | 30 ++++++++++++++++++++++++++++++
 sources.mk        | 30 ++++++++++++++++++++++++++++++
 4 files changed, 68 insertions(+), 10 deletions(-)
 create mode 100644 intel/sources.mk
 create mode 100644 sources.mk
Makefile.am +4 -5
index 8ecd9d9..b854703 100644
@@ -49,6 +49,9 @@ if HAVE_EXYNOS
 EXYNOS_SUBDIR = exynos
 endif
 
+# Import variable LIBDRM_SOURCES.
+include sources.mk
+
 SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(OMAP_SUBDIR) $(EXYNOS_SUBDIR) tests include man
 
 libdrm_la_LTLIBRARIES = libdrm.la
@@ -59,11 +62,7 @@ libdrm_la_LIBADD = @CLOCK_LIB@
 libdrm_la_CPPFLAGS = -I$(top_srcdir)/include/drm
 
 libdrm_la_SOURCES =				\
-	xf86drm.c				\
-	xf86drmHash.c				\
-	xf86drmRandom.c				\
-	xf86drmSL.c				\
-	xf86drmMode.c				\
+	$(LIBDRM_SOURCES)			\
 	xf86atomic.h				\
 	libdrm_lists.h
 
intel/Makefile.am +4 -5
index f49b099..e937c4b 100644
@@ -22,6 +22,9 @@
 # Authors:
 #    Eric Anholt <[email protected]>
 
+# Import variable LIBDRM_INTEL_SOURCES.
+include sources.mk
+
 AM_CFLAGS = \
 	$(WARN_CFLAGS) \
 	-I$(top_srcdir) \
@@ -40,13 +43,9 @@ libdrm_intel_la_LIBADD = ../libdrm.la \
 	@CLOCK_LIB@
 
 libdrm_intel_la_SOURCES = \
-	intel_bufmgr.c \
+	$(LIBDRM_INTEL_SOURCES) \
 	intel_bufmgr_priv.h \
-	intel_bufmgr_fake.c \
-	intel_bufmgr_gem.c \
-	intel_decode.c \
 	intel_chipset.h \
-	mm.c \
 	mm.h
 
 intel_bufmgr_gem_o_CFLAGS = $(AM_CFLAGS) -c99
intel/sources.mk new file +30 -0
new file mode 100644
index 0000000..2f6f744
@@ -0,0 +1,30 @@
+#
+# Copyright © 2012 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+
+# for libdrm_intel.so
+LIBDRM_INTEL_SOURCES := \
+	intel_bufmgr.c \
+	intel_bufmgr_fake.c \
+	intel_bufmgr_gem.c \
+	intel_decode.c \
+	mm.c
sources.mk new file +30 -0
new file mode 100644
index 0000000..19aa059
@@ -0,0 +1,30 @@
+#
+# Copyright © 2012 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+
+# for libdrm.so
+LIBDRM_SOURCES := \
+	xf86drm.c \
+	xf86drmHash.c \
+	xf86drmRandom.c \
+	xf86drmSL.c \
+	xf86drmMode.c
Signature · 6 lines
1.7.11.7

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] libdrm,intel: Factor source file lists into sources.mk

Quoted 8 lines · Tapani Pälli

From: Chad Versace <[email protected]>

Factor the source file list for libdrm.so from Makefile.am into sources.mk. Ditto for libdrm_intel.so.

This is in preparation for adding support for Android. The sources.mk's will be shared between autotools and Android.

Quoted 8 lines

Rationale: The most commonly changed parts of any makefile are the source lists. So, by sharing the lists between the two build systems, we can reduce the frequency at which modifications to the Linux build breaks the Android build.

Quoted 144 lines
---
 Makefile.am       |  9 ++++-----
 intel/Makefile.am |  9 ++++-----
 intel/sources.mk  | 30 ++++++++++++++++++++++++++++++
 sources.mk        | 30 ++++++++++++++++++++++++++++++
 4 files changed, 68 insertions(+), 10 deletions(-)
 create mode 100644 intel/sources.mk
 create mode 100644 sources.mk
Makefile.am +4 -5
index 8ecd9d9..b854703 100644
@@ -49,6 +49,9 @@ if HAVE_EXYNOS
 EXYNOS_SUBDIR = exynos
 endif
 
+# Import variable LIBDRM_SOURCES.
+include sources.mk
+
 SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(OMAP_SUBDIR) $(EXYNOS_SUBDIR) tests include man
 
 libdrm_la_LTLIBRARIES = libdrm.la
@@ -59,11 +62,7 @@ libdrm_la_LIBADD = @CLOCK_LIB@
 libdrm_la_CPPFLAGS = -I$(top_srcdir)/include/drm
 
 libdrm_la_SOURCES =				\
-	xf86drm.c				\
-	xf86drmHash.c				\
-	xf86drmRandom.c				\
-	xf86drmSL.c				\
-	xf86drmMode.c				\
+	$(LIBDRM_SOURCES)			\
 	xf86atomic.h				\
 	libdrm_lists.h
 
intel/Makefile.am +4 -5
index f49b099..e937c4b 100644
@@ -22,6 +22,9 @@
 # Authors:
 #    Eric Anholt <[email protected]>
 
+# Import variable LIBDRM_INTEL_SOURCES.
+include sources.mk
+
 AM_CFLAGS = \
 	$(WARN_CFLAGS) \
 	-I$(top_srcdir) \
@@ -40,13 +43,9 @@ libdrm_intel_la_LIBADD = ../libdrm.la \
 	@CLOCK_LIB@
 
 libdrm_intel_la_SOURCES = \
-	intel_bufmgr.c \
+	$(LIBDRM_INTEL_SOURCES) \
 	intel_bufmgr_priv.h \
-	intel_bufmgr_fake.c \
-	intel_bufmgr_gem.c \
-	intel_decode.c \
 	intel_chipset.h \
-	mm.c \
 	mm.h
 
 intel_bufmgr_gem_o_CFLAGS = $(AM_CFLAGS) -c99
intel/sources.mk new file +30 -0
new file mode 100644
index 0000000..2f6f744
@@ -0,0 +1,30 @@
+#
+# Copyright © 2012 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+
+# for libdrm_intel.so
+LIBDRM_INTEL_SOURCES := \
+	intel_bufmgr.c \
+	intel_bufmgr_fake.c \
+	intel_bufmgr_gem.c \
+	intel_decode.c \
+	mm.c
sources.mk new file +30 -0
new file mode 100644
index 0000000..19aa059
@@ -0,0 +1,30 @@
+#
+# Copyright © 2012 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+
+# for libdrm.so
+LIBDRM_SOURCES := \
+	xf86drm.c \
+	xf86drmHash.c \
+	xf86drmRandom.c \
+	xf86drmSL.c \
+	xf86drmMode.c
Signature · 6 lines
1.7.11.7

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 1 line
Oliver McFadden.
#3 lore raw

PATCH 2/3 libdrm,intel: Add Android makefiles (v2)

In reply to Tapani Pälli

From: Chad Versace <[email protected]>

This enables libdrm.so and libdrm_intel.so to build on Android IceCreamSandwich.

v2: Link libdrm_intel to libpciaccess.

---
 Android.mk       | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
 intel/Android.mk | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+)
 create mode 100644 Android.mk
 create mode 100644 intel/Android.mk
Android.mk new file +52 -0
new file mode 100644
index 0000000..1029dc6
@@ -0,0 +1,52 @@
+#
+# Copyright © 2011 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+
+LIBDRM_VALID_GPU_DRIVERS := i915 i965
+
+# Skip this makefile if we're not building for a known GPU.
+ifneq ($(filter $(BOARD_GPU_DRIVERS), $(LIBDRM_VALID_GPU_DRIVERS)),)
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LIBDRM_TOP := $(LOCAL_PATH)
+
+# Import variable LIBDRM_SOURCES.
+include $(LOCAL_PATH)/sources.mk
+
+LOCAL_MODULE := libdrm
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(LIBDRM_SOURCES)
+
+LOCAL_C_INCLUDES := \
+	$(LIBDRM_TOP)/include/drm
+
+LOCAL_CFLAGS := \
+	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+
+include $(BUILD_SHARED_LIBRARY)
+
+include $(LOCAL_PATH)/intel/Android.mk
+
+endif # BOARD_GPU_DRIVERS
intel/Android.mk new file +57 -0

57 lines not on this page · raw message

Signature · 6 lines
1.7.11.7

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] libdrm,intel: Add Android makefiles (v2)

Quoted 8 lines · Tapani Pälli

From: Chad Versace <[email protected]>

This enables libdrm.so and libdrm_intel.so to build on Android IceCreamSandwich.

v2: Link libdrm_intel to libpciaccess.

Quoted 135 lines
---
 Android.mk       | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
 intel/Android.mk | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+)
 create mode 100644 Android.mk
 create mode 100644 intel/Android.mk
Android.mk new file +52 -0
new file mode 100644
index 0000000..1029dc6
@@ -0,0 +1,52 @@
+#
+# Copyright © 2011 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+
+LIBDRM_VALID_GPU_DRIVERS := i915 i965
+
+# Skip this makefile if we're not building for a known GPU.
+ifneq ($(filter $(BOARD_GPU_DRIVERS), $(LIBDRM_VALID_GPU_DRIVERS)),)
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LIBDRM_TOP := $(LOCAL_PATH)
+
+# Import variable LIBDRM_SOURCES.
+include $(LOCAL_PATH)/sources.mk
+
+LOCAL_MODULE := libdrm
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(LIBDRM_SOURCES)
+
+LOCAL_C_INCLUDES := \
+	$(LIBDRM_TOP)/include/drm
+
+LOCAL_CFLAGS := \
+	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+
+include $(BUILD_SHARED_LIBRARY)
+
+include $(LOCAL_PATH)/intel/Android.mk
+
+endif # BOARD_GPU_DRIVERS
intel/Android.mk new file +57 -0
new file mode 100644
index 0000000..3647a14
@@ -0,0 +1,57 @@
+#
+# Copyright © 2011 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+
+LIBDRM_INTEL_VALID_GPU_DRIVERS := i915 i965
+
+# Skip this makefile if we're not building for an Intel GPU.
+ifneq ($(filter $(BOARD_GPU_DRIVERS), $(LIBDRM_INTEL_VALID_GPU_DRIVERS)),)
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+# Import variable LIBDRM_INTEL_SOURCES.
+include $(LOCAL_PATH)/sources.mk
+
+LOCAL_MODULE := libdrm_intel
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libdrm
+
+LOCAL_SRC_FILES := $(LIBDRM_INTEL_SOURCES)
+
+LOCAL_C_INCLUDES := \
+	$(LIBDRM_TOP) \
+	$(LIBDRM_TOP)/intel \
+	$(LIBDRM_TOP)/include/drm \
+	external/libpciaccess/include
+
+LOCAL_CFLAGS := \
+	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+
+LOCAL_SHARED_LIBRARIES := \
+	libdrm \
+	libpciaccess
+
+include $(BUILD_SHARED_LIBRARY)
+
+endif # BOARD_GPU_DRIVERS
Signature · 6 lines
1.7.11.7

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 1 line
Oliver McFadden.
#5 lore raw

PATCH 3/3 Android.mk: use LOCAL_COPY_HEADERS to export headers.

In reply to Tapani Pälli

From: Haitao Huang <[email protected]>

Export necessary header files used by other components for Android, such as libva intel-driver, gralloc, hwcomposer, etc.

Change-Id I2feabf6941379ef4d756e942f30eba059de641f1
[chad: Fixed inconsistent indentation.]
---
 Android.mk | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Android.mk +11 -1
index 1029dc6..68db5df 100644
@@ -1,5 +1,5 @@
 #
-# Copyright © 2011 Intel Corporation
+# Copyright © 2011-2012 Intel Corporation
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -45,6 +45,16 @@ LOCAL_C_INCLUDES := \
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
+LOCAL_COPY_HEADERS :=            \
+	xf86drm.h                \
+	include/drm/drm_fourcc.h \
+	include/drm/drm.h        \
+	include/drm/drm_mode.h   \
+	include/drm/drm_sarea.h  \
+	include/drm/i915_drm.h   \
+	intel/intel_bufmgr.h     \
+
+LOCAL_COPY_HEADERS_TO := libdrm
 include $(BUILD_SHARED_LIBRARY)
 
 include $(LOCAL_PATH)/intel/Android.mk
Signature · 6 lines
1.7.11.7

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] Android.mk: use LOCAL_COPY_HEADERS to export headers.

Quoted 10 lines · Tapani Pälli

From: Haitao Huang <[email protected]>

Export necessary header files used by other components for Android, such as libva intel-driver, gralloc, hwcomposer, etc.

Change-Id I2feabf6941379ef4d756e942f30eba059de641f1
[chad: Fixed inconsistent indentation.]

---

Please put "[chad: Fixed inconsistent indentation.]" after the triple-dash, so that it will not be immortalized into the Git history. Otherwise, looks fine, does what it says on the box.

Quoted 38 lines
 Android.mk | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Android.mk +11 -1
index 1029dc6..68db5df 100644
@@ -1,5 +1,5 @@
 #
-# Copyright © 2011 Intel Corporation
+# Copyright © 2011-2012 Intel Corporation
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -45,6 +45,16 @@ LOCAL_C_INCLUDES := \
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
+LOCAL_COPY_HEADERS :=            \
+	xf86drm.h                \
+	include/drm/drm_fourcc.h \
+	include/drm/drm.h        \
+	include/drm/drm_mode.h   \
+	include/drm/drm_sarea.h  \
+	include/drm/i915_drm.h   \
+	intel/intel_bufmgr.h     \
+
+LOCAL_COPY_HEADERS_TO := libdrm
 include $(BUILD_SHARED_LIBRARY)
 
 include $(LOCAL_PATH)/intel/Android.mk
Signature · 6 lines
1.7.11.7

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 1 line
Oliver McFadden.
#7 lore raw
In reply to Tapani Pälli
Quoted 6 lines · Tapani Pälli

Upstreaming old set of patches here to enable Android support in libdrm. Some little rebasing was required for the first one.

Chad Versace (2):
libdrm,intel: Factor source file lists into sources.mk libdrm,intel: Add Android makefiles (v2)

Couldn't this just be done with androgenizer without making a maintenance mess in the upstream code?

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw
Quoted 5 lines · Eric Anholt
Quoted 3 lines · Tapani Pälli

Upstreaming old set of patches here to enable Android support in libdrm. Some little rebasing was required for the first one.

Quoted 7 lines
Quoted 3 lines

Chad Versace (2):
libdrm,intel: Factor source file lists into sources.mk libdrm,intel: Add Android makefiles (v2)

Couldn't this just be done with androgenizer without making a maintenance mess in the upstream code?

We do not have androgenizer tool in our Android tree but I will check if it can successfully compile libdrm and if we would be able to use it.

My main goal here is to get setup where we could use libdrm master as it is without patching it, we have some additional patches on top of these too but I want to make myself more familiar with those before sending them.

Thanks;

Signature · 1 line
// Tapani

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw
In reply to Tapani Pälli
Quoted 10 lines · Tapani Pälli

Upstreaming old set of patches here to enable Android support in libdrm. Some little rebasing was required for the first one.

Chad Versace (2):
libdrm,intel: Factor source file lists into sources.mk libdrm,intel: Add Android makefiles (v2)

Haitao Huang (1):
Android.mk: use LOCAL_COPY_HEADERS to export headers.

Quoted 6 lines
 Android.mk        | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Makefile.am       |  9 ++++----
 intel/Android.mk  | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++
 intel/Makefile.am |  9 ++++----
 intel/sources.mk  | 30 +++++++++++++++++++++++++++
 sources.mk        | 30 +++++++++++++++++++++++++++

This series looks good to me. Before committing, though, I'd like to see either an Acked-by or an "Sure, whatever" from one of the regular libdrm_intel committers.

-Chad

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw
Quoted 18 lines · Chad Versace
Quoted 10 lines · Tapani Pälli

Upstreaming old set of patches here to enable Android support in libdrm. Some little rebasing was required for the first one.

Chad Versace (2):
libdrm,intel: Factor source file lists into sources.mk libdrm,intel: Add Android makefiles (v2)

Haitao Huang (1):
Android.mk: use LOCAL_COPY_HEADERS to export headers.

Quoted 6 lines
 Android.mk        | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Makefile.am       |  9 ++++----
 intel/Android.mk  | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++
 intel/Makefile.am |  9 ++++----
 intel/sources.mk  | 30 +++++++++++++++++++++++++++
 sources.mk        | 30 +++++++++++++++++++++++++++
Quoted 2 lines

This series looks good to me. Before committing, though, I'd like to see either an Acked-by or an "Sure, whatever" from one of the regular libdrm_intel committers.

Thanks for checking it out. I've tried out androgenizer as Eric suggested but not really convinced we would like to start using it.

Quoted 2 lines

-Chad

Signature · 1 line
// Tapani

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw
Quoted 19 lines · Tapani Pälli
Quoted 18 lines · Chad Versace
Quoted 16 lines · Tapani Pälli

Upstreaming old set of patches here to enable Android support in libdrm. Some little rebasing was required for the first one.

Chad Versace (2):
libdrm,intel: Factor source file lists into sources.mk libdrm,intel: Add Android makefiles (v2)

Haitao Huang (1):
Android.mk: use LOCAL_COPY_HEADERS to export headers.

 Android.mk        | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Makefile.am       |  9 ++++----
 intel/Android.mk  | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++
 intel/Makefile.am |  9 ++++----
 intel/sources.mk  | 30 +++++++++++++++++++++++++++
 sources.mk        | 30 +++++++++++++++++++++++++++
Quoted 5 lines
Quoted 2 lines

This series looks good to me. Before committing, though, I'd like to see either an Acked-by or an "Sure, whatever" from one of the regular libdrm_intel committers.

Thanks for checking it out. I've tried out androgenizer as Eric suggested but not really convinced we would like to start using it.

To bring an pro-argument for Tapani, this is how it looks to make it work with androgenizer.
As you can see, it's not much different from the Android.mk itself, only the variable names changes.

Makefile.am +20 -0
index 273abf9..b200509 100644
@@ -77,3 +77,23 @@ copy-headers :
 commit-headers : copy-headers
        git add include
        git commit -am "Copy headers from kernel $$(GIT_DIR=$(kernel_source)/.gi
+
+Android.mk: Makefile.am
+               androgenizer \
+               -:PROJECT testlib \
+               -:REL_TOP $(top_srcdir) \
+               -:ABS_TOP $(abs_top_srcdir) \
+               -:SHARED libdrm \
+               -:SOURCES $(LIBDRM_SOURCES) \
+               -:LDFLAGS $(libdrm_la_LDFLAGS) \
+               -:CPPFLAGS $(libdrm_la_CPPFLAGS) \
+               -:TAGS optional\
+               -:HEADERS xf86drm.h          \
+                       include/drm/drm_fourcc.h \
+                       include/drm/drm.h        \
+                       include/drm/drm_mode.h   \
+                       include/drm/drm_sarea.h  \
+                       include/drm/i915_drm.h   \
+                       intel/intel_bufmgr.h     \
+               -:HEADER_TARGET libdrm \
+               > $@
Signature · 6 lines
Regards!
http://groleo.wordpress.com
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#12 lore raw
Quoted 23 lines · Negreanu Marius
Quoted 22 lines · Tapani Pälli
Quoted 20 lines · Chad Versace
Quoted 10 lines · Tapani Pälli

Upstreaming old set of patches here to enable Android support in libdrm. Some little rebasing was required for the first one.

Chad Versace (2):
libdrm,intel: Factor source file lists into sources.mk libdrm,intel: Add Android makefiles (v2)

Haitao Huang (1):
Android.mk: use LOCAL_COPY_HEADERS to export headers.

Quoted 6 lines
 Android.mk        | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Makefile.am       |  9 ++++----
 intel/Android.mk  | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++
 intel/Makefile.am |  9 ++++----
 intel/sources.mk  | 30 +++++++++++++++++++++++++++
 sources.mk        | 30 +++++++++++++++++++++++++++

This series looks good to me. Before committing, though, I'd like to see either an Acked-by or an "Sure, whatever" from one of the regular libdrm_intel committers.

Quoted 7 lines
Quoted 2 lines

Thanks for checking it out. I've tried out androgenizer as Eric suggested but not really convinced we would like to start using it.

To bring an pro-argument for Tapani, this is how it looks to make it work with androgenizer.
As you can see, it's not much different from the Android.mk itself, only the variable names changes.

If this is all there is to using androgenizer, I suspect it will stay working for longer than the custom Android.mks. Our experience in Mesa has been that basically any time anybody touches the build system for anything but a file addition, android gets broken. By using androgenizer, hopefully we rely on a tool that reflects the upstream build system better in android, and maybe over time that tool can be improved so that android building of upstream projects is less of a burden (seriously, why should you have to manually name the sources and flags variables?).

That said, doesn't the use of _SOURCES in the LIBDRM_SOURCES variable result in complaints from automake?

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw
Quoted 33 lines · On Fri, 12 Oct 2012 15:27:27 -0700 Eric Anholt <[email protected]> wrote:
Quoted 23 lines · Negreanu Marius
Quoted 22 lines · Tapani Pälli
Quoted 20 lines · Chad Versace
Quoted 10 lines · Tapani Pälli

Upstreaming old set of patches here to enable Android support in libdrm. Some little rebasing was required for the first one.

Chad Versace (2):
libdrm,intel: Factor source file lists into sources.mk libdrm,intel: Add Android makefiles (v2)

Haitao Huang (1):
Android.mk: use LOCAL_COPY_HEADERS to export headers.

Quoted 6 lines
 Android.mk        | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Makefile.am       |  9 ++++----
 intel/Android.mk  | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++
 intel/Makefile.am |  9 ++++----
 intel/sources.mk  | 30 +++++++++++++++++++++++++++
 sources.mk        | 30 +++++++++++++++++++++++++++

This series looks good to me. Before committing, though, I'd like to see either an Acked-by or an "Sure, whatever" from one of the regular libdrm_intel committers.

Quoted 7 lines
Quoted 2 lines

Thanks for checking it out. I've tried out androgenizer as Eric suggested but not really convinced we would like to start using it.

To bring an pro-argument for Tapani, this is how it looks to make it work with androgenizer.
As you can see, it's not much different from the Android.mk itself, only the variable names changes.

Quoted 9 lines

If this is all there is to using androgenizer, I suspect it will stay working for longer than the custom Android.mks. Our experience in Mesa has been that basically any time anybody touches the build system for anything but a file addition, android gets broken. By using androgenizer, hopefully we rely on a tool that reflects the upstream build system better in android, and maybe over time that tool can be improved so that android building of upstream projects is less of a burden (seriously, why should you have to manually name the sources and flags variables?).

Some of the benefits of androgenizer are, that it filters the contents of the automake variables you pass to it, so you don't have to manually write only slightly different things in Android-specific files. As you saw, some Android specific code is still needed in the build system:

- to pass the automake variables to androgenizer, which cannot parse automake files itself. This way we let GNU Make parse the automake files, and androgenizer gets the final values.

- a top-level hand-written Android.mk that will execute ./configure and everything related, and cause the androgenizer-generated Android.mk files to be created. We have managed to create such makefiles, that these steps get executed automatically as needed during the full Android system build. Whenever new makefiles are being generated, GNU Make notices that, and automatically restarts the whole build to read them in. (This is not about androgenizer but Android builds in general.)

Androgenizer also fixes up all the file paths to be relative to the Android build root dir, so you don't have to mess with generating file lists with different path prefixes for automake vs. Android builds.

Or at least that is what androgenizer should do, it may have bugs of course. Androgenizer is no magic tool that automatically makes an autotools project building for Android, but it should help with the most common pains.

I have some patches in Androgenizer, and I have androgenized few projects for Collabora. I'd be happy to answer questions about androgenizer. Please, use my work email (cc'd): [email protected]

Thanks,
pq