Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-libdrm: Commit

external/libdrm


Commit MetaInfo

Revisionbe3ec74f12892e5d1777bef5025c2934ef440017 (tree)
Time2019-10-18 03:07:53
AuthorJiyong Park <jiyong@goog...>
CommiterMauro Rossi

Log Message

android: make libdrm*.so available to the vendor partition

libdrm_<vendor>.so are moved to the vendor partition (/vendor/lib or
/system/vendor/lib if there is no dedicated vendor partition), since
they are vendor-specific extension that must not be in the system
partition which should be generic.

libdrm.so (which is generic) is built/installed twice: once to
/vendor/lib to satisfy the dependency for the libdrm_<vendor>.so libs
and once to /system/lib for platform clients such as the recovery
executable.

The platform variant of libdrm is named as libdrm_platform.so since
in Android.mk we can't have two different shared libs having
same soname. In the near future, this will be fixed by converting these
Android.mk files to Android.bp and mark the module libdrm as
'vendor_available: true'. (See
https://android-review.googlesource.com/c/368372/ for further detail on
the property)

Signed-off-by: Jiyong Park <jiyong@google.com>

Change Summary

Incremental Difference

--- a/Android.common.mk
+++ b/Android.common.mk
@@ -15,5 +15,3 @@ LOCAL_CFLAGS += \
1515 # Quiet down the build system and remove any .h files from the sources
1616 LOCAL_SRC_FILES := $(patsubst %.h, , $(LOCAL_SRC_FILES))
1717 LOCAL_EXPORT_C_INCLUDE_DIRS += $(LOCAL_PATH)
18-
19-LOCAL_PROPRIETARY_MODULE := true
--- a/Android.mk
+++ b/Android.mk
@@ -21,6 +21,10 @@
2121 # IN THE SOFTWARE.
2222 #
2323
24+# Two identical libs are defined here.
25+# libdrm: for vendors. installed to /vendor/lib. libdrm_<vendor> uses this.
26+# libdrm_platform: for platform modules (such as libminui). installed to /system/lib
27+
2428 LIBDRM_ANDROID_MAJOR_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
2529 ifneq ($(filter 2 4, $(LIBDRM_ANDROID_MAJOR_VERSION)),)
2630 $(error "Android 4.4 and earlier not supported")
@@ -38,7 +42,41 @@ include $(LOCAL_PATH)/Makefile.sources
3842
3943 #static library for the device (recovery)
4044 include $(CLEAR_VARS)
45+
46+LOCAL_MODULE := libdrm_platform
47+
48+LOCAL_SRC_FILES := $(LIBDRM_FILES)
49+LOCAL_EXPORT_C_INCLUDE_DIRS := \
50+ $(LOCAL_PATH) \
51+ $(LOCAL_PATH)/include/drm
52+
53+LOCAL_C_INCLUDES := \
54+ $(LOCAL_PATH)/include/drm
55+
56+include $(LIBDRM_COMMON_MK)
57+include $(BUILD_STATIC_LIBRARY)
58+
59+# Dynamic library for the device
60+include $(CLEAR_VARS)
61+
62+LOCAL_MODULE := libdrm_platform
63+
64+LOCAL_SRC_FILES := $(LIBDRM_FILES)
65+LOCAL_EXPORT_C_INCLUDE_DIRS := \
66+ $(LOCAL_PATH) \
67+ $(LOCAL_PATH)/include/drm
68+
69+LOCAL_C_INCLUDES := \
70+ $(LOCAL_PATH)/include/drm
71+
72+include $(LIBDRM_COMMON_MK)
73+include $(BUILD_SHARED_LIBRARY)
74+
75+# Static library for the device (recovery)
76+include $(CLEAR_VARS)
77+
4178 LOCAL_MODULE := libdrm
79+LOCAL_VENDOR_MODULE := true
4280
4381 LOCAL_SRC_FILES := $(LIBDRM_FILES)
4482 LOCAL_EXPORT_C_INCLUDE_DIRS := \
@@ -55,6 +93,7 @@ include $(BUILD_STATIC_LIBRARY)
5593 # Shared library for the device
5694 include $(CLEAR_VARS)
5795 LOCAL_MODULE := libdrm
96+LOCAL_VENDOR_MODULE := true
5897
5998 LOCAL_SRC_FILES := $(LIBDRM_FILES)
6099 LOCAL_EXPORT_C_INCLUDE_DIRS := \
--- a/amdgpu/Android.mk
+++ b/amdgpu/Android.mk
@@ -5,7 +5,7 @@ include $(CLEAR_VARS)
55 include $(LOCAL_PATH)/Makefile.sources
66
77 LOCAL_MODULE := libdrm_amdgpu
8-
8+LOCAL_VENDOR_MODULE := true
99 LOCAL_SHARED_LIBRARIES := libdrm
1010
1111 LOCAL_SRC_FILES := $(LIBDRM_AMDGPU_FILES)
--- a/etnaviv/Android.mk
+++ b/etnaviv/Android.mk
@@ -5,6 +5,7 @@ include $(CLEAR_VARS)
55 include $(LOCAL_PATH)/Makefile.sources
66
77 LOCAL_MODULE := libdrm_etnaviv
8+LOCAL_VENDOR_MODULE := true
89
910 LOCAL_SHARED_LIBRARIES := libdrm
1011
--- a/freedreno/Android.mk
+++ b/freedreno/Android.mk
@@ -5,7 +5,7 @@ include $(CLEAR_VARS)
55 include $(LOCAL_PATH)/Makefile.sources
66
77 LOCAL_MODULE := libdrm_freedreno
8-
8+LOCAL_VENDOR_MODULE := true
99 LOCAL_SHARED_LIBRARIES := libdrm
1010
1111 LOCAL_SRC_FILES := $(LIBDRM_FREEDRENO_FILES)
--- a/intel/Android.mk
+++ b/intel/Android.mk
@@ -28,6 +28,7 @@ include $(CLEAR_VARS)
2828 include $(LOCAL_PATH)/Makefile.sources
2929
3030 LOCAL_MODULE := libdrm_intel
31+LOCAL_VENDOR_MODULE := true
3132
3233 LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES)
3334
--- a/libkms/Android.mk
+++ b/libkms/Android.mk
@@ -45,6 +45,7 @@ LOCAL_SRC_FILES += $(LIBKMS_RADEON_FILES)
4545 endif
4646
4747 LOCAL_MODULE := libkms
48+LOCAL_VENDOR_MODULE := true
4849 LOCAL_SHARED_LIBRARIES := libdrm
4950
5051 include $(LIBDRM_COMMON_MK)
--- a/nouveau/Android.mk
+++ b/nouveau/Android.mk
@@ -5,6 +5,7 @@ include $(CLEAR_VARS)
55 include $(LOCAL_PATH)/Makefile.sources
66
77 LOCAL_MODULE := libdrm_nouveau
8+LOCAL_VENDOR_MODULE := true
89
910 LOCAL_SHARED_LIBRARIES := libdrm
1011
--- a/radeon/Android.mk
+++ b/radeon/Android.mk
@@ -5,6 +5,7 @@ include $(CLEAR_VARS)
55 include $(LOCAL_PATH)/Makefile.sources
66
77 LOCAL_MODULE := libdrm_radeon
8+LOCAL_VENDOR_MODULE := true
89
910 LOCAL_SHARED_LIBRARIES := libdrm
1011
--- a/tests/modetest/Android.mk
+++ b/tests/modetest/Android.mk
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := $(MODETEST_FILES)
77
88 LOCAL_MODULE := modetest
99
10-LOCAL_SHARED_LIBRARIES := libdrm
10+LOCAL_SHARED_LIBRARIES := libdrm_platform
1111 LOCAL_STATIC_LIBRARIES := libdrm_util
1212
1313 include $(LIBDRM_COMMON_MK)
--- a/tests/proptest/Android.mk
+++ b/tests/proptest/Android.mk
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := $(PROPTEST_FILES)
77
88 LOCAL_MODULE := proptest
99
10-LOCAL_SHARED_LIBRARIES := libdrm
10+LOCAL_SHARED_LIBRARIES := libdrm_platform
1111 LOCAL_STATIC_LIBRARIES := libdrm_util
1212
1313 include $(LIBDRM_COMMON_MK)
--- a/tests/util/Android.mk
+++ b/tests/util/Android.mk
@@ -28,7 +28,7 @@ include $(LOCAL_PATH)/Makefile.sources
2828
2929 LOCAL_MODULE := libdrm_util
3030
31-LOCAL_SHARED_LIBRARIES := libdrm
31+LOCAL_SHARED_LIBRARIES := libdrm_platform
3232
3333 LOCAL_SRC_FILES := $(UTIL_FILES)
3434
Show on old repository browser