SF: Add support for all flips of panel mount

Add support for all flips of panel mount, H, V, HV (180). Property
persist.panel.mountflip can be set to 1 for H-Flip, 2 for V-Flip,
3 for HV-Flip (180 / inverse mount).

Change-Id: Ide7b8378ad6a423e5d7335fedc27d480a25b53ae
CRs-fixed: 990622
This commit is contained in:
Saurabh Shah 2016-03-21 17:25:23 -07:00 committed by Steve Kondik
parent c91bafb88a
commit a887c19994
4 changed files with 13 additions and 15 deletions

View File

@ -142,10 +142,10 @@ DisplayDevice::DisplayDevice(
break;
}
mPanelInverseMounted = false;
// Check if panel is inverse mounted (contents show up HV flipped)
property_get("persist.panel.inversemounted", property, "0");
mPanelInverseMounted = !!atoi(property);
mPanelMountFlip = 0;
// 1: H-Flip, 2: V-Flip, 3: 180 (HV Flip)
property_get("persist.panel.mountflip", property, "0");
mPanelMountFlip = atoi(property);
// initialize the display orientation transform.
setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);
@ -428,8 +428,8 @@ status_t DisplayDevice::orientationToTransfrom(
return BAD_VALUE;
}
if (DISPLAY_PRIMARY == mHwcDisplayId && isPanelInverseMounted()) {
flags = flags ^ Transform::ROT_180;
if (DISPLAY_PRIMARY == mHwcDisplayId) {
flags = flags ^ getPanelMountFlip();
}
tr->set(flags, w, h);

View File

@ -126,8 +126,8 @@ public:
int32_t getHwcDisplayId() const { return mHwcDisplayId; }
const wp<IBinder>& getDisplayToken() const { return mDisplayToken; }
bool isPanelInverseMounted() const {
return mPanelInverseMounted;
uint32_t getPanelMountFlip() const {
return mPanelMountFlip;
}
// We pass in mustRecompose so we can keep VirtualDisplaySurface's state
@ -230,8 +230,8 @@ private:
int mPowerMode;
// Current active config
int mActiveConfig;
// Panel is inverse mounted
int mPanelInverseMounted;
// Panel's mount flip, H, V or 180 (HV)
uint32_t mPanelMountFlip;
};
}; // namespace android

View File

@ -238,8 +238,7 @@ bool LayerBlur::captureScreen(const sp<const DisplayDevice>& hw, FBO& fbo, Textu
texture.getTextureName(), 0);
mFlinger->getRenderEngine().clearWithColor(0.0f, 0.0f, 0.0f, 1.0f);
if (hw->isPanelInverseMounted())
rotation = Transform::ROT_180;
rotation = (Transform::orientation_flags)(rotation ^ hw->getPanelMountFlip());
mFlinger->renderScreenImplLocked(
hw,
Rect(0,0,width,height),

View File

@ -3463,10 +3463,9 @@ void SurfaceFlinger::renderScreenImplLocked(
// make sure to clear all GL error flags
engine.checkErrors();
if (DisplayDevice::DISPLAY_PRIMARY == hw->getDisplayType() &&
hw->isPanelInverseMounted()) {
if (DisplayDevice::DISPLAY_PRIMARY == hw->getDisplayType()) {
rotation = (Transform::orientation_flags)
(rotation ^ Transform::ROT_180);
(rotation ^ hw->getPanelMountFlip());
}
// set-up our viewport