summaryrefslogtreecommitdiff
authorshuze.ma <shuze.ma@amlogic.com>2017-11-06 06:39:41 (GMT)
committer shuze.ma <shuze.ma@amlogic.com>2017-11-06 07:57:22 (GMT)
commitf91da451b3f7b460d6a76437d71fa8ba39d840ec (patch)
treee45f313a58db24ef23de402df7ed0f2c52b5eab1
parent15d3ee5eadd38849de483660656bdcbc3c8e163c (diff)
downloadhwcomposer-f91da451b3f7b460d6a76437d71fa8ba39d840ec.zip
hwcomposer-f91da451b3f7b460d6a76437d71fa8ba39d840ec.tar.gz
hwcomposer-f91da451b3f7b460d6a76437d71fa8ba39d840ec.tar.bz2
hwc2: add display settings when uboot logo switches to bootanim [1/3]
PD# 153295 set logo_index and fb0/free_scale_switch, when uboot logo switches to bootanimation. Change-Id: I7250f99648d0fa293af57dea212ecbf851bafec2
Diffstat
-rw-r--r--hwc2/common/devices/PhysicalDevice.cpp12
-rw-r--r--hwc2/common/utils/Utils.cpp8
-rw-r--r--hwc2/common/utils/Utils.h1
-rw-r--r--hwc2/include/PhysicalDevice.h4
4 files changed, 23 insertions, 2 deletions
diff --git a/hwc2/common/devices/PhysicalDevice.cpp b/hwc2/common/devices/PhysicalDevice.cpp
index 175cfa8..7daffdd 100644
--- a/hwc2/common/devices/PhysicalDevice.cpp
+++ b/hwc2/common/devices/PhysicalDevice.cpp
@@ -59,7 +59,8 @@ PhysicalDevice::PhysicalDevice(hwc2_display_t id, Hwcomposer& hwc, IComposeDevic
mDirectComposeFrameCount(0),
mGetInitState(false),
mInitialized(false),
- mOmxVideoHandle(0){
+ mOmxVideoHandle(0),
+ mFirstPostFb(true){
CTRACE();
switch (id) {
@@ -728,6 +729,15 @@ int32_t PhysicalDevice::postFramebuffer(int32_t* outRetireFence, bool hasVideoOv
&& haveCursorLayer))) {
needBlankFb0 = true;
}
+
+ //close uboot logo, if bootanim begin to show
+ if (mFirstPostFb) {
+ mFirstPostFb = false;
+
+ Utils::setSysfsStr(DISPLAY_LOGO_INDEX, "-1");
+ Utils::setSysfsStr(DISPLAY_FB0_FREESCALE_SWTICH, "0x10001");
+ }
+
// real post framebuffer here.
DTRACE("render type: %d", mFbSyncRequest.type);
diff --git a/hwc2/common/utils/Utils.cpp b/hwc2/common/utils/Utils.cpp
index 14f6cae..52b6309 100644
--- a/hwc2/common/utils/Utils.cpp
+++ b/hwc2/common/utils/Utils.cpp
@@ -61,6 +61,11 @@ int Utils::get_int_prop(const char* prop) {
return -1;
}
+bool Utils::get_str_prop(const char *key, char *value, const char *def){
+ property_get(key, value, def);
+ return true;
+}
+
int Utils::getSysfsInt(const char* syspath, int def) {
int val = def;
char valstr[64];
@@ -123,13 +128,14 @@ int Utils::getSysfsStr(const char* syspath, char *valstr, int size,
int Utils::setSysfsStr(const char *path, const char *val) {
int bytes;
- int fd = open(path, O_CREAT | O_RDWR | O_TRUNC, 0644);
+ int fd = open(path, O_RDWR);
if (fd >= 0) {
bytes = write(fd, val, strlen(val));
//DTRACE("setSysfsStr %s= %s\n", path,val);
close(fd);
return 0;
} else {
+ ETRACE(" open file error: [%s]", path);
return -1;
}
}
diff --git a/hwc2/common/utils/Utils.h b/hwc2/common/utils/Utils.h
index 6894dfb..8e55e63 100644
--- a/hwc2/common/utils/Utils.h
+++ b/hwc2/common/utils/Utils.h
@@ -43,6 +43,7 @@ public:
static int get_int_prop(const char* prop);
static bool get_bool_prop(const char* prop);
+ static bool get_str_prop(const char *key, char *value, const char *def);
static int getSysfsInt(const char* syspath, int def);
static int getSysfsStr(const char* syspath, char *valstr, int size,
diff --git a/hwc2/include/PhysicalDevice.h b/hwc2/include/PhysicalDevice.h
index 66f925c..b4e6858 100644
--- a/hwc2/include/PhysicalDevice.h
+++ b/hwc2/include/PhysicalDevice.h
@@ -32,6 +32,9 @@
#include <binder/IServiceManager.h>
#include <utils/RefBase.h>
+#define DISPLAY_LOGO_INDEX "/sys/module/fb/parameters/osd_logo_index"
+#define DISPLAY_FB0_FREESCALE_SWTICH "/sys/class/graphics/fb0/free_scale_switch"
+
namespace android {
namespace amlogic {
@@ -261,6 +264,7 @@ private:
int mDisplayWidth;
int mDisplayHeight;
+ bool mFirstPostFb;
//omx handle for set omx pts
int32_t mOmxVideoHandle;