diff options
| author | 2022-12-21 00:42:16 +0000 | |
|---|---|---|
| committer | 2022-12-21 00:42:16 +0000 | |
| commit | 56a6fee79689add598623af098cd6c17859c4dfc (patch) | |
| tree | cb8f82681b00aef65378c17e53bfc699032721fa | |
| parent | e0e385cf14c9c37d3e2c78b6efbc9c30551b5639 (diff) | |
| parent | 3dd864dd14c84df4a012e9513ac56089ab093b38 (diff) | |
Merge "[6/n][Pro] Change natural device orientation to portrait." into tm-qpr-dev am: 3dd864dd14
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/20655568
Change-Id: I433da6d5bec17bde1c7b312f9030737fe735d0e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -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 d1275b0f43..c2f3bddffc 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -423,6 +423,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 @@ -2410,7 +2413,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 bb9490889a..87124d9148 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(); |