summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
authorHashcode <hashcode0f@gmail.com>2012-12-10 16:33:53 -0800
committerSteve Kondik <shade@chemlab.org>2015-11-10 10:55:55 -0800
commit3904525bce6b924ad0501f15899d7550f05fcf0d (patch)
treea77f197d3f1ec63433438536654a91f3a6a28367 /services/surfaceflinger
parent987034b5633d0eb7fca806acfe00ddbe3305b159 (diff)
downloadframeworks_native-3904525bce6b924ad0501f15899d7550f05fcf0d.zip
frameworks_native-3904525bce6b924ad0501f15899d7550f05fcf0d.tar.gz
frameworks_native-3904525bce6b924ad0501f15899d7550f05fcf0d.tar.bz2
surfaceflinger: odd hw rotation (90/270) patch for swapping width/height
This patch works in addition to the following commit re-implementing ro.sf.hwrotation: https://github.com/CyanogenMod/android_frameworks_native/commit/7d283431efffc4402cb1a6cacf5da64729c883bb When using values of 90 and 270 for ro.sf.hwrotation the LCD width and height also need to be swapped to display properly. Change-Id: I2874fdb8f8d8b855df6d62d338c9a22360491973 NOTE: This patch does not fix the initial startup of bootanimation
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index cea463a..429231c 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -641,10 +641,21 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display,
info.orientation = 0;
}
- info.w = hwConfig.width;
- info.h = hwConfig.height;
- info.xdpi = xdpi;
- info.ydpi = ydpi;
+ char value[PROPERTY_VALUE_MAX];
+ property_get("ro.sf.hwrotation", value, "0");
+ int additionalRot = atoi(value) / 90;
+ if ((type == DisplayDevice::DISPLAY_PRIMARY) && (additionalRot & DisplayState::eOrientationSwapMask)) {
+ info.h = hwConfig.width;
+ info.w = hwConfig.height;
+ info.xdpi = ydpi;
+ info.ydpi = xdpi;
+ }
+ else {
+ info.w = hwConfig.width;
+ info.h = hwConfig.height;
+ info.xdpi = xdpi;
+ info.ydpi = ydpi;
+ }
info.fps = float(1e9 / hwConfig.refresh);
info.appVsyncOffset = VSYNC_EVENT_PHASE_OFFSET_NS;
info.colorTransform = hwConfig.colorTransform;