From 1b5cb629f4a890140d0507002e53c110839c6bd5 Mon Sep 17 00:00:00 2001 From: "Arun Kumar K.R" Date: Wed, 6 Apr 2011 18:30:28 -0700 Subject: [PATCH] hardware/msm7k: Remove ioctl call from getOrientation - The ioctl call from getOrientation is removed. - In gralloc use getOrientation instead of storing the orientation. Change-Id: Idb08568ff5d46ce99e0a9a8c6f492b90bb666f0c --- libgralloc-qsd8k/framebuffer.cpp | 5 +++-- libgralloc-qsd8k/gralloc_priv.h | 1 - liboverlay/overlayLib.cpp | 10 ++-------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/libgralloc-qsd8k/framebuffer.cpp b/libgralloc-qsd8k/framebuffer.cpp index 6d9a929..794adb4 100644 --- a/libgralloc-qsd8k/framebuffer.cpp +++ b/libgralloc-qsd8k/framebuffer.cpp @@ -315,10 +315,11 @@ static void *hdmi_ui_loop(void *ptr) break; } } - if(rot != m->currentOrientation) { + int currOrientation = 0; + pTemp->getOrientation(currOrientation); + if(rot != currOrientation) { pTemp->setParameter(OVERLAY_TRANSFORM, rot); - m->currentOrientation = rot; } EVEN_OUT(asX); EVEN_OUT(asY); diff --git a/libgralloc-qsd8k/gralloc_priv.h b/libgralloc-qsd8k/gralloc_priv.h index 7e41906..39b488e 100755 --- a/libgralloc-qsd8k/gralloc_priv.h +++ b/libgralloc-qsd8k/gralloc_priv.h @@ -235,7 +235,6 @@ struct private_module_t { bool exitHDMIUILoop; float actionsafeWidthRatio; float actionsafeHeightRatio; - int currentOrientation; bool hdmiStateChanged; pthread_mutex_t overlayLock; pthread_cond_t overlayPost; diff --git a/liboverlay/overlayLib.cpp b/liboverlay/overlayLib.cpp index 53d430b..00a5ccb 100644 --- a/liboverlay/overlayLib.cpp +++ b/liboverlay/overlayLib.cpp @@ -1109,14 +1109,8 @@ bool OverlayControlChannel::getPosition(int& x, int& y, bool OverlayControlChannel::getOrientation(int& orientation) const { if (!isChannelUP()) return false; - - mdp_overlay ov; - ov.id = mOVInfo.id; - if (ioctl(mFD, MSMFB_OVERLAY_GET, &ov)) { - reportError("getOrientation, overlay GET failed"); - return false; - } - orientation = ov.user_data[0]; + // mOVInfo has the current orientation + orientation = mOVInfo.user_data[0]; return true; } bool OverlayControlChannel::getOvSessionID(int& sessionID) const {