summaryrefslogtreecommitdiff
authormichael.zhang <michael.zhang@amlogic.com>2013-05-09 04:56:13 (GMT)
committer timyao <tim.yao@amlogic.com>2013-05-14 02:47:09 (GMT)
commit0f4395476a95247ecef2863591c11e1dfb558c45 (patch)
tree2fec147289cdac302ba565dba6d726ccd5c2965b
parenta1552259cef9462d0133b19288b074b5e6552851 (diff)
downloadhwcomposer-0f4395476a95247ecef2863591c11e1dfb558c45.zip
hwcomposer-0f4395476a95247ecef2863591c11e1dfb558c45.tar.gz
hwcomposer-0f4395476a95247ecef2863591c11e1dfb558c45.tar.bz2
PD #69622: support HDMI mode dualdisplay4
Diffstat
-rwxr-xr-x[-rw-r--r--]Android.mk2
-rwxr-xr-xhwcomposer.cpp33
2 files changed, 33 insertions, 2 deletions
diff --git a/Android.mk b/Android.mk
index 2054a3d..1e9e89f 100644..100755
--- a/Android.mk
+++ b/Android.mk
@@ -8,7 +8,7 @@ LOCAL_PATH := $(call my-dir)
# /system/lib/hw/hwcomposer.amlogic.so
include $(CLEAR_VARS)
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
-LOCAL_SHARED_LIBRARIES := liblog libEGL libamavutils
+LOCAL_SHARED_LIBRARIES := liblog libEGL libutils libamavutils libcutils
LOCAL_SRC_FILES := hwcomposer.cpp
AMPLAYER_APK_DIR=$(TOP)/packages/amlogic/LibPlayer/
diff --git a/hwcomposer.cpp b/hwcomposer.cpp
index 3b875f4..481dd62 100755
--- a/hwcomposer.cpp
+++ b/hwcomposer.cpp
@@ -23,6 +23,7 @@
#include <cutils/log.h>
#include <cutils/atomic.h>
+#include <cutils/properties.h>
#include <hardware/hwcomposer.h>
@@ -73,16 +74,46 @@ hwc_module_t HAL_MODULE_INFO_SYM = {
/*****************************************************************************/
+int video_on_vpp2_enabled(void)
+{
+ int ret = 0;
+
+ // ro.vout.dualdisplay4
+ char val[32];
+ memset(val, 0, sizeof(val));
+ if (property_get("ro.vout.dualdisplay4", val, "false")
+ && strcmp(val, "true") == 0) {
+ ret = 1;
+ }
+
+ return ret;
+}
+
static void hwc_overlay_compose(hwc_composer_device_1_t *dev, hwc_layer_1_t const* l) {
int angle;
struct hwc_context_1_t* ctx = (struct hwc_context_1_t*)dev;
+ static char last_val[32] = "0";
+ int vpp_changed = 0;
+
+ if (video_on_vpp2_enabled()) {
+ char val[32];
+ memset(val, 0, sizeof(val));
+ if (amsysfs_get_sysfs_str("/sys/module/amvideo/parameters/cur_dev_idx", val, sizeof(val)) == 0) {
+ if ((strncmp(val, last_val, 1) != 0)) {
+ strcpy(last_val, val);
+ vpp_changed = 1;
+ }
+ }
+ }
+
if ((ctx->saved_layer == l) &&
(ctx->saved_transform == l->transform) &&
(ctx->saved_left == l->displayFrame.left) &&
(ctx->saved_top == l->displayFrame.top) &&
(ctx->saved_right == l->displayFrame.right) &&
- (ctx->saved_bottom = l->displayFrame.bottom)) {
+ (ctx->saved_bottom == l->displayFrame.bottom) &&
+ !vpp_changed) {
return;
}