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:
7d283431ef
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
This commit is contained in:
parent
987034b563
commit
3904525bce
@ -641,10 +641,21 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display,
|
|||||||
info.orientation = 0;
|
info.orientation = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
info.w = hwConfig.width;
|
char value[PROPERTY_VALUE_MAX];
|
||||||
info.h = hwConfig.height;
|
property_get("ro.sf.hwrotation", value, "0");
|
||||||
info.xdpi = xdpi;
|
int additionalRot = atoi(value) / 90;
|
||||||
info.ydpi = ydpi;
|
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.fps = float(1e9 / hwConfig.refresh);
|
||||||
info.appVsyncOffset = VSYNC_EVENT_PHASE_OFFSET_NS;
|
info.appVsyncOffset = VSYNC_EVENT_PHASE_OFFSET_NS;
|
||||||
info.colorTransform = hwConfig.colorTransform;
|
info.colorTransform = hwConfig.colorTransform;
|
||||||
|
Loading…
Reference in New Issue
Block a user