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:
parent
c91bafb88a
commit
a887c19994
@ -142,10 +142,10 @@ DisplayDevice::DisplayDevice(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mPanelInverseMounted = false;
|
mPanelMountFlip = 0;
|
||||||
// Check if panel is inverse mounted (contents show up HV flipped)
|
// 1: H-Flip, 2: V-Flip, 3: 180 (HV Flip)
|
||||||
property_get("persist.panel.inversemounted", property, "0");
|
property_get("persist.panel.mountflip", property, "0");
|
||||||
mPanelInverseMounted = !!atoi(property);
|
mPanelMountFlip = atoi(property);
|
||||||
|
|
||||||
// initialize the display orientation transform.
|
// initialize the display orientation transform.
|
||||||
setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);
|
setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);
|
||||||
@ -428,8 +428,8 @@ status_t DisplayDevice::orientationToTransfrom(
|
|||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DISPLAY_PRIMARY == mHwcDisplayId && isPanelInverseMounted()) {
|
if (DISPLAY_PRIMARY == mHwcDisplayId) {
|
||||||
flags = flags ^ Transform::ROT_180;
|
flags = flags ^ getPanelMountFlip();
|
||||||
}
|
}
|
||||||
|
|
||||||
tr->set(flags, w, h);
|
tr->set(flags, w, h);
|
||||||
|
@ -126,8 +126,8 @@ public:
|
|||||||
int32_t getHwcDisplayId() const { return mHwcDisplayId; }
|
int32_t getHwcDisplayId() const { return mHwcDisplayId; }
|
||||||
const wp<IBinder>& getDisplayToken() const { return mDisplayToken; }
|
const wp<IBinder>& getDisplayToken() const { return mDisplayToken; }
|
||||||
|
|
||||||
bool isPanelInverseMounted() const {
|
uint32_t getPanelMountFlip() const {
|
||||||
return mPanelInverseMounted;
|
return mPanelMountFlip;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We pass in mustRecompose so we can keep VirtualDisplaySurface's state
|
// We pass in mustRecompose so we can keep VirtualDisplaySurface's state
|
||||||
@ -230,8 +230,8 @@ private:
|
|||||||
int mPowerMode;
|
int mPowerMode;
|
||||||
// Current active config
|
// Current active config
|
||||||
int mActiveConfig;
|
int mActiveConfig;
|
||||||
// Panel is inverse mounted
|
// Panel's mount flip, H, V or 180 (HV)
|
||||||
int mPanelInverseMounted;
|
uint32_t mPanelMountFlip;
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace android
|
}; // namespace android
|
||||||
|
@ -238,8 +238,7 @@ bool LayerBlur::captureScreen(const sp<const DisplayDevice>& hw, FBO& fbo, Textu
|
|||||||
texture.getTextureName(), 0);
|
texture.getTextureName(), 0);
|
||||||
|
|
||||||
mFlinger->getRenderEngine().clearWithColor(0.0f, 0.0f, 0.0f, 1.0f);
|
mFlinger->getRenderEngine().clearWithColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
if (hw->isPanelInverseMounted())
|
rotation = (Transform::orientation_flags)(rotation ^ hw->getPanelMountFlip());
|
||||||
rotation = Transform::ROT_180;
|
|
||||||
mFlinger->renderScreenImplLocked(
|
mFlinger->renderScreenImplLocked(
|
||||||
hw,
|
hw,
|
||||||
Rect(0,0,width,height),
|
Rect(0,0,width,height),
|
||||||
|
@ -3463,10 +3463,9 @@ void SurfaceFlinger::renderScreenImplLocked(
|
|||||||
// make sure to clear all GL error flags
|
// make sure to clear all GL error flags
|
||||||
engine.checkErrors();
|
engine.checkErrors();
|
||||||
|
|
||||||
if (DisplayDevice::DISPLAY_PRIMARY == hw->getDisplayType() &&
|
if (DisplayDevice::DISPLAY_PRIMARY == hw->getDisplayType()) {
|
||||||
hw->isPanelInverseMounted()) {
|
|
||||||
rotation = (Transform::orientation_flags)
|
rotation = (Transform::orientation_flags)
|
||||||
(rotation ^ Transform::ROT_180);
|
(rotation ^ hw->getPanelMountFlip());
|
||||||
}
|
}
|
||||||
|
|
||||||
// set-up our viewport
|
// set-up our viewport
|
||||||
|
Loading…
Reference in New Issue
Block a user