Skip to contentSkip to conversation

libdrm: Convert to Android.mk to Android.bp

RFC PATCH In review John Stultz 3 participants 4 messages Sep 17, 2019 – Sep 18, 2019

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 libdrm: Convert to Android.mk to Android.bp

This patch removes the deprecated Android.mk files and replaces them with Android.bp files.

This is needed in order to build libdrm/master against recent Android releases and AOSP/master, as some of the Treble build options required since Android O cannot be expressed in Andorid.mk files.

Patch originally by Dan Willemsen with fixes folded in by:
Jerry Zhang, Eliott Hughes and myself.

With this change, the only patches carried by Android for libdrm would be the gerrit OWNERS meta-data file.

Cc Mauro Rossi <[email protected]>
Cc Chih-Wei Huang <[email protected]>
Cc Robert Foss <[email protected]>
Cc Tapani Pälli <[email protected]>
Cc Chih-Wei Huang <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Sean Paul <[email protected]>
Cc Rob Clark <[email protected]>
Cc Eric Anholt <[email protected]>
Cc Jiyong Park <[email protected]>
Cc Alistair Strachan <[email protected]>
Cc Dan Willemsen <[email protected]>
Cc Sumit Semwal <[email protected]>
Cc Vishal Bhoj <[email protected]>

---
I know last time this was proposed, there was some concern about maintaining support for old AOSP releases - and while we could still support both with Android.mk that was a fair concern.

However, now that it is a requirement for newer releases, I'd contend that being able to build/test libdrm/master against AOSP/master and recent releases is more valuable then soley maintaining support for old and unsupported Android releases.

So I wanted to submit this again for discussion.

thanks
-john

---
 Android.bp                        | 66 +++++++++++++++++++++++++++
 Android.common.mk                 | 19 --------
 Android.mk                        | 74 -------------------------------
 Android.sources.bp                | 12 +++++
 Android.sources.bp.mk             | 25 +++++++++++
 amdgpu/Android.bp                 | 16 +++++++
 amdgpu/Android.mk                 | 19 --------
 amdgpu/Android.sources.bp         | 15 +++++++
 data/Android.bp                   |  6 +++
 data/Android.mk                   | 10 -----
 etnaviv/Android.bp                | 11 +++++
 etnaviv/Android.mk                | 14 ------
 etnaviv/Android.sources.bp        | 13 ++++++
 freedreno/Android.bp              | 11 +++++
 freedreno/Android.mk              | 14 ------
 freedreno/Android.sources.bp      | 16 +++++++
 intel/Android.bp                  | 36 +++++++++++++++
 intel/Android.mk                  | 38 ----------------
 intel/Android.sources.bp          | 13 ++++++
 libkms/Android.bp                 | 15 +++++++
 libkms/Android.mk                 | 51 ---------------------
 libkms/Android.sources.bp         | 38 ++++++++++++++++
 nouveau/Android.bp                | 11 +++++
 nouveau/Android.mk                | 14 ------
 nouveau/Android.sources.bp        | 11 +++++
 omap/Android.bp                   | 12 +++++
 omap/Android.mk                   | 13 ------
 omap/Android.sources.bp           |  8 ++++
 radeon/Android.bp                 | 11 +++++
 radeon/Android.mk                 | 14 ------
 radeon/Android.sources.bp         | 13 ++++++
 tegra/Android.bp                  | 14 ++++++
 tests/Android.bp                  |  6 +++
 tests/Android.mk                  |  1 -
 tests/modetest/Android.bp         | 12 +++++
 tests/modetest/Android.mk         | 14 ------
 tests/modetest/Android.sources.bp | 10 +++++
 tests/proptest/Android.bp         |  8 ++++
 tests/proptest/Android.mk         | 14 ------
 tests/util/Android.bp             | 35 +++++++++++++++
 tests/util/Android.mk             | 38 ----------------
 tests/util/Android.sources.bp     | 10 +++++
 42 files changed, 454 insertions(+), 347 deletions(-)
 create mode 100644 Android.bp
 delete mode 100644 Android.common.mk
 delete mode 100644 Android.mk
 create mode 100644 Android.sources.bp
 create mode 100644 Android.sources.bp.mk
 create mode 100644 amdgpu/Android.bp
 delete mode 100644 amdgpu/Android.mk
 create mode 100644 amdgpu/Android.sources.bp
 create mode 100644 data/Android.bp
 delete mode 100644 data/Android.mk
 create mode 100644 etnaviv/Android.bp
 delete mode 100644 etnaviv/Android.mk
 create mode 100644 etnaviv/Android.sources.bp
 create mode 100644 freedreno/Android.bp
 delete mode 100644 freedreno/Android.mk
 create mode 100644 freedreno/Android.sources.bp
 create mode 100644 intel/Android.bp
 delete mode 100644 intel/Android.mk
 create mode 100644 intel/Android.sources.bp
 create mode 100644 libkms/Android.bp
 delete mode 100644 libkms/Android.mk
 create mode 100644 libkms/Android.sources.bp
 create mode 100644 nouveau/Android.bp
 delete mode 100644 nouveau/Android.mk
 create mode 100644 nouveau/Android.sources.bp
 create mode 100644 omap/Android.bp
 delete mode 100644 omap/Android.mk
 create mode 100644 omap/Android.sources.bp
 create mode 100644 radeon/Android.bp
 delete mode 100644 radeon/Android.mk
 create mode 100644 radeon/Android.sources.bp
 create mode 100644 tegra/Android.bp
 create mode 100644 tests/Android.bp
 delete mode 100644 tests/Android.mk
 create mode 100644 tests/modetest/Android.bp
 delete mode 100644 tests/modetest/Android.mk
 create mode 100644 tests/modetest/Android.sources.bp
 create mode 100644 tests/proptest/Android.bp
 delete mode 100644 tests/proptest/Android.mk
 create mode 100644 tests/util/Android.bp
 delete mode 100644 tests/util/Android.mk
 create mode 100644 tests/util/Android.sources.bp
