summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariia Sandrikova <mariiasand@google.com>2022-12-07 01:36:01 +0000
committerMariia Sandrikova <mariiasand@google.com>2022-12-07 01:41:22 +0000
commit9eab5440f8bc4efae308721c061e3d835f78a66d (patch)
tree2eb7910ebf89728e577d6a8b41cfe399f8fc2e44
parent383832ff5b2390f3dcd44592db071d504268787d (diff)
downloadnative-9eab5440f8bc4efae308721c061e3d835f78a66d.tar.gz
[6/n][Pro] Change natural device orientation to portrait.
Introduce debug.sf.ignore_hwc_physical_display_orientation to allow ignoring physical orientation provided through hwc API in favour of 'ro.surface_flinger.primary_display_orientation' Test: manual Bug: 246793311 Change-Id: Ie0a9859a43948b97414c97db279ff4d32bce3ac1
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp6
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h5
2 files changed, 10 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 4486e33166..e82d393604 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -422,6 +422,9 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI
property_get("debug.sf.treat_170m_as_sRGB", value, "0");
mTreat170mAsSrgb = atoi(value);
+ mIgnoreHwcPhysicalDisplayOrientation =
+ base::GetBoolProperty("debug.sf.ignore_hwc_physical_display_orientation"s, false);
+
// We should be reading 'persist.sys.sf.color_saturation' here
// but since /data may be encrypted, we need to wait until after vold
// comes online to attempt to read the property. The property is
@@ -2401,7 +2404,8 @@ ui::Rotation SurfaceFlinger::getPhysicalDisplayOrientation(DisplayId displayId,
if (!id) {
return ui::ROTATION_0;
}
- if (getHwComposer().getComposer()->isSupported(
+ if (!mIgnoreHwcPhysicalDisplayOrientation &&
+ getHwComposer().getComposer()->isSupported(
Hwc2::Composer::OptionalFeature::PhysicalDisplayOrientation)) {
switch (getHwComposer().getPhysicalDisplayOrientation(*id)) {
case Hwc2::AidlTransform::ROT_90:
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 9e0cee8fd4..7b6c55a1c3 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -353,6 +353,11 @@ public:
// on this behavior to increase contrast for some media sources.
bool mTreat170mAsSrgb = false;
+ // Allows to ignore physical orientation provided through hwc API in favour of
+ // 'ro.surface_flinger.primary_display_orientation'.
+ // TODO(b/246793311): Clean up a temporary property
+ bool mIgnoreHwcPhysicalDisplayOrientation = false;
+
protected:
// We're reference counted, never destroy SurfaceFlinger directly
virtual ~SurfaceFlinger();