sf: Set view frame of each display using binder
Set the view frame of a display using binder when set projection
for that display changes
Change-Id: Ib85ce80e88b207a4cf2559b2cc0e74e60ab3d4d4
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index ac4a0c2..33036e6 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -78,6 +78,10 @@
#include "RenderEngine/RenderEngine.h"
#include <cutils/compiler.h>
+#ifdef QCOM_BSP
+#include <display_config.h>
+#endif
+
#define DISPLAY_COUNT 1
/*
@@ -1319,12 +1323,15 @@
|| (state.viewport != draw[i].viewport)
|| (state.frame != draw[i].frame))
{
+#ifdef QCOM_BSP
+ int orient = state.orientation;
// Honor the orientation change after boot
// animation completes and make sure boot
// animation is shown in panel orientation always.
if(mBootFinished){
disp->setProjection(state.orientation,
state.viewport, state.frame);
+ orient = state.orientation;
}
else{
char property[PROPERTY_VALUE_MAX];
@@ -1336,8 +1343,19 @@
}
disp->setProjection(panelOrientation,
state.viewport, state.frame);
-
+ orient = panelOrientation;
}
+ // Set the view frame of each display only of its
+ // default orientation.
+ if(orient == DisplayState::eOrientationDefault) {
+ qdutils::setViewFrame(disp->getHwcDisplayId(),
+ state.frame.left, state.frame.top,
+ state.frame.right, state.frame.bottom);
+ }
+#else
+ disp->setProjection(state.orientation,
+ state.viewport, state.frame);
+#endif
}
if (state.width != draw[i].width || state.height != draw[i].height) {
disp->setDisplaySize(state.width, state.height);