Android.bp new file +66 -0
new file mode 100644
index 00000000..6fe434c6
@@ -0,0 +1,66 @@
+//
+// 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"),
+// 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.
+//
+
+subdirs = ["*"]
+build = ["Android.sources.bp"]
+
+cc_defaults {
+    name: "libdrm_defaults",
+    cflags: [
+        // XXX: Consider moving these to config.h analogous to autoconf.
+        "-DMAJOR_IN_SYSMACROS=1",
+        "-DHAVE_VISIBILITY=1",
+        "-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1",
+
+        "-Wall",
+        "-Werror",
+        "-Wno-deprecated-declarations",
+        "-Wno-format",
+        "-Wno-gnu-variable-sized-type-not-at-end",
+        "-Wno-pointer-arith",
+        "-Wno-unused-parameter",
+        "-Wno-unused-variable",
+        "-Wno-missing-field-initializers",
+    ],
+    export_include_dirs: ["."],
+}
+
+// Library for the device
+cc_library {
+    name: "libdrm",
+    recovery_available: true,
+    vendor_available: true,
+    defaults: [
+        "libdrm_defaults",
+        "libdrm_sources",
+    ],
+
+    export_include_dirs: ["include/drm", "android"],
+
+    cflags: [
+        "-Wno-enum-conversion",
+        "-Wno-pointer-arith",
+        "-Wno-sign-compare",
+        "-Wno-tautological-compare",
+    ],
+}
Android.common.mk deleted +0 -19
deleted file mode 100644
index d0e5d559..00000000
@@ -1,19 +0,0 @@
-# XXX: Consider moving these to config.h analogous to autoconf.
-LOCAL_CFLAGS += \
-	-DMAJOR_IN_SYSMACROS=1 \
-	-DHAVE_VISIBILITY=1 \
-	-fvisibility=hidden \
-	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
-
-LOCAL_CFLAGS += \
-	-Wno-error \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-Wno-pointer-arith \
-	-Wno-enum-conversion
-
-# Quiet down the build system and remove any .h files from the sources
-LOCAL_SRC_FILES := $(patsubst %.h, , $(LOCAL_SRC_FILES))
-LOCAL_EXPORT_C_INCLUDE_DIRS += $(LOCAL_PATH)
-
-LOCAL_PROPRIETARY_MODULE := true
Android.mk deleted +0 -74

