diff options
Diffstat (limited to 'exynos4')
-rw-r--r-- | exynos4/exynos4x12/liblights/lights.c | 21 | ||||
-rw-r--r-- | exynos4/hal/include/gralloc_priv.h | 11 |
2 files changed, 29 insertions, 3 deletions
diff --git a/exynos4/exynos4x12/liblights/lights.c b/exynos4/exynos4x12/liblights/lights.c index e8336d2..2e5c029 100644 --- a/exynos4/exynos4x12/liblights/lights.c +++ b/exynos4/exynos4x12/liblights/lights.c @@ -89,6 +89,21 @@ static int write_int(char const *path, int value) } } +static int read_int(char const *path) +{ + int fd; + char buffer[2]; + + fd = open(path, O_RDONLY); + + if (fd >= 0) { + read(fd, buffer, 1); + } + close(fd); + + return atoi(buffer); +} + static int write_str(char const *path, const char* value) { int fd; @@ -126,14 +141,14 @@ static int set_light_backlight(struct light_device_t *dev, struct light_state_t const *state) { int err = 0; - static int s_previous_brightness = -1; int brightness = rgb_to_brightness(state); + int previous_brightness = read_int(PANEL_FILE); pthread_mutex_lock(&g_lock); + err = write_int(PANEL_FILE, brightness); - if (!s_previous_brightness && (brightness > 0)) { + if (!previous_brightness && (brightness > 0)) { err = write_int(BUTTON_FILE, brightness > 0 ? 1 : 2); - s_previous_brightness = brightness; } pthread_mutex_unlock(&g_lock); diff --git a/exynos4/hal/include/gralloc_priv.h b/exynos4/hal/include/gralloc_priv.h index 8ffd161..871a84f 100644 --- a/exynos4/hal/include/gralloc_priv.h +++ b/exynos4/hal/include/gralloc_priv.h @@ -47,6 +47,17 @@ #define GRALLOC_ARM_UMP_MODULE 1 +enum { + /* SEC Private usage , for HWC to set HDMI S3D format */ + /* HDMI should display this buffer as S3D SBS LR/RL*/ + GRALLOC_USAGE_PRIVATE_SBS_LR = 0x00400000, + GRALLOC_USAGE_PRIVATE_SBS_RL = 0x00200000, + + /* HDMI should display this buffer as 3D TB LR/RL*/ + GRALLOC_USAGE_PRIVATE_TB_LR = 0x00100000, + GRALLOC_USAGE_PRIVATE_TB_RL = 0x00080000, +}; + struct private_handle_t; struct private_module_t { |