Permalink
Browse files

SurfaceFlinger: send the orientation information to HWC

Change-Id: I04a30d472ac2d12706b8d82b4bb433598482454d
CRs-fixed: 382796
  • Loading branch information...
1 parent d5e8d31 commit e7121f8e9766428a814f74a8346df76c0ce6d7e1 Arun Kumar K.R committed with Gerrit Code Review Aug 2, 2012
View
7 services/surfaceflinger/DisplayHardware/DisplayHardware.h
@@ -88,7 +88,8 @@ class DisplayHardware :
void setVSyncHandler(const sp<VSyncHandler>& handler);
enum {
- EVENT_VSYNC = HWC_EVENT_VSYNC
+ EVENT_VSYNC = HWC_EVENT_VSYNC,
+ EVENT_ORIENTATION = 1 // used for sending orientation info to HWC
};
void eventControl(int event, int enabled);
@@ -101,9 +102,9 @@ class DisplayHardware :
// Hardware Composer
HWComposer& getHwComposer() const;
-
+
status_t compositionComplete() const;
-
+
Rect getBounds() const {
return Rect(mWidth, mHeight);
}
View
12 services/surfaceflinger/SurfaceFlinger.cpp
@@ -506,6 +506,7 @@ void SurfaceFlinger::postFramebuffer()
mVisibleLayersSortedByZ[i]->onLayerDisplayed();
}
+
mLastSwapBufferTime = systemTime() - now;
mDebugInSwapBuffers = 0;
mSwapRegion.clear();
@@ -572,7 +573,9 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
// Currently unused: const uint32_t flags = mCurrentState.orientationFlags;
GraphicPlane& plane(graphicPlane(dpy));
plane.setOrientation(orientation);
-
+#ifdef QCOMHW
+ const Transform& planeTransform(plane.transform());
+#endif
// update the shared control block
const DisplayHardware& hw(plane.displayHardware());
volatile display_cblk_t* dcblk = mServerCblk->displays + dpy;
@@ -595,6 +598,13 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
else
mHdmiClient->setHdmiRotate(0, overlayLayerCount);
#endif
+#ifdef QCOMHW
+ //set the new orientation to HWC
+ HWComposer& hwc(graphicPlane(0).displayHardware().getHwComposer());
+ hwc.eventControl(DisplayHardware::EVENT_ORIENTATION,
+ planeTransform.getOrientation());
+
+#endif
}
if (currentLayers.size() > mDrawingState.layersSortedByZ.size()) {

0 comments on commit e7121f8

Please sign in to comment.