summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamkumar Radhakrishnan <ramkumar@codeaurora.org>2015-08-20 18:18:30 -0700
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:22:26 -0600
commitcfd539bf4a6facee1d96e6aaca273d662e548563 (patch)
tree4a6c621374d6a77a002e6ef4aca7034d539d18a7
parent3652b2386511917de05beefcbc4bf1521450a1bf (diff)
downloadframeworks_native-cfd539bf4a6facee1d96e6aaca273d662e548563.zip
frameworks_native-cfd539bf4a6facee1d96e6aaca273d662e548563.tar.gz
frameworks_native-cfd539bf4a6facee1d96e6aaca273d662e548563.tar.bz2
sf: This is a combination of following changes.
Author: Prabhanjan Kandula<pkandula@codeaurora.org> SF: Add support for inverse mounted panels. Add 180 rotation in SF to account for inverse mounted panels. The framework will be unaffected and use policies for a 0 mounted panel. SF changes the global transform and silently induces the H,V flips. Similar flips are added to screenshots as well. CRs-Fixed: 894147 Change-Id: I6e9576ee734ee85097491eaa1e8e94cfb3731e0f Author: Ramkumar Radhakrishnan<ramkumar@codeaurora.org> SF: Clear visible region of layer appropriately. Clear visible region of layer having layer stack id different than the display layer stack id to ensure that the layer won't be present on the wrong display layer list. Change-Id: I59289fea63ec7a2451d4715cfe7926ba34fdb8e3 Change-Id: I5ad08a6013aa173d621ee80c766a6e19e1086a35
-rw-r--r--services/surfaceflinger/DisplayDevice.cpp11
-rw-r--r--services/surfaceflinger/DisplayDevice.h8
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp16
3 files changed, 33 insertions, 2 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 13d44f3..baff5ba 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -90,6 +90,7 @@ DisplayDevice::DisplayDevice(
{
mNativeWindow = new Surface(producer, false);
ANativeWindow* const window = mNativeWindow.get();
+ char property[PROPERTY_VALUE_MAX];
/*
* Create our display's surface
@@ -140,6 +141,11 @@ 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);
+
// initialize the display orientation transform.
setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);
}
@@ -402,6 +408,11 @@ status_t DisplayDevice::orientationToTransfrom(
default:
return BAD_VALUE;
}
+
+ if (DISPLAY_PRIMARY == mHwcDisplayId && isPanelInverseMounted()) {
+ flags = flags ^ Transform::ROT_180;
+ }
+
tr->set(flags, w, h);
return NO_ERROR;
}
diff --git a/services/surfaceflinger/DisplayDevice.h b/services/surfaceflinger/DisplayDevice.h
index 8695a44..f492a42 100644
--- a/services/surfaceflinger/DisplayDevice.h
+++ b/services/surfaceflinger/DisplayDevice.h
@@ -126,6 +126,10 @@ public:
int32_t getHwcDisplayId() const { return mHwcDisplayId; }
const wp<IBinder>& getDisplayToken() const { return mDisplayToken; }
+ bool isPanelInverseMounted() const {
+ return mPanelInverseMounted;
+ }
+
// We pass in mustRecompose so we can keep VirtualDisplaySurface's state
// machine happy without actually queueing a buffer if nothing has changed
status_t beginFrame(bool mustRecompose) const;
@@ -209,7 +213,7 @@ private:
/*
* Transaction state
*/
- static status_t orientationToTransfrom(int orientation,
+ status_t orientationToTransfrom(int orientation,
int w, int h, Transform* tr);
uint32_t mLayerStack;
@@ -226,6 +230,8 @@ private:
int mPowerMode;
// Current active config
int mActiveConfig;
+ // Panel is inverse mounted
+ int mPanelInverseMounted;
};
}; // namespace android
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 3b4330d..c5e50e8 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3306,6 +3306,12 @@ void SurfaceFlinger::renderScreenImplLocked(
// make sure to clear all GL error flags
engine.checkErrors();
+ if (DisplayDevice::DISPLAY_PRIMARY == hw->getDisplayType() &&
+ hw->isPanelInverseMounted()) {
+ rotation = (Transform::orientation_flags)
+ (rotation ^ Transform::ROT_180);
+ }
+
// set-up our viewport
engine.setViewportAndProjection(
reqWidth, reqHeight, sourceCrop, hw_h, yswap, rotation);
@@ -3508,8 +3514,16 @@ bool SurfaceFlinger::updateLayerVisibleNonTransparentRegion(const int& /*dpy*/,
const Layer::State& s(layer->getDrawingState());
// only consider the layers on the given layer stack
- if (s.layerStack != layerStack)
+ if (s.layerStack != layerStack) {
+ /* set the visible region as empty since we have removed the
+ * layerstack check in rebuildLayerStack() function
+ */
+ Region visibleNonTransRegion;
+ visibleNonTransRegion.set(Rect(0,0));
+ layer->setVisibleNonTransparentRegion(visibleNonTransRegion);
+
return true;
+ }
return false;
}