74 lines not on this page · raw message

Android.sources.bp new file +12 -0
new file mode 100644
index 00000000..73356dd8
@@ -0,0 +1,12 @@
+// Autogenerated with Android.sources.bp.mk
+
+cc_defaults {
+    name: "libdrm_sources",
+    srcs: [
+        "xf86drm.c",
+        "xf86drmHash.c",
+        "xf86drmRandom.c",
+        "xf86drmSL.c",
+        "xf86drmMode.c",
+    ],
+}
Android.sources.bp.mk new file +25 -0
new file mode 100644
index 00000000..26b61c1e
@@ -0,0 +1,25 @@
+# Usage: make -f path/to/Android.sources.bp.mk NAMES=<> >Android.sources.bp
+#
+# It will read the Makefile.sources in the current directory, and
+# write <NAME>_FILES to stdout as an Android.bp cc_defaults module.
+
+.PHONY: all
+all:
+	@# Do nothing
+
+include Makefile.sources
+
+empty :=
+indent := $(empty)    $(empty)
+
+$(info // Autogenerated with Android.sources.bp.mk)
+$(foreach NAME,$(NAMES), \
+  $(eval lower_name := $(shell echo $(PREFIX)$(NAME) | tr 'A-Z' 'a-z')) \
+  $(info ) \
+  $(info cc_defaults {) \
+  $(info $(indent)name: "$(lower_name)_sources",) \
+  $(info $(indent)srcs: [) \
+  $(foreach f,$(filter %.c,$($(NAME)_FILES)), \
+    $(info $(indent)$(indent)"$(f)",)) \
+  $(info $(indent)],) \
+  $(info }))
amdgpu/Android.bp new file +16 -0
new file mode 100644
index 00000000..976f03e9
@@ -0,0 +1,16 @@
+build = ["Android.sources.bp"]
+
+cc_library_shared {
+    name: "libdrm_amdgpu",
+
+    cflags: [
+	"-DAMDGPU_ASIC_ID_TABLE=\"/vendor/etc/hwdata/amdgpu.ids\""
+    ],
+
+    defaults: [
+        "libdrm_defaults",
+        "libdrm_amdgpu_sources",
+    ],
+    vendor: true,
+    shared_libs: ["libdrm"],
+}
amdgpu/Android.mk deleted +0 -19
deleted file mode 100644
index 1f028d0b..00000000
@@ -1,19 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Import variables LIBDRM_AMDGPU_FILES, LIBDRM_AMDGPU_H_FILES
-include $(LOCAL_PATH)/Makefile.sources
-
-LOCAL_MODULE := libdrm_amdgpu
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-LOCAL_SRC_FILES := $(LIBDRM_AMDGPU_FILES)
-
-LOCAL_CFLAGS := \
-	-DAMDGPU_ASIC_ID_TABLE=\"/vendor/etc/hwdata/amdgpu.ids\"
-
-LOCAL_REQUIRED_MODULES := amdgpu.ids
-
-include $(LIBDRM_COMMON_MK)
-include $(BUILD_SHARED_LIBRARY)
amdgpu/Android.sources.bp new file +15 -0
new file mode 100644
index 00000000..be85283d
@@ -0,0 +1,15 @@
+// Autogenerated with Android.sources.bp.mk
+
+cc_defaults {
+    name: "libdrm_amdgpu_sources",
+    srcs: [
+	"amdgpu_asic_id.c",
+        "amdgpu_bo.c",
+        "amdgpu_cs.c",
+        "amdgpu_device.c",
+        "amdgpu_gpu_info.c",
+        "amdgpu_vamgr.c",
+	"amdgpu_vm.c",
+        "handle_table.c",
+    ],
+}
data/Android.bp new file +6 -0
new file mode 100644
index 00000000..47f64371
@@ -0,0 +1,6 @@
+prebuilt_etc {
+    name: "amdgpu.ids",
+    proprietary: true,
+    sub_dir: "hwdata",
+    src: "amdgpu.ids",
+}
data/Android.mk deleted +0 -10
deleted file mode 100644
index 62013f0c..00000000
@@ -1,10 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := amdgpu.ids
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := ETC
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_MODULE_RELATIVE_PATH := hwdata
-LOCAL_SRC_FILES := $(LOCAL_MODULE)
-include $(BUILD_PREBUILT)
etnaviv/Android.bp new file +11 -0
new file mode 100644
index 00000000..21deda99
@@ -0,0 +1,11 @@
+build = ["Android.sources.bp"]
+
+cc_library_shared {
+    name: "libdrm_etnaviv",
+    defaults: [
+        "libdrm_defaults",
+        "libdrm_etnaviv_sources",
+    ],
+    vendor: true,
+    shared_libs: ["libdrm"],
+}
etnaviv/Android.mk deleted +0 -14
deleted file mode 100644
index 390f9a98..00000000
@@ -1,14 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Import variables LIBDRM_ETNAVIV_FILES, LIBDRM_ETNAVIV_H_FILES
-include $(LOCAL_PATH)/Makefile.sources
-
-LOCAL_MODULE := libdrm_etnaviv
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-LOCAL_SRC_FILES := $(LIBDRM_ETNAVIV_FILES)
-
-include $(LIBDRM_COMMON_MK)
-include $(BUILD_SHARED_LIBRARY)
etnaviv/Android.sources.bp new file +13 -0
new file mode 100644
index 00000000..aa828900
@@ -0,0 +1,13 @@
+// Autogenerated with Android.sources.bp.mk
+
+cc_defaults {
+    name: "libdrm_etnaviv_sources",
+    srcs: [
+        "etnaviv_device.c",
+        "etnaviv_gpu.c",
+        "etnaviv_bo.c",
+        "etnaviv_bo_cache.c",
+        "etnaviv_pipe.c",
+        "etnaviv_cmd_stream.c",
+    ],
+}
freedreno/Android.bp new file +11 -0
new file mode 100644
index 00000000..9fca9b12
@@ -0,0 +1,11 @@
+build = ["Android.sources.bp"]
+
+cc_library_shared {
+    name: "libdrm_freedreno",
+    defaults: [
+        "libdrm_defaults",
+        "libdrm_freedreno_sources",
+    ],
+    vendor: true,
+    shared_libs: ["libdrm"],
+}
freedreno/Android.mk deleted +0 -14
deleted file mode 100644
index 2b582aed..00000000
@@ -1,14 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Import variables LIBDRM_FREEDRENO_FILES, LIBDRM_FREEDRENO_H_FILES
-include $(LOCAL_PATH)/Makefile.sources
-
-LOCAL_MODULE := libdrm_freedreno
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-LOCAL_SRC_FILES := $(LIBDRM_FREEDRENO_FILES)
-
-include $(LIBDRM_COMMON_MK)
-include $(BUILD_SHARED_LIBRARY)
freedreno/Android.sources.bp new file +16 -0
new file mode 100644
index 00000000..3c1ca316
@@ -0,0 +1,16 @@
+// Autogenerated with Android.sources.bp.mk
+
+cc_defaults {
+    name: "libdrm_freedreno_sources",
+    srcs: [
+        "freedreno_device.c",
+        "freedreno_pipe.c",
+        "freedreno_ringbuffer.c",
+        "freedreno_bo.c",
+        "freedreno_bo_cache.c",
+        "msm/msm_bo.c",
+        "msm/msm_device.c",
+        "msm/msm_pipe.c",
+        "msm/msm_ringbuffer.c",
+    ],
+}
intel/Android.bp new file +36 -0
new file mode 100644
index 00000000..22713acc
@@ -0,0 +1,36 @@
+//
+// 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.
+//
+
+build = ["Android.sources.bp"]
+
+cc_library_shared {
+    name: "libdrm_intel",
+    defaults: [
+        "libdrm_defaults",
+        "libdrm_intel_sources",
+    ],
+    vendor: true,
+
+    // Removed dependency to libpciaccess: not used on Android
+    shared_libs: ["libdrm"],
+}
intel/Android.mk deleted +0 -38
deleted file mode 100644
index f45312dd..00000000
@@ -1,38 +0,0 @@
-#
-# 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Import variables LIBDRM_INTEL_FILES, LIBDRM_INTEL_H_FILES
-include $(LOCAL_PATH)/Makefile.sources
-
-LOCAL_MODULE := libdrm_intel
-
-LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES)
-
-LOCAL_SHARED_LIBRARIES := \
-	libdrm
-
-include $(LIBDRM_COMMON_MK)
-include $(BUILD_SHARED_LIBRARY)
intel/Android.sources.bp new file +13 -0
new file mode 100644
index 00000000..46e0328f
@@ -0,0 +1,13 @@
+// Autogenerated with Android.sources.bp.mk
+
+cc_defaults {
+    name: "libdrm_intel_sources",
+    srcs: [
+        "intel_bufmgr.c",
+        "intel_bufmgr_fake.c",
+        "intel_bufmgr_gem.c",
+        "intel_decode.c",
+        "intel_chipset.c",
+        "mm.c",
+    ],
+}
libkms/Android.bp new file +15 -0
new file mode 100644
index 00000000..b09dbf42
@@ -0,0 +1,15 @@
+build = ["Android.sources.bp"]
+
+cc_library_shared {
+    name: "libkms",
+    defaults: [
+        "libdrm_defaults",
+        "libkms_sources",
+        "libkms_vmwgfx_sources",
+        "libkms_intel_sources",
+        "libkms_nouveau_sources",
+        "libkms_radeon_sources",
+    ],
+    vendor: true,
+    shared_libs: ["libdrm"],
+}
libkms/Android.mk deleted +0 -51

