Initial commit for Android 10, syncing up to v201
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
From 0ce8e40182af9c1955a862f8bba608b90e6a0524 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 14 Aug 2018 21:01:35 +0200
|
||||
Subject: [PATCH 1/5] AOSP 8.0/8.1 didn't use presentOrValidate, so it's
|
||||
broken. Don't use it
|
||||
|
||||
Change-Id: If86793dba3738680280f9dc0f7e7c802c0836690
|
||||
---
|
||||
services/surfaceflinger/DisplayHardware/HWComposer.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
|
||||
index 1099041b4..2021c26b0 100644
|
||||
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
|
||||
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
|
||||
@@ -424,7 +424,7 @@ status_t HWComposer::prepare(DisplayId displayId, const compositionengine::Outpu
|
||||
// The check below is incorrect. We actually rely on HWC here to fall
|
||||
// back to validate when there is any client layer.
|
||||
displayData.validateWasSkipped = false;
|
||||
- if (!displayData.hasClientComposition) {
|
||||
+ if ((false)) {
|
||||
sp<Fence> outPresentFence;
|
||||
uint32_t state = UINT32_MAX;
|
||||
error = hwcDisplay->presentOrValidate(&numTypes, &numRequests, &outPresentFence , &state);
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From d51e5d5a041f8404b5d62cfca5f5765588ded4fb Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 19 Aug 2018 23:07:24 +0200
|
||||
Subject: [PATCH 2/5] Ignore usage bits verification
|
||||
|
||||
This didn't ignore as of 8.1, so we're ""safe""
|
||||
|
||||
Change-Id: I40c1d588c1fa104d844322b469f76e52bee1495a
|
||||
---
|
||||
libs/ui/Gralloc2.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libs/ui/Gralloc2.cpp b/libs/ui/Gralloc2.cpp
|
||||
index 5dc453005..90dc90f39 100644
|
||||
--- a/libs/ui/Gralloc2.cpp
|
||||
+++ b/libs/ui/Gralloc2.cpp
|
||||
@@ -108,7 +108,7 @@ status_t Gralloc2Mapper::validateBufferDescriptorInfo(
|
||||
if (descriptorInfo->usage & ~validUsageBits) {
|
||||
ALOGE("buffer descriptor contains invalid usage bits 0x%" PRIx64,
|
||||
descriptorInfo->usage & ~validUsageBits);
|
||||
- return BAD_VALUE;
|
||||
+ //return BAD_VALUE;
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From 8db7e963f05ebc59298cf8e9b74f98d670ec5742 Mon Sep 17 00:00:00 2001
|
||||
From: phh <phh@phh.me>
|
||||
Date: Wed, 22 Aug 2018 08:57:52 +0000
|
||||
Subject: [PATCH 3/5] Enable fallback to old ro.sf.hwrotation property
|
||||
|
||||
Change-Id: I46b75a15b85fc5bda31357a4beeb7dab77bd6fe1
|
||||
---
|
||||
services/surfaceflinger/SurfaceFlinger.cpp | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
|
||||
index 6166789fc..14ca4729c 100644
|
||||
--- a/services/surfaceflinger/SurfaceFlinger.cpp
|
||||
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
|
||||
@@ -329,7 +329,25 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI
|
||||
SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientationDefault;
|
||||
break;
|
||||
}
|
||||
+
|
||||
ALOGV("Primary Display Orientation is set to %2d.", SurfaceFlinger::primaryDisplayOrientation);
|
||||
+ if(tmpPrimaryDisplayOrientation == SurfaceFlingerProperties::primary_display_orientation_values::ORIENTATION_0) {
|
||||
+ int sfRotation = property_get_int32("ro.sf.hwrotation", -1);
|
||||
+ switch(sfRotation) {
|
||||
+ case 0:
|
||||
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientationDefault;
|
||||
+ break;
|
||||
+ case 90:
|
||||
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientation90;
|
||||
+ break;
|
||||
+ case 180:
|
||||
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientation180;
|
||||
+ break;
|
||||
+ case 270:
|
||||
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientation270;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
mInternalDisplayPrimaries = sysprop::getDisplayNativePrimaries();
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From c554242731125a5e6a3f7d31d4f4af9049d8c7f4 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 12 Aug 2019 23:48:37 +0200
|
||||
Subject: [PATCH 4/5] Some Samsung devices requires lying colorspace
|
||||
|
||||
Change-Id: I4153b8e7abc10c519565e4e4386c6388621477b2
|
||||
---
|
||||
opengl/libs/EGL/egl_platform_entries.cpp | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/opengl/libs/EGL/egl_platform_entries.cpp b/opengl/libs/EGL/egl_platform_entries.cpp
|
||||
index e996be685..57ca592a7 100644
|
||||
--- a/opengl/libs/EGL/egl_platform_entries.cpp
|
||||
+++ b/opengl/libs/EGL/egl_platform_entries.cpp
|
||||
@@ -458,8 +458,14 @@ EGLBoolean eglGetConfigAttribImpl(EGLDisplay dpy, EGLConfig config,
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Translates EGL color spaces to Android data spaces.
|
||||
+static int samsungColorspace = -1;
|
||||
static android_dataspace dataSpaceFromEGLColorSpace(EGLint colorspace) {
|
||||
+ if(samsungColorspace == -1) {
|
||||
+ samsungColorspace = property_get_bool("persist.sys.phh.samsung_colorspace", false);
|
||||
+ }
|
||||
if (colorspace == EGL_GL_COLORSPACE_LINEAR_KHR) {
|
||||
+ if(samsungColorspace)
|
||||
+ return HAL_DATASPACE_UNKNOWN;
|
||||
return HAL_DATASPACE_UNKNOWN;
|
||||
} else if (colorspace == EGL_GL_COLORSPACE_SRGB_KHR) {
|
||||
return HAL_DATASPACE_V0_SRGB;
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From fd7365352954e1ab647fca2eefeaa2707d47f7fa Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Wed, 14 Aug 2019 23:37:10 +0200
|
||||
Subject: [PATCH 5/5] On Samsung, we need to send a hack-message to HAL to get
|
||||
all Sensors
|
||||
|
||||
Change-Id: Id6a1fa48340de61c418493668e9abd22c2599376
|
||||
---
|
||||
services/sensorservice/SensorDevice.cpp | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
|
||||
index 717f31769..45d6c679b 100644
|
||||
--- a/services/sensorservice/SensorDevice.cpp
|
||||
+++ b/services/sensorservice/SensorDevice.cpp
|
||||
@@ -30,7 +30,9 @@
|
||||
#include <cinttypes>
|
||||
#include <thread>
|
||||
|
||||
+#include <android-base/properties.h>
|
||||
using namespace android::hardware::sensors;
|
||||
+
|
||||
using namespace android::hardware::sensors::V1_0;
|
||||
using namespace android::hardware::sensors::V1_0::implementation;
|
||||
using android::hardware::sensors::V2_0::ISensorsCallback;
|
||||
@@ -115,6 +117,8 @@ SensorDevice::SensorDevice()
|
||||
void SensorDevice::initializeSensorList() {
|
||||
float minPowerMa = 0.001; // 1 microAmp
|
||||
|
||||
+ if(::android::base::GetBoolProperty("persist.sys.phh.samsung_sensors", false))
|
||||
+ setMode(5555);
|
||||
checkReturn(mSensors->getSensorsList(
|
||||
[&](const auto &list) {
|
||||
const size_t count = list.size();
|
||||
--
|
||||
2.17.1
|
||||
|
||||
Reference in New Issue
Block a user