summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@cyanogenmod.org>2016-10-19 16:44:26 +0300
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-10-31 17:09:47 +0200
commit58585c9f464ee129e0634dd12f5ad7db5b2309a5 (patch)
tree85a0596185190fa5611001383e83d557a465be0b
parentf4fdc6ef828770406d939f21847e0c2a74806489 (diff)
parent9c29bed6d0346f7980a37c1462cb7e5128855d80 (diff)
downloadandroid_hardware_qcom_display-cm-13.0-caf-8916.tar.gz
android_hardware_qcom_display-cm-13.0-caf-8916.tar.bz2
android_hardware_qcom_display-cm-13.0-caf-8916.zip
Merge remote-tracking branch 'caf/LA.BR.1.2.6_rb1.18' into cm-13.0-caf-8916cm-13.0-caf-8916
Change-Id: I4c8e9c26326e87bb3fcf67e4f4be196636dac5bc
-rw-r--r--configure.ac10
-rw-r--r--libgralloc/Makefile.am14
-rw-r--r--libhwcomposer/hwc.cpp50
-rw-r--r--libhwcomposer/hwc_mdpcomp.cpp8
-rw-r--r--libhwcomposer/hwc_qclient.cpp88
-rw-r--r--libhwcomposer/hwc_qclient.h9
-rw-r--r--libhwcomposer/hwc_utils.cpp4
-rw-r--r--libhwcomposer/hwc_utils.h2
-rw-r--r--liboverlay/overlay.cpp10
-rw-r--r--liboverlay/overlay.h4
-rwxr-xr-xliboverlay/overlayMdpRot.cpp4
-rw-r--r--liboverlay/overlayMdssRot.cpp13
-rw-r--r--liboverlay/overlayRotator.h3
-rw-r--r--libqdutils/Makefile.am20
-rw-r--r--libqdutils/mdp_version.cpp9
-rw-r--r--libqdutils/qd_utils.h5
-rw-r--r--libqservice/IQService.h1
-rw-r--r--libqservice/QServiceUtils.h4
18 files changed, 220 insertions, 38 deletions
diff --git a/configure.ac b/configure.ac
index 4b52c26ef..13a128668 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,16 +55,6 @@ if test "x$with_core_includes" != "xno"; then
CPPFLAGS="${CPPFLAGS} -I${core_incdir}"
fi
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
- AC_MSG_ERROR(GLib >= 2.16 is required))
-PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
- AC_MSG_ERROR(GThread >= 2.16 is required))
-
-GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
-GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
-AC_SUBST(GLIB_LIBS)
-AC_SUBST(GLIB_CFLAGS)
-
AC_CONFIG_FILES([ \
Makefile \
libqdutils/Makefile \
diff --git a/libgralloc/Makefile.am b/libgralloc/Makefile.am
index 0af1db0e2..d188f6f19 100644
--- a/libgralloc/Makefile.am
+++ b/libgralloc/Makefile.am
@@ -22,12 +22,12 @@ libgralloc_la_SOURCES = gpu.cpp \
gpu.h
-libgralloc_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
+libgralloc_la_LDFLAGS = -lstdc++ -lpthread -shared -version-info 1:0:0
libgralloc_la_LDFLAGS += -lcutils -llog -lhardware
-libgralloc_la_CPPFLAGS = -DUSE_GLIB -DANDROID $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -DLOG_TAG=\"qdgralloc\"
-libgralloc_la_CFLAGS = -DUSE_GLIB -DANDROID $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -DLOG_TAG=\"qdgralloc\"
+libgralloc_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -DLOG_TAG=\"qdgralloc\"
+libgralloc_la_CFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -DLOG_TAG=\"qdgralloc\"
-libgralloc_la_LIBADD = ./../libqdutils/libqdmetadata.la libmemalloc.la
+libgralloc_la_LIBADD = ./../libqdutils/libqdutils.la ./../libqdutils/libqdMetaData.la libmemalloc.la
libmemalloc_la_SOURCES = ionalloc.cpp \
alloc_controller.cpp \
@@ -37,8 +37,8 @@ libmemalloc_la_SOURCES = ionalloc.cpp \
alloc_controller.h \
gr.h
-libmemalloc_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
+libmemalloc_la_LDFLAGS = -lstdc++ -lpthread -shared -version-info 1:0:0
libmemalloc_la_LDFLAGS += -lcutils -llog -lhardware -ldl
-libmemalloc_la_CPPFLAGS = -DUSE_GLIB -DANDROID $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -DLOG_TAG=\"qdmemalloc\"
-libmemalloc_la_CFLAGS = -DUSE_GLIB -DANDROID $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -DLOG_TAG=\"qdmemalloc\"
+libmemalloc_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -DLOG_TAG=\"qdmemalloc\"
+libmemalloc_la_CFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -DLOG_TAG=\"qdmemalloc\"
lib_LTLIBRARIES = libmemalloc.la libgralloc.la
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 16a3822e7..137c90c56 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -115,15 +115,19 @@ static void setPaddingRound(hwc_context_t *ctx, int numDisplays,
}
}
-/* Based on certain conditions, isPaddingRound will be set
+/* Based on certain conditions, isDMAStateChanging will be set
* to make this function self-contained */
static void setDMAState(hwc_context_t *ctx, int numDisplays,
hwc_display_contents_1_t** displays) {
-
- if(ctx->mRotMgr->getNumActiveSessions() == 0)
- Overlay::setDMAMode(Overlay::DMA_LINE_MODE);
-
- for(int dpy = 0; dpy < numDisplays; dpy++) {
+ int NeedsRotationDpy = 0;
+ int BufferMirrorDpy = 0;
+ for(int dpy = 0; dpy < numDisplays; dpy++) {
+ ctx->isDMAStateChanging[dpy] = false;
+ }
+ if(ctx->mRotMgr->getNumActiveSessions() == 0) {
+ Overlay::setDMAMode(Overlay::DMA_LINE_MODE);
+ }
+ for(int dpy = 0; dpy < numDisplays; dpy++) {
hwc_display_contents_1_t *list = displays[dpy];
if (LIKELY(list && list->numHwLayers > 0)) {
for(size_t layerIndex = 0; layerIndex < list->numHwLayers;
@@ -136,15 +140,26 @@ static void setDMAState(hwc_context_t *ctx, int numDisplays,
/* If a layer requires rotation, set the DMA state
* to BLOCK_MODE */
-
+ /* If primary alone holds the DMA and its state changes then
+ set DMA state changing to primary only */
if (canUseRotator(ctx, dpy) &&
(has90Transform(layer) || getRotDownscale(ctx, layer))
&& isRotationDoable(ctx, hnd)) {
if(not (ctx->mOverlay->isDMAMultiplexingSupported() &&
dpy)) {
- if(ctx->mOverlay->isPipeTypeAttached(
- overlay::utils::OV_MDP_PIPE_DMA))
- ctx->isPaddingRound = true;
+ if(ctx->mOverlay->isPipeTypeAttachedToDisplay(
+ overlay::utils::OV_MDP_PIPE_DMA, dpy)) {
+ ctx->isDMAStateChanging[dpy] = true;
+ }else {
+ NeedsRotationDpy = dpy;
+ for(int i = 0; i < numDisplays; i++) {
+ if ((i != dpy)&& ctx->mOverlay->isPipeTypeAttachedToDisplay(
+ overlay::utils::OV_MDP_PIPE_DMA, i)) {
+ ctx->isDMAStateChanging[i] = true;
+ ctx->isDMAStateChanging[NeedsRotationDpy] = true;
+ }
+ }
+ }
}
Overlay::setDMAMode(Overlay::DMA_BLOCK_MODE);
}
@@ -160,9 +175,18 @@ static void setDMAState(hwc_context_t *ctx, int numDisplays,
ctx->mExtOrientation = atoi(value);*/
if(ctx->mExtOrientation || ctx->mBufferMirrorMode) {
- if(ctx->mOverlay->isPipeTypeAttached(
- overlay::utils::OV_MDP_PIPE_DMA)) {
- ctx->isPaddingRound = true;
+ if(ctx->mOverlay->isPipeTypeAttachedToDisplay(
+ overlay::utils::OV_MDP_PIPE_DMA, dpy)) {
+ ctx->isDMAStateChanging[dpy] = true;
+ }else {
+ BufferMirrorDpy = dpy;
+ for(int i = 0; i < numDisplays; i++) {
+ if ((i != dpy)&& ctx->mOverlay->isPipeTypeAttachedToDisplay(
+ overlay::utils::OV_MDP_PIPE_DMA, i)) {
+ ctx->isDMAStateChanging[i] = true;
+ ctx->isDMAStateChanging[BufferMirrorDpy] = true;
+ }
+ }
}
Overlay::setDMAMode(Overlay::DMA_BLOCK_MODE);
}
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index c05de4a3c..0fb68637a 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -519,6 +519,13 @@ bool MDPComp::isFrameDoable(hwc_context_t *ctx) {
if(!isEnabled()) {
ALOGD_IF(isDebug(),"%s: MDP Comp. not enabled.", __FUNCTION__);
ret = false;
+ } else if (ctx->isDMAStateChanging[mDpy]) {
+ // Bail out if a padding round has been invoked in order to switch DMA
+ // state to block mode. We need this to cater for the case when a layer
+ // requires rotation in the current frame.
+ ALOGD_IF(isDebug(), "%s: padding round invoked to switch DMA state",
+ __FUNCTION__);
+ ret = false;
} else if((qdutils::MDPVersion::getInstance().is8x26() ||
qdutils::MDPVersion::getInstance().is8x16() ||
qdutils::MDPVersion::getInstance().is8x39()) &&
@@ -552,6 +559,7 @@ bool MDPComp::isFrameDoable(hwc_context_t *ctx) {
ret = false;
}
}
+
return ret;
}
diff --git a/libhwcomposer/hwc_qclient.cpp b/libhwcomposer/hwc_qclient.cpp
index 4db4fa7e1..9917f30fd 100644
--- a/libhwcomposer/hwc_qclient.cpp
+++ b/libhwcomposer/hwc_qclient.cpp
@@ -38,6 +38,8 @@
#include <hwc_qdcm.h>
#define QCLIENT_DEBUG 0
+#define FILE_MAX_MDSSBW_FLAG \
+ "/sys/devices/virtual/graphics/fb0/mdp/bw_mode_bitmap"
using namespace android;
using namespace qService;
@@ -50,7 +52,8 @@ namespace qClient {
// ----------------------------------------------------------------------------
QClient::QClient(hwc_context_t *ctx) : mHwcContext(ctx),
- mMPDeathNotifier(new MPDeathNotifier(ctx))
+ mMPDeathNotifier(new MPDeathNotifier(ctx)),
+ mCamDeathNotifier(new CamDeathNotifier())
{
ALOGD_IF(QCLIENT_DEBUG, "QClient Constructor invoked");
}
@@ -336,6 +339,85 @@ static void toggleScreenUpdate(hwc_context_t* ctx, uint32_t on) {
}
}
+
+/* register/unregister camera service */
+static bool setCameraDeathNotifier(
+ android::sp<QClient::CamDeathNotifier> camDeathNotifier, bool on) {
+ sp<IServiceManager> sm = defaultServiceManager();
+ sp<IBinder> binder = sm->getService(String16("media.camera"));
+ if (binder == 0) {
+ ALOGW("%s: CameraService not published or dead...", __FUNCTION__);
+ return false;
+ }
+ if(on) {
+ binder->linkToDeath(camDeathNotifier);
+ } else {
+ binder->unlinkToDeath(camDeathNotifier);
+ }
+ return true;
+}
+
+static bool updateDisplayBWCapForCam(bool on) {
+ char sysfsPath[255];
+ char bw[64];
+ int bw_flag = 0; // to reset to default.
+
+ memset(sysfsPath, 0, sizeof(sysfsPath));
+ snprintf(sysfsPath , sizeof(sysfsPath), FILE_MAX_MDSSBW_FLAG);
+ int sysfsFd = open(sysfsPath, O_RDWR);
+ if(sysfsFd < 0 ) {
+ ALOGE("%s: Status: %d Error in opening %s: %s",
+ __FUNCTION__, on, sysfsPath, strerror(errno));
+ return false;
+ }
+
+ if(on) {
+ bw_flag = MDSS_MAX_BW_LIMIT_CAMERA;
+ }
+ snprintf(bw, sizeof(bw), "%d", bw_flag);
+ ssize_t bytes = pwrite(sysfsFd, bw, strlen(bw), 0);
+ if(bytes < 0) {
+ ALOGE ("%s: Unable to write into %s node %s",
+ __FUNCTION__, sysfsPath, strerror(errno));
+ close(sysfsFd);
+ return false;
+ }
+ close(sysfsFd);
+ return true;
+}
+
+static void setCameraStatus(hwc_context_t* ctx,
+ android::sp<QClient::CamDeathNotifier> camDeathNotifier, uint32_t on) {
+
+ //Currently we need this only for 8939 target.
+ if(!MDPVersion::getInstance().is8x39()) {
+ ALOGI("%s Not 8939?? return", __FUNCTION__);
+ return;
+ }
+
+ if(!setCameraDeathNotifier(camDeathNotifier, on)) {
+ ALOGE("%s failed in updateCameraStatus", __FUNCTION__);
+ return;
+ }
+
+ if(!updateDisplayBWCapForCam(on)) {
+ ALOGE("%s failed in updateDisplayBWCap", __FUNCTION__);
+ return;
+ }
+
+ // Trigger a screen update so that our BW setting will reflect
+ // atleast by next vsync.
+ screenRefresh(ctx);
+}
+
+void QClient::CamDeathNotifier::binderDied(const wp<IBinder>& who) {
+ //If Cameraservice abruptly gone, reset mdss bw caps
+ //This new cap will be applicable from next frame onwards
+ if(!updateDisplayBWCapForCam(false)) {
+ ALOGE("%s failed in updateDisplayBWCap", __FUNCTION__);
+ }
+}
+
status_t QClient::notifyCallback(uint32_t command, const Parcel* inParcel,
Parcel* outParcel) {
status_t ret = NO_ERROR;
@@ -392,6 +474,10 @@ status_t QClient::notifyCallback(uint32_t command, const Parcel* inParcel,
case IQService::TOGGLE_SCREEN_UPDATE:
toggleScreenUpdate(mHwcContext, inParcel->readInt32());
break;
+ case IQService::SET_CAMERA_STATUS:
+ setCameraStatus(mHwcContext,
+ mCamDeathNotifier, inParcel->readInt32());
+ break;
default:
ret = NO_ERROR;
}
diff --git a/libhwcomposer/hwc_qclient.h b/libhwcomposer/hwc_qclient.h
index d9553773e..c1371f5cf 100644
--- a/libhwcomposer/hwc_qclient.h
+++ b/libhwcomposer/hwc_qclient.h
@@ -33,6 +33,7 @@
#include <utils/Errors.h>
#include <sys/types.h>
#include <cutils/log.h>
+#include <utils/RefBase.h>
#include <binder/IServiceManager.h>
#include <media/IMediaDeathNotifier.h>
#include <IQClient.h>
@@ -51,6 +52,13 @@ public:
const android::Parcel* inParcel,
android::Parcel* outParcel);
+ //Notifies camera service death
+ class CamDeathNotifier : public IBinder::DeathRecipient {
+ public:
+ CamDeathNotifier(){}
+ virtual void binderDied(const android::wp<IBinder>& who);
+ };
+
private:
//Notifies of Media Player death
class MPDeathNotifier : public android::IMediaDeathNotifier {
@@ -62,6 +70,7 @@ private:
hwc_context_t *mHwcContext;
const android::sp<android::IMediaDeathNotifier> mMPDeathNotifier;
+ const android::sp<QClient::CamDeathNotifier> mCamDeathNotifier;
};
}; // namespace qClient
#endif // ANDROID_QCLIENT_H
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 292cad154..cc8ed4427 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -1852,6 +1852,10 @@ int configRotator(Rotator *rot, Whf& whf,
hwc_rect_t& crop, const eMdpFlags& mdpFlags,
const eTransform& orient, const int& downscale) {
+ //Check if input switched from secure->non-secure OR non-secure->secure
+ //Need to fail rotator setup as rotator buffer needs reallocation.
+ if(!rot->isRotBufReusable(mdpFlags)) return -1;
+
// Fix alignments for TILED format
if(whf.format == MDP_Y_CRCB_H2V2_TILE ||
whf.format == MDP_Y_CBCR_H2V2_TILE) {
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 0ddb0c54b..c34eb987f 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -625,6 +625,8 @@ struct hwc_context_t {
mutable Locker mDrawLock;
//Drawing round when we use GPU
bool isPaddingRound;
+ // Used to mark composition cycle when DMA state change is required
+ bool isDMAStateChanging[HWC_NUM_DISPLAY_TYPES];
// External Orientation
int mExtOrientation;
//Flags the transition of a video session
diff --git a/liboverlay/overlay.cpp b/liboverlay/overlay.cpp
index 1a4bf03de..d8237da91 100644
--- a/liboverlay/overlay.cpp
+++ b/liboverlay/overlay.cpp
@@ -266,6 +266,16 @@ void Overlay::endAllSessions() {
}
}
+bool Overlay::isPipeTypeAttachedToDisplay(eMdpPipeType type,int dpy) {
+ for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
+ if(type == PipeBook::getPipeType((eDest)i) &&
+ mPipeBook[i].mDisplay == dpy) {
+ return true;
+ }
+ }
+ return false;
+ }
+
bool Overlay::isPipeTypeAttached(eMdpPipeType type) {
for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
if(type == PipeBook::getPipeType((eDest)i) &&
diff --git a/liboverlay/overlay.h b/liboverlay/overlay.h
index 5c93b2325..6576f60cf 100644
--- a/liboverlay/overlay.h
+++ b/liboverlay/overlay.h
@@ -119,6 +119,10 @@ public:
* displays
*/
bool isPipeTypeAttached(utils::eMdpPipeType type);
+ /* Returns if any of the requested pipe type is attached
+ * to the display
+ */
+ bool isPipeTypeAttachedToDisplay(utils::eMdpPipeType type, int dpy);
/* Compare pipe priorities and return
* 1 if 1st pipe has a higher priority
* 0 if both have the same priority
diff --git a/liboverlay/overlayMdpRot.cpp b/liboverlay/overlayMdpRot.cpp
index d32289769..6b36e04bc 100755
--- a/liboverlay/overlayMdpRot.cpp
+++ b/liboverlay/overlayMdpRot.cpp
@@ -126,6 +126,10 @@ void MdpRot::setCrop(const utils::Dim& /*crop*/) {
// NO-OP for non-mdss rotator due to possible h/w limitations
}
+bool MdpRot::isRotBufReusable(const utils::eMdpFlags& flags) {
+ return true;
+}
+
void MdpRot::setFlags(const utils::eMdpFlags& flags) {
mRotImgInfo.secure = 0;
if(flags & utils::OV_MDP_SECURE_OVERLAY_SESSION)
diff --git a/liboverlay/overlayMdssRot.cpp b/liboverlay/overlayMdssRot.cpp
index 87e134a9e..48329743b 100644
--- a/liboverlay/overlayMdssRot.cpp
+++ b/liboverlay/overlayMdssRot.cpp
@@ -110,6 +110,19 @@ bool MdssRot::init() {
return true;
}
+bool MdssRot::isRotBufReusable(const utils::eMdpFlags& flags) {
+ if((mRotInfo.flags != 0) &&
+ (((mRotInfo.flags & ovutils::OV_MDP_SECURE_OVERLAY_SESSION) &&
+ !(flags & ovutils::OV_MDP_SECURE_OVERLAY_SESSION)) ||
+ (!(mRotInfo.flags & ovutils::OV_MDP_SECURE_OVERLAY_SESSION) &&
+ (flags & ovutils::OV_MDP_SECURE_OVERLAY_SESSION)))) {
+ ALOGE("%s: Rotator buffer usage flag is changed, failing",
+ __FUNCTION__);
+ return false;
+ }
+ return true;
+}
+
void MdssRot::setSource(const overlay::utils::Whf& awhf) {
utils::Whf whf(awhf);
diff --git a/liboverlay/overlayRotator.h b/liboverlay/overlayRotator.h
index e045b440f..946492090 100644
--- a/liboverlay/overlayRotator.h
+++ b/liboverlay/overlayRotator.h
@@ -70,6 +70,7 @@ public:
virtual ~Rotator();
virtual void setSource(const utils::Whf& wfh) = 0;
virtual void setCrop(const utils::Dim& crop) = 0;
+ virtual bool isRotBufReusable(const utils::eMdpFlags& flags) = 0;
virtual void setFlags(const utils::eMdpFlags& flags) = 0;
virtual void setTransform(const utils::eTransform& rot) = 0;
virtual bool commit() = 0;
@@ -134,6 +135,7 @@ public:
virtual ~MdpRot();
virtual void setSource(const utils::Whf& wfh);
virtual void setCrop(const utils::Dim& crop);
+ virtual bool isRotBufReusable(const utils::eMdpFlags& flags);
virtual void setFlags(const utils::eMdpFlags& flags);
virtual void setTransform(const utils::eTransform& rot);
virtual bool commit();
@@ -206,6 +208,7 @@ public:
virtual ~MdssRot();
virtual void setSource(const utils::Whf& wfh);
virtual void setCrop(const utils::Dim& crop);
+ virtual bool isRotBufReusable(const utils::eMdpFlags& flags);
virtual void setFlags(const utils::eMdpFlags& flags);
virtual void setTransform(const utils::eTransform& rot);
virtual bool commit();
diff --git a/libqdutils/Makefile.am b/libqdutils/Makefile.am
index a646e9ee3..38c19b1f5 100644
--- a/libqdutils/Makefile.am
+++ b/libqdutils/Makefile.am
@@ -9,9 +9,17 @@ AM_CFLAGS = -Wundef \
-fpic \
-Wno-multichar \
-Wno-conversion
-libqdmetadata_la_SOURCES = qdMetaData.cpp \
- qdMetaData.h
-libqdmetadata_la_LDFLAGS = -lstdc++ -lpthread -lcutils -llog
-libqdmetadata_la_CPPFLAGS = -DUSE_GLIB -DANDROID $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -DLOG_TAG=\"qdmetadata\"
-libqdmetadata_la_CFLAGS = -DUSE_GLIB -DANDROID $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -DLOG_TAG=\"qdmetadata\"
-lib_LTLIBRARIES = libqdmetadata.la
+libqdMetaData_la_SOURCES = qdMetaData.cpp \
+ qdMetaData.h
+libqdMetaData_la_LDFLAGS = -lstdc++ -lpthread -lcutils -llog
+libqdMetaData_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -DLOG_TAG=\"qdMetaData\"
+libqdMetaData_la_CFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -DLOG_TAG=\"qdMetaData\"
+
+libqdutils_la_SOURCES = comptype.cpp \
+ comptype.h \
+ mdp_version.cpp \
+ mdp_version.h
+libqdutils_la_LDFLAGS = -lstdc++ -lpthread -lcutils -llog
+libqdutils_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -DLOG_TAG=\"qdutils\"
+libqdutils_la_CFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -DLOG_TAG=\"qdutils\"
+lib_LTLIBRARIES =libqdMetaData.la libqdutils.la
diff --git a/libqdutils/mdp_version.cpp b/libqdutils/mdp_version.cpp
index e800f70fe..ef97dbc8d 100644
--- a/libqdutils/mdp_version.cpp
+++ b/libqdutils/mdp_version.cpp
@@ -26,7 +26,16 @@
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef _ANDROID_
#include <cutils/log.h>
+#else
+#include <log/log.h>
+#undef PAGE_SHIFT
+#undef PAGE_SIZE
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (1 << PAGE_SHIFT)
+#endif
+
#include <linux/msm_mdp.h>
#include "mdp_version.h"
#include "qd_utils.h"
diff --git a/libqdutils/qd_utils.h b/libqdutils/qd_utils.h
index 1d4bc19e3..f491f4937 100644
--- a/libqdutils/qd_utils.h
+++ b/libqdutils/qd_utils.h
@@ -35,8 +35,11 @@
#include <ctype.h>
#include <fcntl.h>
#include <utils/Errors.h>
+#ifdef _ANDROID_
#include <utils/Log.h>
-
+#else
+#include <log/log.h>
+#endif
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <sys/poll.h>
diff --git a/libqservice/IQService.h b/libqservice/IQService.h
index 0f0dc4c13..9a1864f8c 100644
--- a/libqservice/IQService.h
+++ b/libqservice/IQService.h
@@ -58,6 +58,7 @@ public:
CONFIGURE_DYN_REFRESH_RATE,
QDCM_SVC_CMDS, // request QDCM services.
TOGGLE_SCREEN_UPDATE, // Provides ability to disable screen updates
+ SET_CAMERA_STATUS, // To notify display when camera is on and off
COMMAND_LIST_END = 400,
};
diff --git a/libqservice/QServiceUtils.h b/libqservice/QServiceUtils.h
index ff09aa97e..e9b0ffdaa 100644
--- a/libqservice/QServiceUtils.h
+++ b/libqservice/QServiceUtils.h
@@ -91,4 +91,8 @@ inline android::status_t setBufferMirrorMode(uint32_t enable) {
return sendSingleParam(qService::IQService::BUFFER_MIRRORMODE, enable);
}
+inline android::status_t setCameraLaunchStatus(uint32_t on) {
+ return sendSingleParam(qService::IQService::SET_CAMERA_STATUS, on);
+}
+
#endif /* end of include guard: QSERVICEUTILS_H */