diff --git a/Patches/LineageOS-20.0/android_external_hardened_malloc/0002-Broken_Displays.patch b/Patches/LineageOS-20.0/android_external_hardened_malloc/0002-Broken_Displays.patch new file mode 100644 index 00000000..8d98ebfd --- /dev/null +++ b/Patches/LineageOS-20.0/android_external_hardened_malloc/0002-Broken_Displays.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tad +Date: Tue, 22 Nov 2022 07:23:10 -0500 +Subject: [PATCH] Add workaround for OnePlus 8 & 9 display driver crash + +Change-Id: Ie7a0ca79bb629814e57958d57546f85030b67048 +Signed-off-by: Tad +--- + h_malloc.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/h_malloc.c b/h_malloc.c +index b8a858a..7bb1396 100644 +--- a/h_malloc.c ++++ b/h_malloc.c +@@ -1088,6 +1088,15 @@ COLD static void handle_bugs(void) { + ro.purge_slabs = false; + ro.region_quarantine_protect = false; + } ++ ++ // OnePlus 8 & 9 display composer ++ // https://gitlab.com/divested-mobile/divestos-build/-/issues/19 ++ const char hwc[] = "/vendor/bin/hw/vendor.qti.hardware.display.composer-service"; ++ if (strcmp(hwc, path) == 0) { ++ ro.zero_on_free = false; ++ ro.purge_slabs = false; ++ ro.region_quarantine_protect = false; ++ } + } + + COLD static void init_slow_path(void) { diff --git a/Scripts/LineageOS-20.0/Patch.sh b/Scripts/LineageOS-20.0/Patch.sh index c8da4ade..dca4f0ac 100644 --- a/Scripts/LineageOS-20.0/Patch.sh +++ b/Scripts/LineageOS-20.0/Patch.sh @@ -117,6 +117,7 @@ if [ "$DOS_GRAPHENE_MALLOC" = true ]; then if enterAndClear "external/hardened_malloc"; then applyPatch "$DOS_PATCHES/android_external_hardened_malloc/0001-Broken_Cameras-1.patch"; #Workarounds for Pixel 3 SoC era camera driver bugs (GrapheneOS) applyPatch "$DOS_PATCHES/android_external_hardened_malloc/0001-Broken_Cameras-2.patch"; #Expand workaround to all camera executables (DivestOS) +applyPatch "$DOS_PATCHES/android_external_hardened_malloc/0002-Broken_Displays.patch"; #Add workaround for OnePlus 8 & 9 display driver crash (DivestOS) sed -i 's/34359738368/2147483648/' Android.bp; #revert 48-bit address space requirement fi; fi;