51 lines not on this page · raw message

libkms/Android.sources.bp new file +38 -0
new file mode 100644
index 00000000..5582f235
@@ -0,0 +1,38 @@
+// Autogenerated with Android.sources.bp.mk
+
+cc_defaults {
+    name: "libkms_sources",
+    srcs: [
+        "linux.c",
+        "dumb.c",
+        "api.c",
+    ],
+}
+
+cc_defaults {
+    name: "libkms_vmwgfx_sources",
+    srcs: [
+        "vmwgfx.c",
+    ],
+}
+
+cc_defaults {
+    name: "libkms_intel_sources",
+    srcs: [
+        "intel.c",
+    ],
+}
+
+cc_defaults {
+    name: "libkms_nouveau_sources",
+    srcs: [
+        "nouveau.c",
+    ],
+}
+
+cc_defaults {
+    name: "libkms_radeon_sources",
+    srcs: [
+        "radeon.c",
+    ],
+}
nouveau/Android.bp new file +11 -0
new file mode 100644
index 00000000..12c37e3d
@@ -0,0 +1,11 @@
+build = ["Android.sources.bp"]
+
+cc_library_shared {
+    name: "libdrm_nouveau",
+    defaults: [
+        "libdrm_defaults",
+        "libdrm_nouveau_sources",
+    ],
+    vendor: true,
+    shared_libs: ["libdrm"],
+}
nouveau/Android.mk deleted +0 -14
deleted file mode 100644
index b430af4f..00000000
@@ -1,14 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Import variables LIBDRM_NOUVEAU_FILES, LIBDRM_NOUVEAU_H_FILES
-include $(LOCAL_PATH)/Makefile.sources
-
-LOCAL_MODULE := libdrm_nouveau
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-LOCAL_SRC_FILES := $(LIBDRM_NOUVEAU_FILES)
-
-include $(LIBDRM_COMMON_MK)
-include $(BUILD_SHARED_LIBRARY)
nouveau/Android.sources.bp new file +11 -0
new file mode 100644
index 00000000..5ecdb53c
@@ -0,0 +1,11 @@
+// Autogenerated with Android.sources.bp.mk
+
+cc_defaults {
+    name: "libdrm_nouveau_sources",
+    srcs: [
+        "nouveau.c",
+        "pushbuf.c",
+        "bufctx.c",
+        "abi16.c",
+    ],
+}
omap/Android.bp new file +12 -0
new file mode 100644
index 00000000..05ca7d2d
@@ -0,0 +1,12 @@
+build = ["Android.sources.bp"]
+
+cc_library_shared {
+    name: "libdrm_omap",
+    defaults: [
+        "libdrm_defaults",
+        "libdrm_omap_sources",
+    ],
+    vendor: true,
+
+    shared_libs: ["libdrm"],
+}
omap/Android.mk deleted +0 -13
deleted file mode 100644
index b25cca13..00000000
@@ -1,13 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libdrm_omap
-LOCAL_VENDOR_MODULE := true
-
-LOCAL_SRC_FILES := omap_drm.c
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-include $(LIBDRM_COMMON_MK)
-
-include $(BUILD_SHARED_LIBRARY)
omap/Android.sources.bp new file +8 -0
new file mode 100644
index 00000000..3c7da94a
@@ -0,0 +1,8 @@
+// Autogenerated with Android.sources.bp.mk
+
+cc_defaults {
+    name: "libdrm_omap_sources",
+    srcs: [
+	"omap_drm.c",
+    ],
+}
radeon/Android.bp new file +11 -0
new file mode 100644
index 00000000..9d0a09ec
@@ -0,0 +1,11 @@
+build = ["Android.sources.bp"]
+
+cc_library_shared {
+    name: "libdrm_radeon",
+    defaults: [
+        "libdrm_defaults",
+        "libdrm_radeon_sources",
+    ],
+    vendor: true,
+    shared_libs: ["libdrm"],
+}
radeon/Android.mk deleted +0 -14
deleted file mode 100644
index 71040dab..00000000
@@ -1,14 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Import variables LIBDRM_RADEON_FILES, LIBDRM_RADEON_H_FILES
-include $(LOCAL_PATH)/Makefile.sources
-
-LOCAL_MODULE := libdrm_radeon
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-LOCAL_SRC_FILES := $(LIBDRM_RADEON_FILES)
-
-include $(LIBDRM_COMMON_MK)
-include $(BUILD_SHARED_LIBRARY)
radeon/Android.sources.bp new file +13 -0
new file mode 100644
index 00000000..820ac4d6
@@ -0,0 +1,13 @@
+// Autogenerated with Android.sources.bp.mk
+
+cc_defaults {
+    name: "libdrm_radeon_sources",
+    srcs: [
+        "radeon_bo_gem.c",
+        "radeon_cs_gem.c",
+        "radeon_cs_space.c",
+        "radeon_bo.c",
+        "radeon_cs.c",
+        "radeon_surface.c",
+    ],
+}
tegra/Android.bp new file +14 -0
new file mode 100644
index 00000000..33eaf6c5
@@ -0,0 +1,14 @@
+cc_library_shared {
+    name: "libdrm_tegra",
+    vendor: true,
+    shared_libs: ["libdrm"],
+
+    srcs: ["tegra.c"],
+
+    cflags: [
+        "-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1",
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-variable",
+    ],
+}
tests/Android.bp new file +6 -0
new file mode 100644
index 00000000..cdc6c2cf
@@ -0,0 +1,6 @@
+subdirs = ["*"]
+
+cc_library_headers {
+    name: "libdrm_test_headers",
+    export_include_dirs: ["."],
+}
tests/Android.mk deleted +0 -1
deleted file mode 100644
index 5053e7d6..00000000
@@ -1 +0,0 @@
-include $(call all-subdir-makefiles)
tests/modetest/Android.bp new file +12 -0
new file mode 100644
index 00000000..ca811fee
@@ -0,0 +1,12 @@
+build = ["Android.sources.bp"]
+
+cc_test {
+    name: "modetest",
+    defaults: [
+        "libdrm_defaults",
+        "modetest_sources",
+    ],
+
+    shared_libs: ["libdrm"],
+    static_libs: ["libdrm_util"],
+}
tests/modetest/Android.mk deleted +0 -14
deleted file mode 100644
index c1a71fd9..00000000
@@ -1,14 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-include $(LOCAL_PATH)/Makefile.sources
-
-LOCAL_SRC_FILES := $(MODETEST_FILES)
-
-LOCAL_MODULE := modetest
-
-LOCAL_SHARED_LIBRARIES := libdrm
-LOCAL_STATIC_LIBRARIES := libdrm_util
-
-include $(LIBDRM_COMMON_MK)
-include $(BUILD_EXECUTABLE)
tests/modetest/Android.sources.bp new file +10 -0
new file mode 100644
index 00000000..c6aca2ef
@@ -0,0 +1,10 @@
+// Autogenerated with Android.sources.bp.mk
+
+cc_defaults {
+    name: "modetest_sources",
+    srcs: [
+        "buffers.c",
+        "cursor.c",
+        "modetest.c",
+    ],
+}
tests/proptest/Android.bp new file +8 -0
new file mode 100644
index 00000000..28c87e91
@@ -0,0 +1,8 @@
+cc_test {
+    name: "proptest",
+    defaults: ["libdrm_defaults"],
+    srcs: ["proptest.c"],
+
+    shared_libs: ["libdrm"],
+    static_libs: ["libdrm_util"],
+}
tests/proptest/Android.mk deleted +0 -14
deleted file mode 100644
index 91a590fc..00000000
@@ -1,14 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-include $(LOCAL_PATH)/Makefile.sources
-
-LOCAL_SRC_FILES := $(PROPTEST_FILES)
-
-LOCAL_MODULE := proptest
-
-LOCAL_SHARED_LIBRARIES := libdrm
-LOCAL_STATIC_LIBRARIES := libdrm_util
-
-include $(LIBDRM_COMMON_MK)
-include $(BUILD_EXECUTABLE)
tests/util/Android.bp new file +35 -0
new file mode 100644
index 00000000..36d18206
@@ -0,0 +1,35 @@
+//
+// Copyright © 2015 NVIDIA 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.
+//
+
+build = ["Android.sources.bp"]
+
+cc_library_static {
+    name: "libdrm_util",
+    defaults: [
+        "libdrm_defaults",
+        "libdrm_util_sources",
+    ],
+    shared_libs: ["libdrm"],
+    header_libs: ["libdrm_test_headers"],
+    export_header_lib_headers: ["libdrm_test_headers"],
+}
tests/util/Android.mk deleted +0 -38
deleted file mode 100644
index 12eccb42..00000000
@@ -1,38 +0,0 @@
-#
-# Copyright © 2015 NVIDIA 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-include $(LOCAL_PATH)/Makefile.sources
-
-LOCAL_MODULE := libdrm_util
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-LOCAL_SRC_FILES := $(UTIL_FILES)
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LIBDRM_TOP)/tests
-
-include $(LIBDRM_COMMON_MK)
-include $(BUILD_STATIC_LIBRARY)
tests/util/Android.sources.bp new file +10 -0
new file mode 100644
index 00000000..529e1124
@@ -0,0 +1,10 @@
+// Autogenerated with Android.sources.bp.mk
+
+cc_defaults {
+    name: "libdrm_util_sources",
+    srcs: [
+        "format.c",
+        "kms.c",
+        "pattern.c",
+    ],
+}
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · John Stultz

