From c1fb163dd212903b6253d755c2cac080c6a0a74f Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Fri, 6 Oct 2023 23:47:35 +0300 Subject: [PATCH] Migrate to AOSPv14 Issues: 1. HVUI/Vulkan does not work on A14 yet. Reverted to GLES. 2. Updated wpa_supplicant does not connect to closed Wi-Fi networks. It was temporarily reverted to the A13 version. Signed-off-by: Roman Stratiienko --- .../devices-community/gd_rpi4/device.mk | 2 +- manifests/glodroid.xml | 8 +- .../0001-GLODROID-Don-t-use-clang-tidy.patch | 29 - ...01-Add-netlink-public-header-library.patch | 37 + ...-a-soong-module-for-hostapd-manifest.patch | 30 + ...-incorrect-OPENSSL_IS_BORINGSSL-ifde.patch | 157 ++++ ...UI-Fix-deadlock-in-graphics-pipeline.patch | 39 + ...-crash-from-asynchronous-GPU-metrics.patch | 82 -- .../u-boot/0004-GLODROID-Speed-up-boot.patch | 2 +- ...ecated-BOARD_BUILD_SYSTEM_ROOT_IMAGE.patch | 26 + ...usb-gadget-Use-AOSP-libusbconfigfs-2.patch | 754 ++++++++++++++++++ ...nel-Rename-mkdtboimg.py-to-mkdtboimg.patch | 28 + ...base-Set-TARGET_FLATTEN_APEX-to-true.patch | 27 + ...als-Upgrade-boot-control-HAL-to-AIDL.patch | 31 + .../broadcom/0001-Fix-clang17-errors.patch | 30 + ...r-building-ffmpeg_codec2-using-meson.patch | 91 --- ...-RPI4-FFMPEG-Enable-hardware-codecs.patch} | 0 ...move-__driDriverExtensions-leftovers.patch | 65 ++ .../0002-HACK-Use-mask-in-dri.sym.patch | 36 + ...-symlink-that-points-to-missing-file.patch | 25 + unfold_aosp.sh | 2 +- unfold_lineageos.sh | 4 + 22 files changed, 1298 insertions(+), 207 deletions(-) delete mode 100644 patches-aosp/build/soong/0001-GLODROID-Don-t-use-clang-tidy.patch create mode 100644 patches-aosp/external/wpa_supplicant_8/0001-Add-netlink-public-header-library.patch create mode 100644 patches-aosp/external/wpa_supplicant_8/0002-Decalre-a-soong-module-for-hostapd-manifest.patch create mode 100644 patches-aosp/external/wpa_supplicant_8/0003-Remove-a-host-of-incorrect-OPENSSL_IS_BORINGSSL-ifde.patch create mode 100644 patches-aosp/frameworks/base/0001-HWUI-Fix-deadlock-in-graphics-pipeline.patch delete mode 100644 patches-aosp/frameworks/base/0001-Revert-Fix-crash-from-asynchronous-GPU-metrics.patch create mode 100644 patches-aosp/glodroid/configuration/0008-base-Remove-deprecated-BOARD_BUILD_SYSTEM_ROOT_IMAGE.patch create mode 100644 patches-aosp/glodroid/configuration/0009-hals-usb-gadget-Use-AOSP-libusbconfigfs-2.patch create mode 100644 patches-aosp/glodroid/configuration/0010-platform-kernel-Rename-mkdtboimg.py-to-mkdtboimg.patch create mode 100644 patches-aosp/glodroid/configuration/0011-base-Set-TARGET_FLATTEN_APEX-to-true.patch create mode 100644 patches-aosp/glodroid/configuration/0012-other-hals-Upgrade-boot-control-HAL-to-AIDL.patch create mode 100644 patches-aosp/glodroid/kernel/broadcom/0001-Fix-clang17-errors.patch delete mode 100644 patches-aosp/glodroid/vendor/aospext/0001-Add-support-for-building-ffmpeg_codec2-using-meson.patch rename patches-aosp/glodroid/vendor/aospext/{0002-RPI4-FFMPEG-Enable-hardware-codecs.patch => 0001-RPI4-FFMPEG-Enable-hardware-codecs.patch} (100%) create mode 100644 patches-aosp/glodroid/vendor/mesa3d/0001-dri-Remove-__driDriverExtensions-leftovers.patch create mode 100644 patches-aosp/glodroid/vendor/mesa3d/0002-HACK-Use-mask-in-dri.sym.patch create mode 100644 patches-aosp/glodroid/vendor/mesa3d/0003-isaspec-Remove-symlink-that-points-to-missing-file.patch diff --git a/aosptree/vendor/devices-community/gd_rpi4/device.mk b/aosptree/vendor/devices-community/gd_rpi4/device.mk index 58b8f4c..eb2bd10 100644 --- a/aosptree/vendor/devices-community/gd_rpi4/device.mk +++ b/aosptree/vendor/devices-community/gd_rpi4/device.mk @@ -65,7 +65,7 @@ PRODUCT_VENDOR_PROPERTIES += \ ro.hardware.vulkan=broadcom \ # Enable Vulkan backend for SKIA/HWUI -TARGET_USES_VULKAN = true +# TARGET_USES_VULKAN = true # Bluetooth PRODUCT_VENDOR_PROPERTIES += \ diff --git a/manifests/glodroid.xml b/manifests/glodroid.xml index 8fd2dd8..ebdf102 100644 --- a/manifests/glodroid.xml +++ b/manifests/glodroid.xml @@ -11,6 +11,7 @@ + @@ -20,7 +21,7 @@ - + @@ -45,11 +46,14 @@ - + + + + diff --git a/patches-aosp/build/soong/0001-GLODROID-Don-t-use-clang-tidy.patch b/patches-aosp/build/soong/0001-GLODROID-Don-t-use-clang-tidy.patch deleted file mode 100644 index 1ba4cde..0000000 --- a/patches-aosp/build/soong/0001-GLODROID-Don-t-use-clang-tidy.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 01daa7236225d6e714bcf2572cd7003345d98d39 Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Sun, 21 May 2023 00:44:46 +0300 -Subject: [PATCH] GLODROID: Don't use clang-tidy - -It's pointless, time, and energy inefficient to run it globally. - -Change-Id: I12b94488c6f9e273786e099670a0610830ba024a -Signed-off-by: Roman Stratiienko ---- - cc/tidy.go | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/cc/tidy.go b/cc/tidy.go -index 750e9de1e..63f525e00 100644 ---- a/cc/tidy.go -+++ b/cc/tidy.go -@@ -74,7 +74,7 @@ func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags { - // If not explicitly disabled, set flags.Tidy to generate .tidy rules. - // Note that libraries and binaries will depend on .tidy files ONLY if - // the global WITH_TIDY or module 'tidy' property is true. -- flags.Tidy = true -+ flags.Tidy = false - - // If explicitly enabled, by global default or local tidy property, - // set flags.NeedTidyFiles to make this module depend on .tidy files. --- -2.39.2 - diff --git a/patches-aosp/external/wpa_supplicant_8/0001-Add-netlink-public-header-library.patch b/patches-aosp/external/wpa_supplicant_8/0001-Add-netlink-public-header-library.patch new file mode 100644 index 0000000..41422f6 --- /dev/null +++ b/patches-aosp/external/wpa_supplicant_8/0001-Add-netlink-public-header-library.patch @@ -0,0 +1,37 @@ +From 13fed80854c281cc7eaf78e5848b10f5becb947a Mon Sep 17 00:00:00 2001 +From: Jooyung Han +Date: Tue, 26 Jul 2022 12:56:00 +0900 +Subject: [PATCH 1/3] Add netlink public header library + +libwifi-hal-bcm has been using the header via LOCAL_C_INCLUDES. To +convert libwifi-hal-bcm into a Soong module, the header is exposed as a +header lib. + +Bug: 239984067 +Test: m libwifi-hal-bcm +Merged-In: I92e044565b291c003cff9ac580dd36299fab9851 +Change-Id: I92e044565b291c003cff9ac580dd36299fab9851 +(cherry picked from commit eb043d58c236676a019ff8579d46b06f83a6daa1) +--- + Android.bp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/Android.bp b/Android.bp +index cbb1a90f..35cdb4f5 100644 +--- a/Android.bp ++++ b/Android.bp +@@ -26,3 +26,11 @@ license { + ], + license_text: ["LICENSE"], + } ++ ++cc_library_headers { ++ name: "libnetlink_iface_headers", ++ vendor_available: true, ++ export_include_dirs: [ ++ "src/drivers", ++ ], ++} +-- +2.39.2 + diff --git a/patches-aosp/external/wpa_supplicant_8/0002-Decalre-a-soong-module-for-hostapd-manifest.patch b/patches-aosp/external/wpa_supplicant_8/0002-Decalre-a-soong-module-for-hostapd-manifest.patch new file mode 100644 index 0000000..159dc47 --- /dev/null +++ b/patches-aosp/external/wpa_supplicant_8/0002-Decalre-a-soong-module-for-hostapd-manifest.patch @@ -0,0 +1,30 @@ +From c5ccabd03d222c26b8a255f3e4c9b5ec3a002270 Mon Sep 17 00:00:00 2001 +From: Jeongik Cha +Date: Fri, 18 Nov 2022 15:09:34 +0900 +Subject: [PATCH 2/3] Decalre a soong module for hostapd manifest + +Bug: 202992812 +Bug: 259516259 +Test: build +Change-Id: Ibc2b7a0d66f6c07660dee96a6a3f7976687ce18e +--- + hostapd/Android.bp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/hostapd/Android.bp b/hostapd/Android.bp +index 2a252080..3194d369 100644 +--- a/hostapd/Android.bp ++++ b/hostapd/Android.bp +@@ -318,3 +318,9 @@ filegroup { + ], + + } ++ ++// This manifest can used by a vendor apex module for hostapd as well. ++filegroup { ++ name: "android.hardware.wifi.hostapd.xml", ++ srcs: ["android.hardware.wifi.hostapd.xml"], ++} +-- +2.39.2 + diff --git a/patches-aosp/external/wpa_supplicant_8/0003-Remove-a-host-of-incorrect-OPENSSL_IS_BORINGSSL-ifde.patch b/patches-aosp/external/wpa_supplicant_8/0003-Remove-a-host-of-incorrect-OPENSSL_IS_BORINGSSL-ifde.patch new file mode 100644 index 0000000..e564aef --- /dev/null +++ b/patches-aosp/external/wpa_supplicant_8/0003-Remove-a-host-of-incorrect-OPENSSL_IS_BORINGSSL-ifde.patch @@ -0,0 +1,157 @@ +From 61b76bf4a6ee2a1b47aea2d47baa22cfe8e43568 Mon Sep 17 00:00:00 2001 +From: David Benjamin +Date: Mon, 13 Jun 2022 12:22:05 -0400 +Subject: [PATCH 3/3] Remove a host of incorrect OPENSSL_IS_BORINGSSL ifdefs + +The include is neccessary in both OpenSSL and BoringSSL +because the file uses BUF_MEM (IWYU). It's just that OpenSSL spells it +, not matching the type, so use the compatible +spelling. + +Additionally all the CHECKED_CAST and manual STACK_OF(T) definitions are +calling into BoringSSL internals that we were only keeping around for +compatible with wpa_supplicant's incorrect use of the APIs. The correct +APIs are simply to just use the same code as OpenSSL and call the +DEFINE_STACK_OF macros. + +(tls_openssl_ocsp.c needs to be rewritten entirely later, as the use of + is also quite dangerous, but I've left that alone for +now.) + +Test: treehugger +Change-Id: Id923db6513f9e2833854322994aa3a113ee1579d +--- + hs20/client/est.c | 28 +++------------------------- + src/crypto/tls_openssl_ocsp.c | 8 +------- + src/utils/http_curl.c | 23 ----------------------- + 3 files changed, 4 insertions(+), 55 deletions(-) + +diff --git a/hs20/client/est.c b/hs20/client/est.c +index 97f91321..c3f27e1e 100644 +--- a/hs20/client/est.c ++++ b/hs20/client/est.c +@@ -17,9 +17,7 @@ + #include + #include + #include +-#ifdef OPENSSL_IS_BORINGSSL +-#include +-#endif /* OPENSSL_IS_BORINGSSL */ ++#include + + #include "common.h" + #include "utils/base64.h" +@@ -220,9 +218,7 @@ typedef struct { + } d; + } AttrOrOID; + +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(OPENSSL_IS_BORINGSSL) + DEFINE_STACK_OF(AttrOrOID) +-#endif + + typedef struct { + int type; +@@ -340,30 +336,13 @@ static void add_csrattrs(struct hs20_osu_client *ctx, CsrAttrs *csrattrs, + if (!csrattrs || ! csrattrs->attrs) + return; + +-#ifdef OPENSSL_IS_BORINGSSL +- num = sk_num(CHECKED_CAST(_STACK *, STACK_OF(AttrOrOID) *, +- csrattrs->attrs)); +- for (i = 0; i < num; i++) { +- AttrOrOID *ao = sk_value( +- CHECKED_CAST(_STACK *, const STACK_OF(AttrOrOID) *, +- csrattrs->attrs), i); +- switch (ao->type) { +- case 0: +- add_csrattrs_oid(ctx, ao->d.oid, exts); +- break; +- case 1: +- add_csrattrs_attr(ctx, ao->d.attribute, exts); +- break; +- } +- } +-#else /* OPENSSL_IS_BORINGSSL */ +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(OPENSSL_IS_BORINGSSL) ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L + num = sk_AttrOrOID_num(csrattrs->attrs); + #else + num = SKM_sk_num(AttrOrOID, csrattrs->attrs); + #endif + for (i = 0; i < num; i++) { +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(OPENSSL_IS_BORINGSSL) ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L + AttrOrOID *ao = sk_AttrOrOID_value(csrattrs->attrs, i); + #else + AttrOrOID *ao = SKM_sk_value(AttrOrOID, csrattrs->attrs, i); +@@ -377,7 +356,6 @@ static void add_csrattrs(struct hs20_osu_client *ctx, CsrAttrs *csrattrs, + break; + } + } +-#endif /* OPENSSL_IS_BORINGSSL */ + } + + +diff --git a/src/crypto/tls_openssl_ocsp.c b/src/crypto/tls_openssl_ocsp.c +index b570bea0..a74e6f3d 100644 +--- a/src/crypto/tls_openssl_ocsp.c ++++ b/src/crypto/tls_openssl_ocsp.c +@@ -216,13 +216,7 @@ ASN1_SEQUENCE(BasicOCSPResponse) = { + + IMPLEMENT_ASN1_FUNCTIONS(BasicOCSPResponse); + +-#define sk_SingleResponse_num(sk) \ +-sk_num(CHECKED_CAST(_STACK *, STACK_OF(SingleResponse) *, sk)) +- +-#define sk_SingleResponse_value(sk, i) \ +- ((SingleResponse *) \ +- sk_value(CHECKED_CAST(_STACK *, STACK_OF(SingleResponse) *, sk), (i))) +- ++DEFINE_STACK_OF(SingleResponse) + + static char * mem_bio_to_str(BIO *out) + { +diff --git a/src/utils/http_curl.c b/src/utils/http_curl.c +index 30b07f23..77d5b357 100644 +--- a/src/utils/http_curl.c ++++ b/src/utils/http_curl.c +@@ -433,28 +433,6 @@ ASN1_SEQUENCE(LogotypeExtn) = { + + IMPLEMENT_ASN1_FUNCTIONS(LogotypeExtn); + +-#ifdef OPENSSL_IS_BORINGSSL +-#define sk_LogotypeInfo_num(st) \ +-sk_num(CHECKED_CAST(_STACK *, STACK_OF(LogotypeInfo) *, (st))) +-#define sk_LogotypeInfo_value(st, i) (LogotypeInfo *) \ +-sk_value(CHECKED_CAST(_STACK *, const STACK_OF(LogotypeInfo) *, (st)), (i)) +-#define sk_LogotypeImage_num(st) \ +-sk_num(CHECKED_CAST(_STACK *, STACK_OF(LogotypeImage) *, (st))) +-#define sk_LogotypeImage_value(st, i) (LogotypeImage *) \ +-sk_value(CHECKED_CAST(_STACK *, const STACK_OF(LogotypeImage) *, (st)), (i)) +-#define sk_LogotypeAudio_num(st) \ +-sk_num(CHECKED_CAST(_STACK *, STACK_OF(LogotypeAudio) *, (st))) +-#define sk_LogotypeAudio_value(st, i) (LogotypeAudio *) \ +-sk_value(CHECK_CAST(_STACK *, const STACK_OF(LogotypeAudio) *, (st)), (i)) +-#define sk_HashAlgAndValue_num(st) \ +-sk_num(CHECKED_CAST(_STACK *, STACK_OF(HashAlgAndValue) *, (st))) +-#define sk_HashAlgAndValue_value(st, i) (HashAlgAndValue *) \ +-sk_value(CHECKED_CAST(_STACK *, const STACK_OF(HashAlgAndValue) *, (st)), (i)) +-#define sk_ASN1_IA5STRING_num(st) \ +-sk_num(CHECKED_CAST(_STACK *, STACK_OF(ASN1_IA5STRING) *, (st))) +-#define sk_ASN1_IA5STRING_value(st, i) (ASN1_IA5STRING *) \ +-sk_value(CHECKED_CAST(_STACK *, const STACK_OF(ASN1_IA5STRING) *, (st)), (i)) +-#else /* OPENSSL_IS_BORINGSSL */ + #if OPENSSL_VERSION_NUMBER < 0x10100000L + #define sk_LogotypeInfo_num(st) SKM_sk_num(LogotypeInfo, (st)) + #define sk_LogotypeInfo_value(st, i) SKM_sk_value(LogotypeInfo, (st), (i)) +@@ -473,7 +451,6 @@ DEFINE_STACK_OF(LogotypeAudio) + DEFINE_STACK_OF(HashAlgAndValue) + DEFINE_STACK_OF(ASN1_IA5STRING) + #endif +-#endif /* OPENSSL_IS_BORINGSSL */ + + + static void add_logo(struct http_ctx *ctx, struct http_cert *hcert, +-- +2.39.2 + diff --git a/patches-aosp/frameworks/base/0001-HWUI-Fix-deadlock-in-graphics-pipeline.patch b/patches-aosp/frameworks/base/0001-HWUI-Fix-deadlock-in-graphics-pipeline.patch new file mode 100644 index 0000000..46983a7 --- /dev/null +++ b/patches-aosp/frameworks/base/0001-HWUI-Fix-deadlock-in-graphics-pipeline.patch @@ -0,0 +1,39 @@ +From 2be0dae3f8fb3c912edb49dba2f2cd434b8d9401 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Thu, 19 Oct 2023 03:37:01 +0300 +Subject: [PATCH] HWUI: Fix deadlock in graphics pipeline + +Mutex lock() causes deadlock when the queue is empty. +Regression is caused by b013c8dee3b3e897b3557206f2d6c75b8c9f2f84 +For some unknown reason, it is reproduced only on GloDroid :) +So probably some other part of GD is to blame. +Or, it is just a coincidence. + +TODO: Do one more investigation attempt. + +Change-Id: Ic981947babe62b83032e9ba1630cc0458c228f44 +Signed-off-by: Roman Stratiienko +--- + libs/hwui/renderthread/CanvasContext.cpp | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp +index 16b35ffcabac..a9dde31e83e7 100644 +--- a/libs/hwui/renderthread/CanvasContext.cpp ++++ b/libs/hwui/renderthread/CanvasContext.cpp +@@ -586,7 +586,11 @@ void CanvasContext::draw(bool solelyTextureViewUpdates) { + // not visible to IRenderPipeline much less FrameInfoVisualizer. And since this is + // the thread we're primarily concerned about being responsive, this being too broad + // shouldn't pose a performance issue. +- std::scoped_lock lock(mFrameMetricsReporterMutex); ++ ++// Causes deadlock when the queue is empty. Regression is caused by b013c8dee3b3e897b3557206f2d6c75b8c9f2f84 ++// For some unknown reason, it is reproduced only on GloDroid :) So probably some other part of GD is to blame. Or, it is just a coincidence. ++// std::scoped_lock lock(mFrameMetricsReporterMutex); ++ + drawResult = mRenderPipeline->draw(frame, windowDirty, dirty, mLightGeometry, + &mLayerUpdateQueue, mContentDrawBounds, mOpaque, + mLightInfo, mRenderNodes, &(profiler()), mBufferParams); +-- +2.39.2 + diff --git a/patches-aosp/frameworks/base/0001-Revert-Fix-crash-from-asynchronous-GPU-metrics.patch b/patches-aosp/frameworks/base/0001-Revert-Fix-crash-from-asynchronous-GPU-metrics.patch deleted file mode 100644 index c5cd133..0000000 --- a/patches-aosp/frameworks/base/0001-Revert-Fix-crash-from-asynchronous-GPU-metrics.patch +++ /dev/null @@ -1,82 +0,0 @@ -From cadc9a7ccb98d6ec38b605ea7088087541de54fb Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Wed, 29 Mar 2023 20:49:55 +0300 -Subject: [PATCH] Revert "Fix crash from asynchronous GPU metrics" - -This reverts commit 5d28aee1b1ac76e73db174535802bd2cc6069909. - -This commit causes race-condition in the following case: - -1. DrawFrame is out of free buffers and waiting for a new buffer to appear with - mFrameMetricsReporterMutex locked. -2. Binder can't finalize transaction staying in onSurfaceStatsAvailable, - waiting for the mutex to be released, blocking SF transactions, and - after 4s, the following logcat message appears: - -4866 V Surface : dequeueBuffer: IGraphicBufferProducer::dequeueBuffer(0, 0, 1, 0x200) failed: -110 -4866 W OpenGLRenderer: dequeueBuffer failed, error = -110; switching to fallback -4847 I Choreographer: Skipped 240 frames! The application may be doing too much work on its main thread. - -Change-Id: I12fa6824b75f8f108110b9336d5d2ea2da93814e -Signed-off-by: Roman Stratiienko ---- - libs/hwui/FrameInfoVisualizer.cpp | 2 +- - libs/hwui/renderthread/CanvasContext.cpp | 18 ++++-------------- - 2 files changed, 5 insertions(+), 15 deletions(-) - -diff --git a/libs/hwui/FrameInfoVisualizer.cpp b/libs/hwui/FrameInfoVisualizer.cpp -index 687e4dd324d3..3a8e559f6d7e 100644 ---- a/libs/hwui/FrameInfoVisualizer.cpp -+++ b/libs/hwui/FrameInfoVisualizer.cpp -@@ -179,7 +179,7 @@ void FrameInfoVisualizer::initializeRects(const int baseline, const int width) { - void FrameInfoVisualizer::nextBarSegment(FrameInfoIndex start, FrameInfoIndex end) { - int fast_i = (mNumFastRects - 1) * 4; - int janky_i = (mNumJankyRects - 1) * 4; -- -+ ; - for (size_t fi = 0; fi < mFrameSource.size(); fi++) { - if (mFrameSource[fi][FrameInfoIndex::Flags] & FrameInfoFlags::SkippedFrame) { - continue; -diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp -index 75d3ff7753cb..976117b9bbd4 100644 ---- a/libs/hwui/renderthread/CanvasContext.cpp -+++ b/libs/hwui/renderthread/CanvasContext.cpp -@@ -512,19 +512,9 @@ nsecs_t CanvasContext::draw() { - - ATRACE_FORMAT("Drawing " RECT_STRING, SK_RECT_ARGS(dirty)); - -- IRenderPipeline::DrawResult drawResult; -- { -- // FrameInfoVisualizer accesses the frame events, which cannot be mutated mid-draw -- // or it can lead to memory corruption. -- // This lock is overly broad, but it's the quickest fix since this mutex is otherwise -- // not visible to IRenderPipeline much less FrameInfoVisualizer. And since this is -- // the thread we're primarily concerned about being responsive, this being too broad -- // shouldn't pose a performance issue. -- std::scoped_lock lock(mFrameMetricsReporterMutex); -- drawResult = mRenderPipeline->draw(frame, windowDirty, dirty, mLightGeometry, -- &mLayerUpdateQueue, mContentDrawBounds, mOpaque, -- mLightInfo, mRenderNodes, &(profiler())); -- } -+ const auto drawResult = mRenderPipeline->draw(frame, windowDirty, dirty, mLightGeometry, -+ &mLayerUpdateQueue, mContentDrawBounds, mOpaque, -+ mLightInfo, mRenderNodes, &(profiler())); - - uint64_t frameCompleteNr = getFrameNumber(); - -@@ -764,11 +754,11 @@ void CanvasContext::onSurfaceStatsAvailable(void* context, int32_t surfaceContro - FrameInfo* frameInfo = instance->getFrameInfoFromLast4(frameNumber, surfaceControlId); - - if (frameInfo != nullptr) { -- std::scoped_lock lock(instance->mFrameMetricsReporterMutex); - frameInfo->set(FrameInfoIndex::FrameCompleted) = std::max(gpuCompleteTime, - frameInfo->get(FrameInfoIndex::SwapBuffersCompleted)); - frameInfo->set(FrameInfoIndex::GpuCompleted) = std::max( - gpuCompleteTime, frameInfo->get(FrameInfoIndex::CommandSubmissionCompleted)); -+ std::scoped_lock lock(instance->mFrameMetricsReporterMutex); - instance->mJankTracker.finishFrame(*frameInfo, instance->mFrameMetricsReporter, frameNumber, - surfaceControlId); - } --- -2.34.1 - diff --git a/patches-aosp/glodroid/bootloader/u-boot/0004-GLODROID-Speed-up-boot.patch b/patches-aosp/glodroid/bootloader/u-boot/0004-GLODROID-Speed-up-boot.patch index 852e02f..8fddb03 100644 --- a/patches-aosp/glodroid/bootloader/u-boot/0004-GLODROID-Speed-up-boot.patch +++ b/patches-aosp/glodroid/bootloader/u-boot/0004-GLODROID-Speed-up-boot.patch @@ -16,7 +16,7 @@ index f03b56ad6a..4ab246315a 100644 CONFIG_CONSOLE_SCROLL_LINES=10 CONFIG_PHYS_TO_BUS=y CONFIG_OF_LIBFDT_OVERLAY=y -+CONFIG_BOOTDELAY=0 ++CONFIG_BOOTDELAY=1 -- 2.37.2 diff --git a/patches-aosp/glodroid/configuration/0008-base-Remove-deprecated-BOARD_BUILD_SYSTEM_ROOT_IMAGE.patch b/patches-aosp/glodroid/configuration/0008-base-Remove-deprecated-BOARD_BUILD_SYSTEM_ROOT_IMAGE.patch new file mode 100644 index 0000000..e552d0d --- /dev/null +++ b/patches-aosp/glodroid/configuration/0008-base-Remove-deprecated-BOARD_BUILD_SYSTEM_ROOT_IMAGE.patch @@ -0,0 +1,26 @@ +From 08bf277bb68ef649949a83eb908a35666dc7fccf Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 6 Oct 2023 22:20:52 +0300 +Subject: [PATCH 08/12] base: Remove deprecated BOARD_BUILD_SYSTEM_ROOT_IMAGE + definition + +Signed-off-by: Roman Stratiienko +--- + common/base/board.mk | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/common/base/board.mk b/common/base/board.mk +index 82c4292..73158c5 100644 +--- a/common/base/board.mk ++++ b/common/base/board.mk +@@ -97,7 +97,6 @@ TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm + + # Root image + TARGET_COPY_OUT_ROOT := root +-BOARD_BUILD_SYSTEM_ROOT_IMAGE := false + + BOARD_EXT4_SHARE_DUP_BLOCKS := true + +-- +2.39.2 + diff --git a/patches-aosp/glodroid/configuration/0009-hals-usb-gadget-Use-AOSP-libusbconfigfs-2.patch b/patches-aosp/glodroid/configuration/0009-hals-usb-gadget-Use-AOSP-libusbconfigfs-2.patch new file mode 100644 index 0000000..0c4d805 --- /dev/null +++ b/patches-aosp/glodroid/configuration/0009-hals-usb-gadget-Use-AOSP-libusbconfigfs-2.patch @@ -0,0 +1,754 @@ +From d48d156bb8f5a212f004a5383505220cfba323e9 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 6 Oct 2023 22:21:43 +0300 +Subject: [PATCH 09/12] hals/usb-gadget: Use AOSP libusbconfigfs-2 + +It already has all the required functionality. + +Signed-off-by: Roman Stratiienko +--- + hals/usb-gadget/Android.bp | 2 +- + hals/usb-gadget/lib/Android.bp | 41 --- + hals/usb-gadget/lib/MonitorFfs.cpp | 269 ------------------ + hals/usb-gadget/lib/UsbGadgetUtils.cpp | 207 -------------- + hals/usb-gadget/lib/include/UsbGadgetCommon.h | 179 ------------ + 5 files changed, 1 insertion(+), 697 deletions(-) + delete mode 100644 hals/usb-gadget/lib/Android.bp + delete mode 100644 hals/usb-gadget/lib/MonitorFfs.cpp + delete mode 100644 hals/usb-gadget/lib/UsbGadgetUtils.cpp + delete mode 100644 hals/usb-gadget/lib/include/UsbGadgetCommon.h + +diff --git a/hals/usb-gadget/Android.bp b/hals/usb-gadget/Android.bp +index 3c3ea45..64b1250 100644 +--- a/hals/usb-gadget/Android.bp ++++ b/hals/usb-gadget/Android.bp +@@ -36,5 +36,5 @@ cc_binary { + "liblog", + "libutils", + ], +- static_libs: ["libusbconfigfs-2-gd"], ++ static_libs: ["libusbconfigfs-2"], + } +diff --git a/hals/usb-gadget/lib/Android.bp b/hals/usb-gadget/lib/Android.bp +deleted file mode 100644 +index 3c57acb..0000000 +--- a/hals/usb-gadget/lib/Android.bp ++++ /dev/null +@@ -1,41 +0,0 @@ +-/* +- * Copyright (C) 2020 The Android Open Source Project +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-cc_library_static { +- name: "libusbconfigfs-2-gd", +- vendor_available: true, +- export_include_dirs: ["include"], +- +- srcs: [ +- "UsbGadgetUtils.cpp", +- "MonitorFfs.cpp", +- ], +- +- cflags: [ +- "-Wall", +- "-Werror", +- ], +- +- shared_libs: [ +- "android.hardware.usb.gadget@1.0", +- "android.hardware.usb.gadget@1.1", +- "android.hardware.usb.gadget@1.2", +- "libbase", +- "libcutils", +- "libhidlbase", +- "libutils", +- ], +-} +diff --git a/hals/usb-gadget/lib/MonitorFfs.cpp b/hals/usb-gadget/lib/MonitorFfs.cpp +deleted file mode 100644 +index 0cdf038..0000000 +--- a/hals/usb-gadget/lib/MonitorFfs.cpp ++++ /dev/null +@@ -1,269 +0,0 @@ +-/* +- * Copyright (C) 2020 The Android Open Source Project +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#define LOG_TAG "libusbconfigfs" +- +-#include "include/UsbGadgetCommon.h" +- +-namespace android { +-namespace hardware { +-namespace usb { +-namespace gadget { +- +-static volatile bool gadgetPullup; +- +-MonitorFfs::MonitorFfs(const char* const gadget) +- : mWatchFd(), +- mEndpointList(), +- mLock(), +- mCv(), +- mLockFd(), +- mCurrentUsbFunctionsApplied(false), +- mMonitor(), +- mCallback(NULL), +- mPayload(NULL), +- mGadgetName(gadget), +- mMonitorRunning(false) { +- unique_fd eventFd(eventfd(0, 0)); +- if (eventFd == -1) { +- ALOGE("mEventFd failed to create %d", errno); +- abort(); +- } +- +- unique_fd epollFd(epoll_create(2)); +- if (epollFd == -1) { +- ALOGE("mEpollFd failed to create %d", errno); +- abort(); +- } +- +- unique_fd inotifyFd(inotify_init()); +- if (inotifyFd < 0) { +- ALOGE("inotify init failed"); +- abort(); +- } +- +- if (addEpollFd(epollFd, inotifyFd) == -1) abort(); +- +- if (addEpollFd(epollFd, eventFd) == -1) abort(); +- +- mEpollFd = move(epollFd); +- mInotifyFd = move(inotifyFd); +- mEventFd = move(eventFd); +- gadgetPullup = false; +-} +- +-static void displayInotifyEvent(struct inotify_event* i) { +- ALOGE(" wd =%2d; ", i->wd); +- if (i->cookie > 0) ALOGE("cookie =%4d; ", i->cookie); +- +- ALOGE("mask = "); +- if (i->mask & IN_ACCESS) ALOGE("IN_ACCESS "); +- if (i->mask & IN_ATTRIB) ALOGE("IN_ATTRIB "); +- if (i->mask & IN_CLOSE_NOWRITE) ALOGE("IN_CLOSE_NOWRITE "); +- if (i->mask & IN_CLOSE_WRITE) ALOGE("IN_CLOSE_WRITE "); +- if (i->mask & IN_CREATE) ALOGE("IN_CREATE "); +- if (i->mask & IN_DELETE) ALOGE("IN_DELETE "); +- if (i->mask & IN_DELETE_SELF) ALOGE("IN_DELETE_SELF "); +- if (i->mask & IN_IGNORED) ALOGE("IN_IGNORED "); +- if (i->mask & IN_ISDIR) ALOGE("IN_ISDIR "); +- if (i->mask & IN_MODIFY) ALOGE("IN_MODIFY "); +- if (i->mask & IN_MOVE_SELF) ALOGE("IN_MOVE_SELF "); +- if (i->mask & IN_MOVED_FROM) ALOGE("IN_MOVED_FROM "); +- if (i->mask & IN_MOVED_TO) ALOGE("IN_MOVED_TO "); +- if (i->mask & IN_OPEN) ALOGE("IN_OPEN "); +- if (i->mask & IN_Q_OVERFLOW) ALOGE("IN_Q_OVERFLOW "); +- if (i->mask & IN_UNMOUNT) ALOGE("IN_UNMOUNT "); +- ALOGE("\n"); +- +- if (i->len > 0) ALOGE(" name = %s\n", i->name); +-} +- +-void* MonitorFfs::startMonitorFd(void* param) { +- MonitorFfs* monitorFfs = (MonitorFfs*)param; +- char buf[kBufferSize]; +- bool writeUdc = true, stopMonitor = false; +- struct epoll_event events[kEpollEvents]; +- steady_clock::time_point disconnect; +- +- bool descriptorWritten = true; +- for (int i = 0; i < static_cast(monitorFfs->mEndpointList.size()); i++) { +- if (access(monitorFfs->mEndpointList.at(i).c_str(), R_OK)) { +- descriptorWritten = false; +- break; +- } +- } +- +- // notify here if the endpoints are already present. +- if (descriptorWritten) { +- usleep(kPullUpDelay); +- if (!!WriteStringToFile(monitorFfs->mGadgetName, PULLUP_PATH)) { +- lock_guard lock(monitorFfs->mLock); +- monitorFfs->mCurrentUsbFunctionsApplied = true; +- monitorFfs->mCallback(monitorFfs->mCurrentUsbFunctionsApplied, monitorFfs->mPayload); +- gadgetPullup = true; +- writeUdc = false; +- ALOGI("GADGET pulled up"); +- monitorFfs->mCv.notify_all(); +- } +- } +- +- while (!stopMonitor) { +- int nrEvents = epoll_wait(monitorFfs->mEpollFd, events, kEpollEvents, -1); +- +- if (nrEvents <= 0) { +- ALOGE("epoll wait did not return descriptor number"); +- continue; +- } +- +- for (int i = 0; i < nrEvents; i++) { +- ALOGI("event=%u on fd=%d\n", events[i].events, events[i].data.fd); +- +- if (events[i].data.fd == monitorFfs->mInotifyFd) { +- // Process all of the events in buffer returned by read(). +- int numRead = read(monitorFfs->mInotifyFd, buf, kBufferSize); +- for (char* p = buf; p < buf + numRead;) { +- struct inotify_event* event = (struct inotify_event*)p; +- if (kDebug) displayInotifyEvent(event); +- +- p += sizeof(struct inotify_event) + event->len; +- +- bool descriptorPresent = true; +- for (int j = 0; j < static_cast(monitorFfs->mEndpointList.size()); j++) { +- if (access(monitorFfs->mEndpointList.at(j).c_str(), R_OK)) { +- if (kDebug) ALOGI("%s absent", monitorFfs->mEndpointList.at(j).c_str()); +- descriptorPresent = false; +- break; +- } +- } +- +- if (!descriptorPresent && !writeUdc) { +- if (kDebug) ALOGI("endpoints not up"); +- writeUdc = true; +- disconnect = std::chrono::steady_clock::now(); +- } else if (descriptorPresent && writeUdc) { +- steady_clock::time_point temp = steady_clock::now(); +- +- if (std::chrono::duration_cast(temp - disconnect).count() < +- kPullUpDelay) +- usleep(kPullUpDelay); +- +- if (!!WriteStringToFile(monitorFfs->mGadgetName, PULLUP_PATH)) { +- lock_guard lock(monitorFfs->mLock); +- monitorFfs->mCurrentUsbFunctionsApplied = true; +- monitorFfs->mCallback(monitorFfs->mCurrentUsbFunctionsApplied, +- monitorFfs->mPayload); +- ALOGI("GADGET pulled up"); +- writeUdc = false; +- gadgetPullup = true; +- // notify the main thread to signal userspace. +- monitorFfs->mCv.notify_all(); +- } +- } +- } +- } else { +- uint64_t flag; +- read(monitorFfs->mEventFd, &flag, sizeof(flag)); +- if (flag == 100) { +- stopMonitor = true; +- break; +- } +- } +- } +- } +- return NULL; +-} +- +-void MonitorFfs::reset() { +- lock_guard lock(mLockFd); +- uint64_t flag = 100; +- unsigned long ret; +- +- if (mMonitorRunning) { +- // Stop the monitor thread by writing into signal fd. +- ret = TEMP_FAILURE_RETRY(write(mEventFd, &flag, sizeof(flag))); +- if (ret < 0) ALOGE("Error writing eventfd errno=%d", errno); +- +- ALOGI("mMonitor signalled to exit"); +- mMonitor->join(); +- ALOGI("mMonitor destroyed"); +- mMonitorRunning = false; +- } +- +- for (std::vector::size_type i = 0; i != mWatchFd.size(); i++) +- inotify_rm_watch(mInotifyFd, mWatchFd[i]); +- +- mEndpointList.clear(); +- gadgetPullup = false; +- mCallback = NULL; +- mPayload = NULL; +-} +- +-bool MonitorFfs::startMonitor() { +- mMonitor = unique_ptr(new thread(this->startMonitorFd, this)); +- mMonitorRunning = true; +- return true; +-} +- +-bool MonitorFfs::isMonitorRunning() { +- return mMonitorRunning; +-} +- +-bool MonitorFfs::waitForPullUp(int timeout_ms) { +- std::unique_lock lk(mLock); +- +- if (gadgetPullup) return true; +- +- if (mCv.wait_for(lk, timeout_ms * 1ms, [] { return gadgetPullup; })) { +- ALOGI("monitorFfs signalled true"); +- return true; +- } else { +- ALOGI("monitorFfs signalled error"); +- // continue monitoring as the descriptors might be written at a later +- // point. +- return false; +- } +-} +- +-bool MonitorFfs::addInotifyFd(string fd) { +- lock_guard lock(mLockFd); +- int wfd; +- +- wfd = inotify_add_watch(mInotifyFd, fd.c_str(), IN_ALL_EVENTS); +- if (wfd == -1) +- return false; +- else +- mWatchFd.push_back(wfd); +- +- return true; +-} +- +-void MonitorFfs::addEndPoint(string ep) { +- lock_guard lock(mLockFd); +- +- mEndpointList.push_back(ep); +-} +- +-void MonitorFfs::registerFunctionsAppliedCallback(void (*callback)(bool functionsApplied, +- void* payload), +- void* payload) { +- mCallback = callback; +- mPayload = payload; +-} +- +-} // namespace gadget +-} // namespace usb +-} // namespace hardware +-} // namespace android +diff --git a/hals/usb-gadget/lib/UsbGadgetUtils.cpp b/hals/usb-gadget/lib/UsbGadgetUtils.cpp +deleted file mode 100644 +index 0924da7..0000000 +--- a/hals/usb-gadget/lib/UsbGadgetUtils.cpp ++++ /dev/null +@@ -1,207 +0,0 @@ +-/* +- * Copyright (C) 2020 The Android Open Source Project +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#define LOG_TAG "libusbconfigfs" +- +-#include "include/UsbGadgetCommon.h" +- +-namespace android { +-namespace hardware { +-namespace usb { +-namespace gadget { +- +-int unlinkFunctions(const char* path) { +- DIR* config = opendir(path); +- struct dirent* function; +- char filepath[kMaxFilePathLength]; +- int ret = 0; +- +- if (config == NULL) return -1; +- +- // d_type does not seems to be supported in /config +- // so filtering by name. +- while (((function = readdir(config)) != NULL)) { +- if ((strstr(function->d_name, FUNCTION_NAME) == NULL)) continue; +- // build the path for each file in the folder. +- sprintf(filepath, "%s/%s", path, function->d_name); +- ret = remove(filepath); +- if (ret) { +- ALOGE("Unable remove file %s errno:%d", filepath, errno); +- break; +- } +- } +- +- closedir(config); +- return ret; +-} +- +-int addEpollFd(const unique_fd& epfd, const unique_fd& fd) { +- struct epoll_event event; +- int ret; +- +- event.data.fd = fd; +- event.events = EPOLLIN; +- +- ret = epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &event); +- if (ret) ALOGE("epoll_ctl error %d", errno); +- +- return ret; +-} +- +-int linkFunction(const char* function, int index) { +- char functionPath[kMaxFilePathLength]; +- char link[kMaxFilePathLength]; +- +- sprintf(functionPath, "%s%s", FUNCTIONS_PATH, function); +- sprintf(link, "%s%d", FUNCTION_PATH, index); +- if (symlink(functionPath, link)) { +- ALOGE("Cannot create symlink %s -> %s errno:%d", link, functionPath, errno); +- return -1; +- } +- return 0; +-} +- +-Status setVidPid(const char* vid, const char* pid) { +- if (!WriteStringToFile(vid, VENDOR_ID_PATH)) return Status::ERROR; +- +- if (!WriteStringToFile(pid, PRODUCT_ID_PATH)) return Status::ERROR; +- +- return Status::SUCCESS; +-} +- +-std::string getVendorFunctions() { +- if (GetProperty(kBuildType, "") == "user") return "user"; +- +- std::string bootMode = GetProperty(PERSISTENT_BOOT_MODE, ""); +- std::string persistVendorFunctions = GetProperty(kPersistentVendorConfig, ""); +- std::string vendorFunctions = GetProperty(kVendorConfig, ""); +- std::string ret = ""; +- +- if (vendorFunctions != "") { +- ret = vendorFunctions; +- } else if (bootMode == "usbradio" || bootMode == "factory" || bootMode == "ffbm-00" || +- bootMode == "ffbm-01") { +- if (persistVendorFunctions != "") +- ret = persistVendorFunctions; +- else +- ret = "diag"; +- // vendor.usb.config will reflect the current configured functions +- SetProperty(kVendorConfig, ret); +- } +- +- return ret; +-} +- +-Status resetGadget() { +- ALOGI("setCurrentUsbFunctions None"); +- +- if (!WriteStringToFile("none", PULLUP_PATH)) ALOGI("Gadget cannot be pulled down"); +- +- if (!WriteStringToFile("0", DEVICE_CLASS_PATH)) return Status::ERROR; +- +- if (!WriteStringToFile("0", DEVICE_SUB_CLASS_PATH)) return Status::ERROR; +- +- if (!WriteStringToFile("0", DEVICE_PROTOCOL_PATH)) return Status::ERROR; +- +- if (!WriteStringToFile("0", DESC_USE_PATH)) return Status::ERROR; +- +- if (unlinkFunctions(CONFIG_PATH)) return Status::ERROR; +- +- return Status::SUCCESS; +-} +- +-Status addGenericAndroidFunctions(MonitorFfs* monitorFfs, uint64_t functions, bool* ffsEnabled, +- int* functionCount) { +- if (((functions & GadgetFunction::MTP) != 0)) { +- *ffsEnabled = true; +- ALOGI("setCurrentUsbFunctions mtp"); +- if (!WriteStringToFile("1", DESC_USE_PATH)) return Status::ERROR; +- +- if (!monitorFfs->addInotifyFd("/dev/usb-ffs/mtp/")) return Status::ERROR; +- +- if (linkFunction("ffs.mtp", (*functionCount)++)) return Status::ERROR; +- +- // Add endpoints to be monitored. +- monitorFfs->addEndPoint("/dev/usb-ffs/mtp/ep1"); +- monitorFfs->addEndPoint("/dev/usb-ffs/mtp/ep2"); +- monitorFfs->addEndPoint("/dev/usb-ffs/mtp/ep3"); +- } else if (((functions & GadgetFunction::PTP) != 0)) { +- *ffsEnabled = true; +- ALOGI("setCurrentUsbFunctions ptp"); +- if (!WriteStringToFile("1", DESC_USE_PATH)) return Status::ERROR; +- +- if (!monitorFfs->addInotifyFd("/dev/usb-ffs/ptp/")) return Status::ERROR; +- +- if (linkFunction("ffs.ptp", (*functionCount)++)) return Status::ERROR; +- +- // Add endpoints to be monitored. +- monitorFfs->addEndPoint("/dev/usb-ffs/ptp/ep1"); +- monitorFfs->addEndPoint("/dev/usb-ffs/ptp/ep2"); +- monitorFfs->addEndPoint("/dev/usb-ffs/ptp/ep3"); +- } +- +- if ((functions & GadgetFunction::MIDI) != 0) { +- ALOGI("setCurrentUsbFunctions MIDI"); +- if (linkFunction("midi.gs5", (*functionCount)++)) return Status::ERROR; +- } +- +- if ((functions & GadgetFunction::ACCESSORY) != 0) { +- ALOGI("setCurrentUsbFunctions Accessory"); +- if (linkFunction("accessory.gs2", (*functionCount)++)) return Status::ERROR; +- } +- +- if ((functions & GadgetFunction::AUDIO_SOURCE) != 0) { +- ALOGI("setCurrentUsbFunctions Audio Source"); +- if (linkFunction("audio_source.gs3", (*functionCount)++)) return Status::ERROR; +- } +- +- if ((functions & GadgetFunction::RNDIS) != 0) { +- ALOGI("setCurrentUsbFunctions rndis"); +- std::string rndisFunction = GetProperty(kVendorRndisConfig, ""); +- if (rndisFunction != "") { +- if (linkFunction(rndisFunction.c_str(), (*functionCount)++)) return Status::ERROR; +- } else { +- // link gsi.rndis for older pixel projects +- if (linkFunction("gsi.rndis", (*functionCount)++)) return Status::ERROR; +- } +- } +- +- if ((functions & GadgetFunction::NCM) != 0) { +- ALOGI("setCurrentUsbFunctions ncm"); +- if (linkFunction("ncm.gs6", (*functionCount)++)) return Status::ERROR; +- } +- +- return Status::SUCCESS; +-} +- +-Status addAdb(MonitorFfs* monitorFfs, int* functionCount) { +- ALOGI("setCurrentUsbFunctions Adb"); +- if (!WriteStringToFile("1", DESC_USE_PATH)) +- return Status::ERROR; +- +- if (!monitorFfs->addInotifyFd("/dev/usb-ffs/adb/")) return Status::ERROR; +- +- if (linkFunction("ffs.adb", (*functionCount)++)) return Status::ERROR; +- monitorFfs->addEndPoint("/dev/usb-ffs/adb/ep1"); +- monitorFfs->addEndPoint("/dev/usb-ffs/adb/ep2"); +- ALOGI("Service started"); +- return Status::SUCCESS; +-} +- +-} // namespace gadget +-} // namespace usb +-} // namespace hardware +-} // namespace android +diff --git a/hals/usb-gadget/lib/include/UsbGadgetCommon.h b/hals/usb-gadget/lib/include/UsbGadgetCommon.h +deleted file mode 100644 +index 18b8101..0000000 +--- a/hals/usb-gadget/lib/include/UsbGadgetCommon.h ++++ /dev/null +@@ -1,179 +0,0 @@ +-/* +- * Copyright (C) 2020 The Android Open Source Project +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-#ifndef HARDWARE_USB_USBGADGETCOMMON_H +-#define HARDWARE_USB_USBGADGETCOMMON_H +- +-#include +-#include +-#include +- +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-namespace android { +-namespace hardware { +-namespace usb { +-namespace gadget { +- +-constexpr int kBufferSize = 512; +-constexpr int kMaxFilePathLength = 256; +-constexpr int kEpollEvents = 10; +-constexpr bool kDebug = false; +-constexpr int kDisconnectWaitUs = 100000; +-constexpr int kPullUpDelay = 500000; +-constexpr int kShutdownMonitor = 100; +- +-constexpr char kBuildType[] = "ro.build.type"; +-constexpr char kPersistentVendorConfig[] = "persist.vendor.usb.usbradio.config"; +-constexpr char kVendorConfig[] = "vendor.usb.config"; +-constexpr char kVendorRndisConfig[] = "vendor.usb.rndis.config"; +- +-#define GADGET_PATH "/config/usb_gadget/g1/" +-#define PULLUP_PATH GADGET_PATH "UDC" +-#define PERSISTENT_BOOT_MODE "ro.bootmode" +-#define VENDOR_ID_PATH GADGET_PATH "idVendor" +-#define PRODUCT_ID_PATH GADGET_PATH "idProduct" +-#define DEVICE_CLASS_PATH GADGET_PATH "bDeviceClass" +-#define DEVICE_SUB_CLASS_PATH GADGET_PATH "bDeviceSubClass" +-#define DEVICE_PROTOCOL_PATH GADGET_PATH "bDeviceProtocol" +-#define DESC_USE_PATH GADGET_PATH "os_desc/use" +-#define OS_DESC_PATH GADGET_PATH "os_desc/b.1" +-#define CONFIG_PATH GADGET_PATH "configs/b.1/" +-#define FUNCTIONS_PATH GADGET_PATH "functions/" +-#define FUNCTION_NAME "function" +-#define FUNCTION_PATH CONFIG_PATH FUNCTION_NAME +-#define RNDIS_PATH FUNCTIONS_PATH "gsi.rndis" +- +-using ::android::base::GetProperty; +-using ::android::base::SetProperty; +-using ::android::base::unique_fd; +-using ::android::base::WriteStringToFile; +-using ::android::hardware::usb::gadget::V1_0::Status; +-using ::android::hardware::usb::gadget::V1_2::GadgetFunction; +- +-using ::std::lock_guard; +-using ::std::move; +-using ::std::mutex; +-using ::std::string; +-using ::std::thread; +-using ::std::unique_ptr; +-using ::std::vector; +-using ::std::chrono::microseconds; +-using ::std::chrono::steady_clock; +-using ::std::literals::chrono_literals::operator""ms; +- +-// MonitorFfs automously manages gadget pullup by monitoring +-// the ep file status. Restarts the usb gadget when the ep +-// owner restarts. +-class MonitorFfs { +- private: +- // Monitors the endpoints Inotify events. +- unique_fd mInotifyFd; +- // Control pipe for shutting down the mMonitor thread. +- // mMonitor exits when SHUTDOWN_MONITOR is written into +- // mEventFd/ +- unique_fd mEventFd; +- // Pools on mInotifyFd and mEventFd. +- unique_fd mEpollFd; +- vector mWatchFd; +- +- // Maintains the list of Endpoints. +- vector mEndpointList; +- // protects the CV. +- std::mutex mLock; +- std::condition_variable mCv; +- // protects mInotifyFd, mEpollFd. +- std::mutex mLockFd; +- +- // Flag to maintain the current status of gadget pullup. +- bool mCurrentUsbFunctionsApplied; +- +- // Thread object that executes the ep monitoring logic. +- unique_ptr mMonitor; +- // Callback to be invoked when gadget is pulled up. +- void (*mCallback)(bool functionsApplied, void* payload); +- void* mPayload; +- // Name of the USB gadget. Used for pullup. +- const char* const mGadgetName; +- // Monitor State +- bool mMonitorRunning; +- +- public: +- MonitorFfs(const char* const gadget); +- // Inits all the UniqueFds. +- void reset(); +- // Starts monitoring endpoints and pullup the gadget when +- // the descriptors are written. +- bool startMonitor(); +- // Waits for timeout_ms for gadget pull up to happen. +- // Returns immediately if the gadget is already pulled up. +- bool waitForPullUp(int timeout_ms); +- // Adds the given fd to the watch list. +- bool addInotifyFd(string fd); +- // Adds the given endpoint to the watch list. +- void addEndPoint(string ep); +- // Registers the async callback from the caller to notify the caller +- // when the gadget pull up happens. +- void registerFunctionsAppliedCallback(void (*callback)(bool functionsApplied, void*(payload)), +- void* payload); +- bool isMonitorRunning(); +- // Ep monitoring and the gadget pull up logic. +- static void* startMonitorFd(void* param); +-}; +- +-//**************** Helper functions ************************// +- +-// Adds the given fd to the epollfd(epfd). +-int addEpollFd(const unique_fd& epfd, const unique_fd& fd); +-// Removes all the usb functions link in the specified path. +-int unlinkFunctions(const char* path); +-// Craetes a configfs link for the function. +-int linkFunction(const char* function, int index); +-// Sets the USB VID and PID. +-Status setVidPid(const char* vid, const char* pid); +-// Extracts vendor functions from the vendor init properties. +-std::string getVendorFunctions(); +-// Adds Adb to the usb configuration. +-Status addAdb(MonitorFfs* monitorFfs, int* functionCount); +-// Adds all applicable generic android usb functions other than ADB. +-Status addGenericAndroidFunctions(MonitorFfs* monitorFfs, uint64_t functions, bool* ffsEnabled, +- int* functionCount); +-// Pulls down USB gadget. +-Status resetGadget(); +- +-} // namespace gadget +-} // namespace usb +-} // namespace hardware +-} // namespace android +-#endif +-- +2.39.2 + diff --git a/patches-aosp/glodroid/configuration/0010-platform-kernel-Rename-mkdtboimg.py-to-mkdtboimg.patch b/patches-aosp/glodroid/configuration/0010-platform-kernel-Rename-mkdtboimg.py-to-mkdtboimg.patch new file mode 100644 index 0000000..1351561 --- /dev/null +++ b/patches-aosp/glodroid/configuration/0010-platform-kernel-Rename-mkdtboimg.py-to-mkdtboimg.patch @@ -0,0 +1,28 @@ +From fd603a41fb896f19960d406bbe8bcaa0e1efb5d2 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 6 Oct 2023 22:23:21 +0300 +Subject: [PATCH 10/12] platform/kernel: Rename mkdtboimg.py to mkdtboimg + +It was renamed in AOSP. Do the same here. + +Signed-off-by: Roman Stratiienko +--- + platform/kernel/kernel.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/platform/kernel/kernel.mk b/platform/kernel/kernel.mk +index b44808c..d49b729 100644 +--- a/platform/kernel/kernel.mk ++++ b/platform/kernel/kernel.mk +@@ -66,7 +66,7 @@ ANDROID_DTS_OVERLAY ?= $(LOCAL_PATH)/empty.dts + + ANDROID_DTBO := $(PRODUCT_OUT)/obj/GLODROID/DTBO/fstab-android-sdcard.dtbo + BOARD_PREBUILT_DTBOIMAGE := $(PRODUCT_OUT)/boot_dtbo.img +-MKDTBOIMG := $(HOST_OUT_EXECUTABLES)/mkdtboimg.py ++MKDTBOIMG := $(HOST_OUT_EXECUTABLES)/mkdtboimg + GEN_DTBCFG := $(PRODUCT_OUT)/gen/DTBO/dtbo.cfg + + $(TARGET_VENDOR_MODULES)/modules.dep: $(KERNEL_TARGET) +-- +2.39.2 + diff --git a/patches-aosp/glodroid/configuration/0011-base-Set-TARGET_FLATTEN_APEX-to-true.patch b/patches-aosp/glodroid/configuration/0011-base-Set-TARGET_FLATTEN_APEX-to-true.patch new file mode 100644 index 0000000..fee42c5 --- /dev/null +++ b/patches-aosp/glodroid/configuration/0011-base-Set-TARGET_FLATTEN_APEX-to-true.patch @@ -0,0 +1,27 @@ +From 6186d9cec9d353ea537e179c23978c4fe7577017 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Thu, 19 Oct 2023 03:19:47 +0300 +Subject: [PATCH 11/12] base: Set TARGET_FLATTEN_APEX to true + +Android-14 requires either TARGET_FLATTEN_APEX to be set to true or +ro.apex.updatable sysprop set to true. Otherwise, init will enter a +boot loop. + +Signed-off-by: Roman Stratiienko +--- + common/base/device.mk | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/common/base/device.mk b/common/base/device.mk +index d0210bf..c086dfe 100644 +--- a/common/base/device.mk ++++ b/common/base/device.mk +@@ -74,3 +74,5 @@ PRODUCT_PACKAGES += \ + update_engine_client \ + update_verifier \ + update_engine_sideload \ ++ ++TARGET_FLATTEN_APEX := true +-- +2.39.2 + diff --git a/patches-aosp/glodroid/configuration/0012-other-hals-Upgrade-boot-control-HAL-to-AIDL.patch b/patches-aosp/glodroid/configuration/0012-other-hals-Upgrade-boot-control-HAL-to-AIDL.patch new file mode 100644 index 0000000..94a6aac --- /dev/null +++ b/patches-aosp/glodroid/configuration/0012-other-hals-Upgrade-boot-control-HAL-to-AIDL.patch @@ -0,0 +1,31 @@ +From 3d47f9824871fca0f8faba3b79f74a0e61f4e837 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Thu, 19 Oct 2023 03:23:37 +0300 +Subject: [PATCH 12/12] other-hals: Upgrade boot control HAL to AIDL + +Just an upgrade. + +Signed-off-by: Roman Stratiienko +--- + common/other-hals/device.mk | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/common/other-hals/device.mk b/common/other-hals/device.mk +index 29ebba7..87c4735 100644 +--- a/common/other-hals/device.mk ++++ b/common/other-hals/device.mk +@@ -24,9 +24,8 @@ endif + + ifeq ($(GD_NO_DEFAULT_BOOTCTL),) + PRODUCT_PACKAGES += \ +- android.hardware.boot@1.2-impl \ +- android.hardware.boot@1.2-impl.recovery \ +- android.hardware.boot@1.2-service \ ++ android.hardware.boot-service.default \ ++ android.hardware.boot-service.default_recovery \ + + endif + +-- +2.39.2 + diff --git a/patches-aosp/glodroid/kernel/broadcom/0001-Fix-clang17-errors.patch b/patches-aosp/glodroid/kernel/broadcom/0001-Fix-clang17-errors.patch new file mode 100644 index 0000000..6410fc8 --- /dev/null +++ b/patches-aosp/glodroid/kernel/broadcom/0001-Fix-clang17-errors.patch @@ -0,0 +1,30 @@ +From 211afa3f4e09957540cdc2a837d8acc161d6c7e6 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 6 Oct 2023 22:25:30 +0300 +Subject: [PATCH] Fix clang17 errors + +Clang17 does not like signed bitfields + +Signed-off-by: Roman Stratiienko +--- + drivers/staging/vc04_services/vc-sm-cma/vc_sm.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/staging/vc04_services/vc-sm-cma/vc_sm.h b/drivers/staging/vc04_services/vc-sm-cma/vc_sm.h +index f1c7b95b14ce..56fd8e9ad259 100644 +--- a/drivers/staging/vc04_services/vc-sm-cma/vc_sm.h ++++ b/drivers/staging/vc04_services/vc-sm-cma/vc_sm.h +@@ -57,8 +57,8 @@ struct vc_sm_buffer { + + char name[VC_SM_MAX_NAME_LEN]; + +- int in_use:1; /* Kernel is still using this resource */ +- int imported:1; /* Imported dmabuf */ ++ unsigned int in_use:1; /* Kernel is still using this resource */ ++ unsigned int imported:1; /* Imported dmabuf */ + + enum vc_sm_vpu_mapping_state vpu_state; + u32 vc_handle; /* VideoCore handle for this buffer */ +-- +2.39.2 + diff --git a/patches-aosp/glodroid/vendor/aospext/0001-Add-support-for-building-ffmpeg_codec2-using-meson.patch b/patches-aosp/glodroid/vendor/aospext/0001-Add-support-for-building-ffmpeg_codec2-using-meson.patch deleted file mode 100644 index 9b0e9b1..0000000 --- a/patches-aosp/glodroid/vendor/aospext/0001-Add-support-for-building-ffmpeg_codec2-using-meson.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 295dc3a529d4536273429238d0006235f179cb07 Mon Sep 17 00:00:00 2001 -From: Roman Stratiienko -Date: Sun, 9 Apr 2023 23:51:36 +0300 -Subject: [PATCH 3/3] Add support for building ffmpeg_codec2 using meson - -Signed-off-by: Roman Stratiienko ---- - Android.mk | 1 + - meson_ffmpegcodec2.mk | 60 +++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 61 insertions(+) - create mode 100644 meson_ffmpegcodec2.mk - -diff --git a/Android.mk b/Android.mk -index af613fe..4e6d7a9 100644 ---- a/Android.mk -+++ b/Android.mk -@@ -18,4 +18,5 @@ include $(LOCAL_PATH)/meson_libqmi.mk - include $(LOCAL_PATH)/meson_minigbm.mk - include $(LOCAL_PATH)/meson_modemmanager.mk - include $(LOCAL_PATH)/meson_drmhwcomposer.mk -+include $(LOCAL_PATH)/meson_ffmpegcodec2.mk - include $(LOCAL_PATH)/ffmpeg.mk -diff --git a/meson_ffmpegcodec2.mk b/meson_ffmpegcodec2.mk -new file mode 100644 -index 0000000..e6d6312 ---- /dev/null -+++ b/meson_ffmpegcodec2.mk -@@ -0,0 +1,60 @@ -+# SPDX-License-Identifier: Apache-2.0 -+# -+# AOSPEXT project (https://github.com/GloDroid/aospext) -+# -+# Copyright (C) 2021 GlobalLogic Ukraine -+# Copyright (C) 2021-2022 Roman Stratiienko (r.stratiienko@gmail.com) -+ -+AOSPEXT_PROJECT_NAME := FFMPEGCODEC2 -+ -+ifneq ($(filter true, $(BOARD_BUILD_AOSPEXT_FFMPEGCODEC2)),) -+ -+LOCAL_PATH := $(call my-dir) -+ -+include $(CLEAR_VARS) -+ -+LOCAL_SHARED_LIBRARIES := \ -+ android.hardware.media.c2@1.2 \ -+ libavcodec \ -+ libavutil \ -+ libavformat \ -+ libavservices_minijail \ -+ libbase \ -+ libbinder \ -+ libcodec2_hidl@1.2 \ -+ libcodec2_soft_common \ -+ libcodec2_vndk \ -+ libhidlbase \ -+ liblog \ -+ libstagefright_foundation \ -+ libswresample \ -+ libswscale \ -+ libutils \ -+ libcutils \ -+ -+MESON_GEN_PKGCONFIGS := cutils drm hardware hidlbase log sync ui utils -+ -+MESON_BUILD_ARGUMENTS := \ -+ -+# Format: TYPE:REL_PATH_TO_INSTALL_ARTIFACT:VENDOR_SUBDIR:MODULE_NAME:SYMLINK_SUFFIX -+# TYPE one of: lib, bin, etc -+AOSPEXT_GEN_TARGETS := \ -+ bin:hw/android.hardware.media.c2@1.2-service-ffmpeg:hw:android.hardware.media.c2@1.2-service-ffmpeg: \ -+ etc:init/android.hardware.media.c2@1.2-service-ffmpeg.rc:init:android.hardware.media.c2@1.2-service-ffmpeg.rc: \ -+ etc:vintf/manifest/android.hardware.media.c2@1.2-service-ffmpeg.xml:vintf/manifest:android.hardware.media.c2@1.2-service-ffmpeg.xml: \ -+ etc:media_codecs_ffmpeg_c2.xml::media_codecs_ffmpeg_c2.xml: \ -+ $(BOARD_FFMPEGCODEC2_EXTRA_TARGETS) -+ -+# HWC3 -+ -+# Build first ARCH only -+LOCAL_MULTILIB := first -+include $(LOCAL_PATH)/meson_cross.mk -+AOSPEXT_TARGETS_DEP:=$(MESON_GEN_FILES_TARGET) -+AOSPEXT_PROJECT_INSTALL_DIR:=$(dir $(AOSPEXT_TARGETS_DEP))/install -+AOSPEXT_PROJECT_OUT_INCLUDE_DIR:= -+include $(LOCAL_PATH)/aospext_gen_targets.mk -+ -+#------------------------------------------------------------------------------- -+ -+endif # BOARD_BUILD_AOSPEXT_FFMPEGCODEC2 --- -2.37.2 - diff --git a/patches-aosp/glodroid/vendor/aospext/0002-RPI4-FFMPEG-Enable-hardware-codecs.patch b/patches-aosp/glodroid/vendor/aospext/0001-RPI4-FFMPEG-Enable-hardware-codecs.patch similarity index 100% rename from patches-aosp/glodroid/vendor/aospext/0002-RPI4-FFMPEG-Enable-hardware-codecs.patch rename to patches-aosp/glodroid/vendor/aospext/0001-RPI4-FFMPEG-Enable-hardware-codecs.patch diff --git a/patches-aosp/glodroid/vendor/mesa3d/0001-dri-Remove-__driDriverExtensions-leftovers.patch b/patches-aosp/glodroid/vendor/mesa3d/0001-dri-Remove-__driDriverExtensions-leftovers.patch new file mode 100644 index 0000000..6629c03 --- /dev/null +++ b/patches-aosp/glodroid/vendor/mesa3d/0001-dri-Remove-__driDriverExtensions-leftovers.patch @@ -0,0 +1,65 @@ +From 07465de19df27aff89d89a2b77ff04597e2ed58c Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 6 Oct 2023 12:31:29 +0300 +Subject: [PATCH 1/2] dri: Remove __driDriverExtensions leftovers + +Android-14/clang-17 throws an error with it: + +ld.lld: error: version script assignment of 'global' to symbol + '__driDriverExtensions' failed: symbol not defined + +Fixes: d43e6a9a497f ("dri: Remove the megadriver compat stub") +Signed-off-by: Roman Stratiienko +Acked-by: Erik Faye-Lund +--- + include/GL/internal/dri_interface.h | 8 -------- + src/gallium/targets/dri/dri.sym | 1 - + src/loader/loader.c | 2 -- + 3 files changed, 11 deletions(-) + +diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h +index a59d598c3bf..1424e24fe27 100644 +--- a/include/GL/internal/dri_interface.h ++++ b/include/GL/internal/dri_interface.h +@@ -678,14 +678,6 @@ struct __DRIuseInvalidateExtensionRec { + __DRIextension base; + }; + +-/** +- * The remaining extensions describe driver extensions, immediately +- * available interfaces provided by the driver. To start using the +- * driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for +- * the extension you need in the array. +- */ +-#define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions" +- + /** + * This symbol replaces the __DRI_DRIVER_EXTENSIONS symbol, and will be + * suffixed by "_drivername", allowing multiple drivers to be built into one +diff --git a/src/gallium/targets/dri/dri.sym b/src/gallium/targets/dri/dri.sym +index d4ffb588e05..6f502fa9f92 100644 +--- a/src/gallium/targets/dri/dri.sym ++++ b/src/gallium/targets/dri/dri.sym +@@ -1,6 +1,5 @@ + { + global: +- __driDriverExtensions; + __driDriverGetExtensions*; + nouveau_drm_screen_create; + radeon_drm_winsys_create; +diff --git a/src/loader/loader.c b/src/loader/loader.c +index a00f16f0e99..f340b61433d 100644 +--- a/src/loader/loader.c ++++ b/src/loader/loader.c +@@ -836,8 +836,6 @@ loader_open_driver(const char *driver_name, + free(get_extensions_name); + } + +- if (!extensions) +- extensions = dlsym(driver, __DRI_DRIVER_EXTENSIONS); + if (extensions == NULL) { + log_(_LOADER_WARNING, + "MESA-LOADER: driver exports no extensions (%s)\n", dlerror()); +-- +2.39.2 + diff --git a/patches-aosp/glodroid/vendor/mesa3d/0002-HACK-Use-mask-in-dri.sym.patch b/patches-aosp/glodroid/vendor/mesa3d/0002-HACK-Use-mask-in-dri.sym.patch new file mode 100644 index 0000000..63701fc --- /dev/null +++ b/patches-aosp/glodroid/vendor/mesa3d/0002-HACK-Use-mask-in-dri.sym.patch @@ -0,0 +1,36 @@ +From 6853cd7d7fedc665fcce95c01a939408ced9b708 Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 6 Oct 2023 23:15:17 +0300 +Subject: [PATCH 2/2] HACK: Use mask in dri.sym + +... otherwise LLD-17 will fail to link be because of missing symbols. + +Signed-off-by: Roman Stratiienko +--- + src/gallium/targets/dri/dri.sym | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/gallium/targets/dri/dri.sym b/src/gallium/targets/dri/dri.sym +index 6f502fa9f92..3080b0c979b 100644 +--- a/src/gallium/targets/dri/dri.sym ++++ b/src/gallium/targets/dri/dri.sym +@@ -1,11 +1,11 @@ + { + global: + __driDriverGetExtensions*; +- nouveau_drm_screen_create; +- radeon_drm_winsys_create; +- amdgpu_winsys_create; +- fd_drm_screen_create_renderonly; +- ac_init_shared_llvm_once; ++ nouveau_drm_screen_create*; ++ radeon_drm_winsys_create*; ++ amdgpu_winsys_create*; ++ fd_drm_screen_create_renderonly*; ++ ac_init_shared_llvm_once*; + local: + *; + }; +-- +2.39.2 + diff --git a/patches-aosp/glodroid/vendor/mesa3d/0003-isaspec-Remove-symlink-that-points-to-missing-file.patch b/patches-aosp/glodroid/vendor/mesa3d/0003-isaspec-Remove-symlink-that-points-to-missing-file.patch new file mode 100644 index 0000000..65126e9 --- /dev/null +++ b/patches-aosp/glodroid/vendor/mesa3d/0003-isaspec-Remove-symlink-that-points-to-missing-file.patch @@ -0,0 +1,25 @@ +From e0f951f79edd93d0c4fb27686970fe322fa3d50a Mon Sep 17 00:00:00 2001 +From: Roman Stratiienko +Date: Fri, 6 Oct 2023 23:36:21 +0300 +Subject: [PATCH 3/3] isaspec: Remove symlink that points to missing file + +AOSP does not like such symlinks. + +Change-Id: I737f16fd64c79ff2bde4eb1f8d592fb66bca66dc +Signed-off-by: Roman Stratiienko +--- + src/compiler/isaspec/README.rst | 1 - + 1 file changed, 1 deletion(-) + delete mode 120000 src/compiler/isaspec/README.rst + +diff --git a/src/compiler/isaspec/README.rst b/src/compiler/isaspec/README.rst +deleted file mode 120000 +index 27379790c02..00000000000 +--- a/src/compiler/isaspec/README.rst ++++ /dev/null +@@ -1 +0,0 @@ +-../../../docs/drivers/freedreno/isaspec.rst +\ No newline at end of file +-- +2.39.2 + diff --git a/unfold_aosp.sh b/unfold_aosp.sh index 8eedce3..cb088a1 100755 --- a/unfold_aosp.sh +++ b/unfold_aosp.sh @@ -4,7 +4,7 @@ LOCAL_PATH=$(pwd) echo Init repo tree using AOSP manifest pushd aosptree -repo init -u https://android.googlesource.com/platform/manifest -b refs/tags/android-platform-13.0.0_r12 +repo init -u https://android.googlesource.com/platform/manifest -b refs/tags/android-14.0.0_r11 cd .repo/manifests mv default.xml aosp.xml cp ${LOCAL_PATH}/manifests/glodroid.xml glodroid.xml diff --git a/unfold_lineageos.sh b/unfold_lineageos.sh index 28f6d16..d6048f6 100755 --- a/unfold_lineageos.sh +++ b/unfold_lineageos.sh @@ -1,5 +1,9 @@ #!/bin/bash -ex +echo "LineageOS-21 is not supported yet" + +exit 1 + LOCAL_PATH=$(pwd) echo Init repo tree using AOSP manifest