diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-12-22 00:21:00 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-12-22 00:21:00 +0000 |
commit | d37705c68635613f94ef6eafe176d5f512d8014e (patch) | |
tree | 9b087dbe5b7a64d498921553180949777dc98187 | |
parent | 2249770a23327fafcda3020334d924da8d36550d (diff) | |
parent | 3dd864dd14c84df4a012e9513ac56089ab093b38 (diff) | |
download | native-d37705c68635613f94ef6eafe176d5f512d8014e.tar.gz |
Snap for 9428515 from 3dd864dd14c84df4a012e9513ac56089ab093b38 to tm-qpr2-release
Change-Id: I38c2e91833d69fbdbd77fd1859343833d4b11bc7
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 6 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index f6880ce1f3..4d93e7ec50 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 51d721626e..678495da3b 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(); |