This patch removes the deprecated Android.mk files and replaces them with Android.bp files.

This is needed in order to build libdrm/master against recent Android releases and AOSP/master, as some of the Treble build options required since Android O cannot be expressed in Andorid.mk files.

Quoted 5 lines

Patch originally by Dan Willemsen with fixes folded in by:
Jerry Zhang, Eliott Hughes and myself.

With this change, the only patches carried by Android for libdrm would be the gerrit OWNERS meta-data file.

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

Acked-by on v1 1/1
#2 lore raw
In reply to John Stultz
Quoted 34 lines · John Stultz

This patch removes the deprecated Android.mk files and replaces them with Android.bp files.

This is needed in order to build libdrm/master against recent Android releases and AOSP/master, as some of the Treble build options required since Android O cannot be expressed in Andorid.mk files.

Patch originally by Dan Willemsen with fixes folded in by:
Jerry Zhang, Eliott Hughes and myself.

With this change, the only patches carried by Android for libdrm would be the gerrit OWNERS meta-data file.

Cc Mauro Rossi <[email protected]>
Cc Chih-Wei Huang <[email protected]>
Cc Robert Foss <[email protected]>
Cc Tapani Pälli <[email protected]>
Cc Chih-Wei Huang <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Sean Paul <[email protected]>
Cc Rob Clark <[email protected]>
Cc Eric Anholt <[email protected]>
Cc Jiyong Park <[email protected]>
Cc Alistair Strachan <[email protected]>
Cc Dan Willemsen <[email protected]>
Cc Sumit Semwal <[email protected]>
Cc Vishal Bhoj <[email protected]>

