From 73a28215fa92da6bf5edbcd9e2d2e582fd6ce57b Mon Sep 17 00:00:00 2001 From: Naomi Luis Date: Mon, 7 Mar 2011 17:47:56 -0800 Subject: [PATCH] liboverlay: Remove additional overlay SET ioctl calls. The MSMFB_OVERLAY_SET ioctl gets called everytime there is a setSource called. This is an expensive call and should not be done unnecessarily. Change-Id: I2d9be394f48b9dea31b9f4f39b1b576c4ad42b47 --- liboverlay/overlayLib.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/liboverlay/overlayLib.cpp b/liboverlay/overlayLib.cpp index ddcd145..1b17f8b 100644 --- a/liboverlay/overlayLib.cpp +++ b/liboverlay/overlayLib.cpp @@ -785,14 +785,18 @@ bool OverlayControlChannel::setSource(uint32_t w, uint32_t h, if (ioctl(mFD, MSMFB_OVERLAY_GET, &ov)) return false; mOVInfo = ov; + int flags = mOVInfo.flags; if (!ignoreFB) mOVInfo.flags |= MDP_OV_PLAY_NOWAIT; else mOVInfo.flags &= ~MDP_OV_PLAY_NOWAIT; - if (ioctl(mFD, MSMFB_OVERLAY_SET, &mOVInfo)) - return false; + if (flags != mOVInfo.flags) { + if (ioctl(mFD, MSMFB_OVERLAY_SET, &mOVInfo)) + return false; + } + return true; } mOrientation = orientation;