hwc: add qdcm service to be loaded in HWC and perform service
1. Add one binder command to display.qservice to serve the
binder requests received from SDK.
2. Each subcommand will be corresponding to one command
handler. Command handler will pass the requests to
qdcm library.
3. Dynamically load qdcm library, where all apis are
implemented.
4. apply default mode function will be invoked once
bootanimation event is detected
Change-Id: I28fdf5f2561fcaffbfd3b7a1e9b136a4c372300e
diff --git a/libhwcomposer/Android.mk b/libhwcomposer/Android.mk
index c344045..348fbd3 100644
--- a/libhwcomposer/Android.mk
+++ b/libhwcomposer/Android.mk
@@ -8,6 +8,11 @@
LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes) \
$(TOP)/external/skia/include/core \
$(TOP)/external/skia/include/images
+
+LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/qdcm/inc \
+ $(TARGET_OUT_HEADERS)/common/inc \
+ $(TARGET_OUT_HEADERS)/pp/inc
+
LOCAL_SHARED_LIBRARIES := $(common_libs) libEGL liboverlay \
libhdmi libqdutils libhardware_legacy \
libdl libmemalloc libqservice libsync \
@@ -38,4 +43,14 @@
hwc_dump_layers.cpp \
hwc_ad.cpp \
hwc_virtual.cpp
+
+TARGET_MIGRATE_QDCM_LIST := msm8909
+TARGET_MIGRATE_QDCM := $(call is-board-platform-in-list,$(TARGET_MIGRATE_QDCM_LIST))
+
+ifeq ($(TARGET_MIGRATE_QDCM), true)
+LOCAL_SRC_FILES += hwc_qdcm.cpp
+else
+LOCAL_SRC_FILES += hwc_qdcm_legacy.cpp
+endif
+
include $(BUILD_SHARED_LIBRARY)
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 85e5d1b..6acb663 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -39,9 +39,11 @@
#include "hwc_ad.h"
#include "profiler.h"
#include "hwc_virtual.h"
+#include "hwc_qdcm.h"
using namespace qhwc;
using namespace overlay;
+using namespace qQdcm;
#define VSYNC_DEBUG 0
#define POWER_MODE_DEBUG 1
@@ -278,6 +280,7 @@
hwc_context_t* ctx = (hwc_context_t*)(dev);
const int dpy = HWC_DISPLAY_PRIMARY;
bool fbComp = false;
+
if (!ctx->mBootAnimCompleted)
processBootAnimCompleted(ctx);
if (LIKELY(list && list->numHwLayers > 1) && ctx->dpyAttr[dpy].connected &&
diff --git a/libhwcomposer/hwc_qclient.cpp b/libhwcomposer/hwc_qclient.cpp
index 34de2e6..f18ad36 100644
--- a/libhwcomposer/hwc_qclient.cpp
+++ b/libhwcomposer/hwc_qclient.cpp
@@ -37,6 +37,7 @@
#include <display_config.h>
#include <hdmi.h>
#include <video/msm_hdmi_modes.h>
+#include <hwc_qdcm.h>
#define QCLIENT_DEBUG 0
@@ -45,6 +46,7 @@
using namespace qhwc;
using namespace overlay;
using namespace qdutils;
+using namespace qQdcm;
namespace qClient {
@@ -554,6 +556,8 @@
case IQService::GET_DISPLAY_ATTRIBUTES_FOR_CONFIG:
ret = getDisplayAttributesForConfig(mHwcContext, inParcel,
outParcel);
+ case IQService::QDCM_SVC_CMDS:
+ qdcmCmdsHandler(mHwcContext, inParcel, outParcel);
break;
default:
ret = NO_ERROR;
diff --git a/libhwcomposer/hwc_qdcm.cpp b/libhwcomposer/hwc_qdcm.cpp
new file mode 100644
index 0000000..65707e2
--- /dev/null
+++ b/libhwcomposer/hwc_qdcm.cpp
@@ -0,0 +1,310 @@
+/*
+ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <hwc_qdcm.h>
+#include <hwc_utils.h>
+#include <utils/String16.h>
+#include <mdp_version.h>
+#include "mode_manager.h"
+#include "libmm-disp-apis.h"
+#include "IQService.h"
+
+using namespace android;
+using namespace qService;
+using namespace qhwc;
+using namespace qmode;
+
+namespace qQdcm {
+//----------------------------------------------------------------------------
+void qdcmInitContext(hwc_context_t *ctx)
+{
+ loadQdcmLibrary(ctx);
+}
+
+void qdcmCloseContext(hwc_context_t *ctx)
+{
+ if (ctx->mQdcmInfo.mQdcmMode) {
+ unloadQdcmLibrary(ctx);
+ }
+}
+
+void qdcmApplyDefaultAfterBootAnimationDone(hwc_context_t *ctx)
+{
+ if (ctx->mQdcmInfo.mQdcmMode)
+ ctx->mQdcmInfo.mQdcmMode->applyDefaultMode(0);
+}
+
+static void qdcmSetActiveMode(hwc_context_t *ctx, const Parcel *in, Parcel *out)
+{
+ int ret = 0;
+
+ if (ctx->mQdcmInfo.mQdcmMode && in && out) {
+
+ struct PARAMS {
+ int dispid;
+ int mode_id;
+ } params = { in->readInt32(), in->readInt32()};
+
+ ret = ctx->mQdcmInfo.mQdcmMode->requestRoute((int)CMD_SET_ACTIVE_MODE,
+ (void *)¶ms, (void *)NULL);
+
+ out->writeInt32(ret); //return operation status via binder.
+ }
+}
+
+static void qdcmSetDefaultMode(hwc_context_t *ctx, const Parcel *in, Parcel *out)
+{
+ int ret = 0;
+
+ if (ctx->mQdcmInfo.mQdcmMode && in && out) {
+
+ struct PARAMS {
+ int dispid;
+ int mode_id;
+ } params = { in->readInt32(), in->readInt32()};
+
+ ret = ctx->mQdcmInfo.mQdcmMode->requestRoute((int)CMD_SET_DEFAULT_MODE,
+ (void *)¶ms, (void *)NULL);
+
+ out->writeInt32(ret); //return operation status via binder.
+ }
+}
+
+static void qdcmGetDefaultMode(hwc_context_t *ctx,
+ const Parcel *in, Parcel *out)
+{
+ int ret = 0;
+
+ if (ctx->mQdcmInfo.mQdcmMode && in && out) {
+
+ struct PARAMS {
+ int dispid;
+ } params = { in->readInt32() };
+ int modeid = 0;
+
+ ret = ctx->mQdcmInfo.mQdcmMode->requestRoute((int)CMD_GET_DEFAULT_MODE,
+ (const void *)¶ms, (void *)&modeid);
+
+ out->writeInt32(modeid);
+ out->writeInt32(ret); //return operation status via binder.
+ }
+}
+
+static void qdcmGetColorBalanceRange(hwc_context_t *ctx,
+ const Parcel *in, Parcel *out)
+{
+}
+
+static void qdcmGetColorBalance(hwc_context_t *ctx,
+ const Parcel *in, Parcel *out)
+{
+ int ret = 0;
+
+ if (ctx->mQdcmInfo.mQdcmMode && in && out) {
+
+ struct PARAMS {
+ int dispid;
+ } params = { in->readInt32() };
+ int warmness = 0;
+
+ ret = ctx->mQdcmInfo.mQdcmMode->requestRoute((int)CMD_GET_CB,
+ (const void *)¶ms, (void *)&warmness);
+
+ out->writeInt32(warmness);
+ out->writeInt32(ret); //return operation status via binder.
+ }
+}
+
+static void qdcmSetColorBalance(hwc_context_t *ctx,
+ const Parcel *in, Parcel *out)
+{
+ int ret = 0;
+
+ if (ctx->mQdcmInfo.mQdcmMode && in && out) {
+
+ struct PARAMS {
+ int dispid;
+ int warmness;
+ } params = { in->readInt32(), in->readInt32() };
+
+ ALOGD_IF(QDCM_DEBUG, "%s dispID = %d, warmness = %d\n",
+ __FUNCTION__, params.dispid, params.warmness);
+
+ ret = ctx->mQdcmInfo.mQdcmMode->requestRoute((int)CMD_SET_CB,
+ (const void *)¶ms, NULL);
+
+ out->writeInt32(ret); //return operation status via binder.
+ }
+}
+
+static void qdcmSaveModeV2(hwc_context_t *ctx, const Parcel *in, Parcel *out)
+{
+ int ret = 0;
+
+ if (ctx->mQdcmInfo.mQdcmMode && in && out) {
+
+ struct PARAMS {
+ int dispid;
+ const char *name;
+ int mode_id;
+ } params = { in->readInt32(), in->readCString(), in->readInt32() };
+ int value = 0;
+
+ ret = ctx->mQdcmInfo.mQdcmMode->requestRoute((int)CMD_SAVE_MODE_V2,
+ (const void *)¶ms, (void *)&value);
+
+ out->writeInt32(value);
+ out->writeInt32(ret); //return operation status via binder.
+ }
+}
+
+static void qdcmSetPaConfig(hwc_context_t *ctx, const Parcel *in, Parcel *out)
+{
+ int ret = 0;
+
+ if (ctx->mQdcmInfo.mQdcmMode && in && out) {
+
+ struct PARAMS {
+ int id;
+ struct disp_pa_config pa;
+ } params;
+ int value = 0;
+
+ params.id = in->readInt32();
+ params.pa.ops = in->readInt32();
+ params.pa.data.hue = in->readInt32();
+ params.pa.data.saturation = in->readInt32();
+ params.pa.data.value = in->readInt32();
+ params.pa.data.contrast = in->readInt32();
+ params.pa.data.sat_thresh = in->readInt32();
+
+ ret = ctx->mQdcmInfo.mQdcmMode->requestRoute((int)CMD_SET_PA_CONFIG,
+ (const void *)¶ms, NULL);
+
+ out->writeInt32(ret); //return operation status via binder.
+ }
+}
+
+static void qdcmGetPaConfig(hwc_context_t *ctx, const Parcel *in, Parcel *out)
+{
+ int ret = 0;
+
+ if (ctx->mQdcmInfo.mQdcmMode && in && out) {
+
+ struct PARAMS {
+ int dispid;
+ } params = { in->readInt32() };
+ struct disp_pa_config value;
+
+ ret = ctx->mQdcmInfo.mQdcmMode->requestRoute((int)CMD_GET_PA_CONFIG,
+ (const void *)¶ms, (void *)&value);
+
+ out->writeInt32(value.ops);
+ out->writeInt32(value.data.hue);
+ out->writeInt32(value.data.saturation);
+ out->writeInt32(value.data.value);
+ out->writeInt32(value.data.contrast);
+ out->writeInt32(value.data.sat_thresh);
+
+ out->writeInt32(ret); //return operation status via binder.
+ }
+}
+
+static void qdcmGetPaRange(hwc_context_t *ctx, const Parcel *in, Parcel *out)
+{
+ int ret = 0;
+
+ if (ctx->mQdcmInfo.mQdcmMode && in && out) {
+
+ struct PARAMS {
+ int dispid;
+ } params = { in->readInt32() };
+
+ struct disp_pa_range value;
+
+ ret = ctx->mQdcmInfo.mQdcmMode->requestRoute((int)CMD_GET_PA_RANGE,
+ (const void *)¶ms, (void *)&value);
+
+ out->writeInt32(value.max.hue);
+ out->writeInt32(value.max.saturation);
+ out->writeInt32(value.max.value);
+ out->writeInt32(value.max.contrast);
+ out->writeInt32(value.max.sat_thresh);
+ out->writeInt32(value.min.hue);
+ out->writeInt32(value.min.saturation);
+ out->writeInt32(value.min.value);
+ out->writeInt32(value.min.contrast);
+ out->writeInt32(value.min.sat_thresh);
+
+ out->writeInt32(ret); //return operation status via binder.
+ }
+}
+
+void qdcmCmdsHandler(hwc_context_t *ctx, const Parcel *in, Parcel *out)
+{
+ int subcmd = in->readInt32();
+
+ ALOGD_IF(QDCM_DEBUG, "%s enter subcmd = %d\n", __FUNCTION__, subcmd);
+ switch (subcmd) {
+ case CMD_SET_ACTIVE_MODE:
+ qdcmSetActiveMode(ctx, in, out);
+ break;
+ case CMD_SET_DEFAULT_MODE:
+ qdcmSetDefaultMode(ctx, in, out);
+ break;
+ case CMD_GET_DEFAULT_MODE:
+ qdcmGetDefaultMode(ctx, in, out);
+ break;
+ case CMD_GET_CB_RANGE:
+ qdcmGetColorBalanceRange(ctx, in, out);
+ break;
+ case CMD_GET_CB:
+ qdcmGetColorBalance(ctx, in, out);
+ break;
+ case CMD_SET_CB:
+ qdcmSetColorBalance(ctx, in, out);
+ break;
+ case CMD_SAVE_MODE_V2:
+ qdcmSaveModeV2(ctx, in, out);
+ break;
+ case CMD_SET_PA_CONFIG:
+ qdcmSetPaConfig(ctx, in, out);
+ break;
+ case CMD_GET_PA_CONFIG:
+ qdcmGetPaConfig(ctx, in, out);
+ break;
+ case CMD_GET_PA_RANGE:
+ qdcmGetPaRange(ctx, in, out);
+ break;
+ }
+}
+
+
+} //namespace qQdcm
+
diff --git a/libhwcomposer/hwc_qdcm.h b/libhwcomposer/hwc_qdcm.h
new file mode 100644
index 0000000..14d3d3e
--- /dev/null
+++ b/libhwcomposer/hwc_qdcm.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ANDROID_QDCM_H
+#define ANDROID_QDCM_H
+
+#include <utils/Errors.h>
+#include <sys/types.h>
+#include <cutils/log.h>
+#include <hwc_utils.h>
+#include <dlfcn.h>
+#include <binder/Parcel.h>
+#include <cutils/properties.h>
+#include <mode_manager.h>
+
+#define QDCM_DEBUG 0
+
+namespace qmode {
+class ModeManager;
+}
+
+using namespace android;
+
+namespace qQdcm {
+// ----------------------------------------------------------------------------
+
+//function prototypes used for QDCM library and service
+static inline void loadQdcmLibrary(hwc_context_t *ctx)
+{
+ ctx->mQdcmInfo.mQdcmLib = dlopen("libmm-qdcm.so", RTLD_NOW);
+ qmode::ModeManager* (*factory)() = NULL;
+
+ if (ctx->mQdcmInfo.mQdcmLib)
+ *(void **)&factory = dlsym(ctx->mQdcmInfo.mQdcmLib, "getObject");
+
+ if (factory) {
+ ctx->mQdcmInfo.mQdcmMode = factory();
+ } else {
+ ctx->mQdcmInfo.mQdcmMode = NULL;
+ ALOGE("QDCM LIbrary load failing!");
+ }
+
+ ALOGD_IF(QDCM_DEBUG, "QDCM LIbrary loaded successfully!");
+}
+
+static inline void unloadQdcmLibrary(hwc_context_t *ctx)
+{
+ void (*destroy)(qmode::ModeManager*) = NULL;
+
+ if (ctx->mQdcmInfo.mQdcmLib) {
+ *(void **)&destroy = dlsym(ctx->mQdcmInfo.mQdcmLib, "deleteObject");
+
+ if (destroy) {
+ destroy(ctx->mQdcmInfo.mQdcmMode);
+ ctx->mQdcmInfo.mQdcmMode = NULL;
+ }
+
+ dlclose(ctx->mQdcmInfo.mQdcmLib);
+ ctx->mQdcmInfo.mQdcmLib = NULL;
+ }
+}
+
+void qdcmInitContext(hwc_context_t *);
+void qdcmCloseContext(hwc_context_t *);
+void qdcmApplyDefaultAfterBootAnimationDone(hwc_context_t *);
+void qdcmCmdsHandler(hwc_context_t*, const Parcel*, Parcel*);
+
+}; // namespace qQdcm
+#endif // ANDROID_QDCM_H
diff --git a/libhwcomposer/hwc_qdcm_legacy.cpp b/libhwcomposer/hwc_qdcm_legacy.cpp
new file mode 100644
index 0000000..fa3efc2
--- /dev/null
+++ b/libhwcomposer/hwc_qdcm_legacy.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <hwc_qdcm.h>
+#include <hwc_utils.h>
+#include <IQService.h>
+#include <mdp_version.h>
+#include "mode_manager.h"
+
+using namespace android;
+using namespace qService;
+using namespace qhwc;
+
+namespace qQdcm {
+//----------------------------------------------------------------------------
+void qdcmInitContext(hwc_context_t *ctx)
+{
+}
+
+void qdcmCloseContext(hwc_context_t *ctx)
+{
+}
+
+void qdcmApplyDefaultAfterBootAnimationDone(hwc_context_t *ctx)
+{
+ loadQdcmLibrary(ctx);
+ if (ctx->mQdcmInfo.mQdcmMode)
+ ctx->mQdcmInfo.mQdcmMode->applyDefaultMode(0);
+ unloadQdcmLibrary(ctx);
+}
+
+//do nothing in case qdcm legacy implementation.
+void qdcmCmdsHandler(hwc_context_t *ctx, const Parcel *in, Parcel *out)
+{
+}
+
+
+} //namespace qQdcm
+
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index a3cb196..db982db 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -43,6 +43,7 @@
#include "comptype.h"
#include "hwc_virtual.h"
#include "qd_utils.h"
+#include "hwc_qdcm.h"
#include <sys/sysinfo.h>
#include <dlfcn.h>
#include <video/msm_hdmi_modes.h>
@@ -52,6 +53,7 @@
using namespace android;
using namespace overlay;
using namespace overlay::utils;
+using namespace qQdcm;
namespace ovutils = overlay::utils;
#ifdef QCOM_BSP
@@ -477,6 +479,10 @@
memset(&(ctx->mPtorInfo), 0, sizeof(ctx->mPtorInfo));
ctx->mHPDEnabled = false;
+
+ //init qdcm service related context.
+ qdcmInitContext(ctx);
+
ALOGI("Initializing Qualcomm Hardware Composer");
ALOGI("MDP version: %d", ctx->mMDP.version);
@@ -490,6 +496,9 @@
void closeContext(hwc_context_t *ctx)
{
+ //close qdcm service related context.
+ qdcmCloseContext(ctx);
+
if(ctx->mOverlay) {
delete ctx->mOverlay;
ctx->mOverlay = NULL;
@@ -2701,29 +2710,16 @@
void processBootAnimCompleted(hwc_context_t *ctx) {
char value[PROPERTY_VALUE_MAX];
int ret = -1;
- int (*applyMode)(int) = NULL;
- void *modeHandle = NULL;
// Applying default mode after bootanimation is finished
property_get("init.svc.bootanim", value, "running");
if (!strncmp(value,"stopped",strlen("stopped"))) {
- modeHandle = dlopen("libmm-qdcm.so", RTLD_NOW);
- if (modeHandle) {
- *(void **)&applyMode = dlsym(modeHandle, "applyDefaults");
- if (applyMode) {
- ret = applyMode(HWC_DISPLAY_PRIMARY);
- if (ret)
- ALOGD("%s: Not able to apply default mode", __FUNCTION__);
- } else {
- ALOGE("%s: No symbol applyDefaults found", __FUNCTION__);
- }
- dlclose(modeHandle);
- } else {
- ALOGE("%s: Not able to load libmm-qdcm.so", __FUNCTION__);
- }
-
ctx->mBootAnimCompleted = true;
+
+ //one-shot action check if bootanimation completed then apply
+ //default display mode.
+ qdcmApplyDefaultAfterBootAnimationDone(ctx);
}
}
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index af43514..ac61e68 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -55,6 +55,10 @@
namespace ovutils = overlay::utils;
+namespace qmode {
+class ModeManager;
+}
+
namespace overlay {
class Overlay;
class Rotator;
@@ -611,6 +615,13 @@
EGLDisplay mEGLDisplay;
};
+//struct holds the information about libmm-qdcm.so
+struct qdcm_info {
+ qmode::ModeManager *mQdcmMode;
+ void *mQdcmLib;
+ bool mBootAnimCompleted;
+};
+
// -----------------------------------------------------------------------------
// HWC context
// This structure contains overall state
@@ -698,6 +709,8 @@
bool mBootAnimCompleted;
// Display binder service
qService::QService* mQService;
+ //struct holds the information about display tuning service library.
+ struct qdcm_info mQdcmInfo;
};
namespace qhwc {