---
I know last time this was proposed, there was some concern about maintaining support for old AOSP releases - and while we could still support both with Android.mk that was a fair concern.

Quoted 4 lines

However, now that it is a requirement for newer releases, I'd contend that being able to build/test libdrm/master against AOSP/master and recent releases is more valuable then soley maintaining support for old and unsupported Android releases.

But to be clear, what's the earliest android version that supports blueprint? (might be worth adding that to the commit message)

Quoted 5 lines

So I wanted to submit this again for discussion.

thanks
-john

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

#3 lore raw
Quoted 40 lines · Eric Engestrom
Quoted 34 lines · John Stultz

This patch removes the deprecated Android.mk files and replaces them with Android.bp files.

This is needed in order to build libdrm/master against recent Android releases and AOSP/master, as some of the Treble build options required since Android O cannot be expressed in Andorid.mk files.

Patch originally by Dan Willemsen with fixes folded in by:
Jerry Zhang, Eliott Hughes and myself.

With this change, the only patches carried by Android for libdrm would be the gerrit OWNERS meta-data file.

Cc Mauro Rossi <[email protected]>
Cc Chih-Wei Huang <[email protected]>
Cc Robert Foss <[email protected]>
Cc Tapani Pälli <[email protected]>
Cc Chih-Wei Huang <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Sean Paul <[email protected]>
Cc Rob Clark <[email protected]>
Cc Eric Anholt <[email protected]>
Cc Jiyong Park <[email protected]>
Cc Alistair Strachan <[email protected]>
Cc Dan Willemsen <[email protected]>
Cc Sumit Semwal <[email protected]>
Cc Vishal Bhoj <[email protected]>

---
I know last time this was proposed, there was some concern about maintaining support for old AOSP releases - and while we could still support both with Android.mk that was a fair concern.

Quoted 4 lines

However, now that it is a requirement for newer releases, I'd contend that being able to build/test libdrm/master against AOSP/master and recent releases is more valuable then soley maintaining support for old and unsupported Android releases.

Quoted 4 lines

But to be clear, what's the earliest android version that supports blueprint? (might be worth adding that to the commit message)

I believe it was Android N which was the first to use blueprint.

Thanks for the review, I'll add such a note to the commit and resubmit w/o RFC in a few days.

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