+
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -683,10 +683,21 @@ status_t SurfaceFlinger::getDisplayInfo(const sp
info->orientation = 0;
}
- info->w = hwc.getWidth(type);
- info->h = hwc.getHeight(type);
- 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 = hwc.getWidth(type);
+ info->w = hwc.getHeight(type);
+ info->xdpi = ydpi;
+ info->ydpi = xdpi;
+ }
+ else {
+ info->w = hwc.getWidth(type);
+ info->h = hwc.getHeight(type);
+ info->xdpi = xdpi;
+ info->ydpi = ydpi;
+ }
init.rc : setprop ro.sf.hwrotation 180