android-12.0.0_r32 patches
This commit is contained in:
58
android-12.0.0_r32/frameworks/native/0001-fix-booting.patch
Normal file
58
android-12.0.0_r32/frameworks/native/0001-fix-booting.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
From 78a265c62f866a3d83701ad337158fd615e4e5f1 Mon Sep 17 00:00:00 2001
|
||||
From: Ziyang Zhou <ziyang.zhou@outlook.com>
|
||||
Date: Sun, 9 May 2021 23:04:00 +0800
|
||||
Subject: [PATCH 1/2] fix booting
|
||||
|
||||
---
|
||||
libs/binder/Binder.cpp | 1 +
|
||||
libs/binder/IPCThreadState.cpp | 2 +-
|
||||
libs/binder/ProcessState.cpp | 3 +++
|
||||
3 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libs/binder/Binder.cpp b/libs/binder/Binder.cpp
|
||||
index d5bdd1c803..94b8da8e1c 100644
|
||||
--- a/libs/binder/Binder.cpp
|
||||
+++ b/libs/binder/Binder.cpp
|
||||
@@ -276,6 +276,7 @@ bool BBinder::isRequestingSid()
|
||||
|
||||
void BBinder::setRequestingSid(bool requestingSid)
|
||||
{
|
||||
+ requestingSid = false; // HACKED
|
||||
Extras* e = mExtras.load(std::memory_order_acquire);
|
||||
|
||||
if (!e) {
|
||||
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
|
||||
index c415ea02e2..3e71a9c8e6 100644
|
||||
--- a/libs/binder/IPCThreadState.cpp
|
||||
+++ b/libs/binder/IPCThreadState.cpp
|
||||
@@ -1242,7 +1242,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
|
||||
clearPropagateWorkSource();
|
||||
|
||||
mCallingPid = tr.sender_pid;
|
||||
- mCallingSid = reinterpret_cast<const char*>(tr_secctx.secctx);
|
||||
+ mCallingSid = "HACKED";
|
||||
mCallingUid = tr.sender_euid;
|
||||
mLastTransactionBinderFlags = tr.flags;
|
||||
|
||||
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
|
||||
index bade9187ac..8e8fec5040 100644
|
||||
--- a/libs/binder/ProcessState.cpp
|
||||
+++ b/libs/binder/ProcessState.cpp
|
||||
@@ -149,11 +149,14 @@ bool ProcessState::becomeContextManager()
|
||||
{
|
||||
AutoMutex _l(mLock);
|
||||
|
||||
+#if 0 // HACKED
|
||||
flat_binder_object obj {
|
||||
.flags = FLAT_BINDER_FLAG_TXN_SECURITY_CTX,
|
||||
};
|
||||
|
||||
int result = ioctl(mDriverFD, BINDER_SET_CONTEXT_MGR_EXT, &obj);
|
||||
+#endif
|
||||
+ status_t result = 1;
|
||||
|
||||
// fallback to original method
|
||||
if (result != 0) {
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
From 335caa486b9faa8e89a1b81e442726fa839d4776 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Forbes <chrisforbes@google.com>
|
||||
Date: Thu, 22 Jul 2021 13:54:04 -0700
|
||||
Subject: [PATCH 2/2] Inline GetPhysicalDeviceProperties2 into
|
||||
QueryPresentationProperties
|
||||
|
||||
In general, we implement the 1.1 instance / physical device API as
|
||||
preferring to call the native 1.1 function if available; otherwise
|
||||
falling back to calling the equivalent GPDP2 function. If the
|
||||
underlying driver supports *neither* then any caller of that function
|
||||
has already invoked UB by calling it and so falling over is acceptable.
|
||||
|
||||
Unfortunately, the loader itself does call vkGetPhysicalDeviceProperties2
|
||||
in one case, regardless of what the driver may support, in order to
|
||||
determine whether the platform's swapchain implementation should expose
|
||||
some features. On a 1.0 driver without the GPDP2 extension, this caused
|
||||
trouble.
|
||||
|
||||
As a slight further wrinkle, vkGetPhysicalDeviceProperties2 "cannot
|
||||
fail", making propagating a failure back up through the loader annoying.
|
||||
|
||||
As a workaround, inline the calls to GetPhysicalDeviceProperties2 and
|
||||
GetPhysicalDeviceProperties2KHR into QueryPresentationProperties, where
|
||||
we can handle our one special case of both function pointers being
|
||||
missing but behavior being defined.
|
||||
|
||||
Bug: b/192130684
|
||||
Bug: 208682099
|
||||
Test: TH
|
||||
Change-Id: Iff2bae98b7931bed80fafd895cf57061becabd8d
|
||||
Merged-In: Iff2bae98b7931bed80fafd895cf57061becabd8d
|
||||
---
|
||||
vulkan/libvulkan/driver.cpp | 14 +++++++++++++-
|
||||
1 file changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp
|
||||
index d7fdab5586..cf774fd9b8 100644
|
||||
--- a/vulkan/libvulkan/driver.cpp
|
||||
+++ b/vulkan/libvulkan/driver.cpp
|
||||
@@ -979,6 +979,8 @@ VkResult EnumerateInstanceExtensionProperties(
|
||||
void QueryPresentationProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDevicePresentationPropertiesANDROID* presentation_properties) {
|
||||
+ ATRACE_CALL();
|
||||
+
|
||||
// Request the android-specific presentation properties via GPDP2
|
||||
VkPhysicalDeviceProperties2 properties = {
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2,
|
||||
@@ -994,7 +996,17 @@ void QueryPresentationProperties(
|
||||
presentation_properties->pNext = nullptr;
|
||||
presentation_properties->sharedImage = VK_FALSE;
|
||||
|
||||
- GetPhysicalDeviceProperties2(physicalDevice, &properties);
|
||||
+ const auto& driver = GetData(physicalDevice).driver;
|
||||
+
|
||||
+ if (driver.GetPhysicalDeviceProperties2) {
|
||||
+ // >= 1.1 driver, supports core GPDP2 entrypoint.
|
||||
+ driver.GetPhysicalDeviceProperties2(physicalDevice, &properties);
|
||||
+ } else if (driver.GetPhysicalDeviceProperties2KHR) {
|
||||
+ // Old driver, but may support presentation properties
|
||||
+ // if we have the GPDP2 extension. Otherwise, no presentation
|
||||
+ // properties supported.
|
||||
+ driver.GetPhysicalDeviceProperties2KHR(physicalDevice, &properties);
|
||||
+ }
|
||||
}
|
||||
|
||||
VkResult EnumerateDeviceExtensionProperties(
|
||||
--
|
||||
2.34.1
|
||||
|
||||
Reference in New Issue
Block a user