diff options
author | codeworkx <codeworkx@cyanogenmod.org> | 2012-12-02 19:39:25 +0100 |
---|---|---|
committer | codeworkx <codeworkx@cyanogenmod.org> | 2012-12-02 20:05:26 +0100 |
commit | 39aefd0fc48ae60b7db526887ce216e82c8f3ce2 (patch) | |
tree | 7ed4f64c3f491b9ccc891c9e94fa27eadc54ba98 /exynos4/hal/libhwcomposer/SecHWC.cpp | |
parent | 8b9deaf74eba92bac8725666c2f99e51412a5b6f (diff) | |
download | android_hardware_samsung-39aefd0fc48ae60b7db526887ce216e82c8f3ce2.tar.gz android_hardware_samsung-39aefd0fc48ae60b7db526887ce216e82c8f3ce2.tar.bz2 android_hardware_samsung-39aefd0fc48ae60b7db526887ce216e82c8f3ce2.zip |
libhwcomposer: keep window 2 open
Window 2 is used to query global info about the LCD.
Kanged from patch for aries by Greg Hackmann <ghackmann@google.com>
Change-Id: Idf754d4536337d6c06652c1d0c744dc7c0936b15
Diffstat (limited to 'exynos4/hal/libhwcomposer/SecHWC.cpp')
-rw-r--r-- | exynos4/hal/libhwcomposer/SecHWC.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/exynos4/hal/libhwcomposer/SecHWC.cpp b/exynos4/hal/libhwcomposer/SecHWC.cpp index 9f32226..d439216 100644 --- a/exynos4/hal/libhwcomposer/SecHWC.cpp +++ b/exynos4/hal/libhwcomposer/SecHWC.cpp @@ -927,7 +927,7 @@ static int hwc_eventControl(struct hwc_composer_device_1* dev, int dpy, switch (event) { case HWC_EVENT_VSYNC: int val = !!enabled; - int err = ioctl(ctx->win[0].fd, S3CFB_SET_VSYNC_INT, &val); + int err = ioctl(ctx->global_lcd_win.fd, S3CFB_SET_VSYNC_INT, &val); if (err < 0) return -errno; @@ -1022,6 +1022,11 @@ static int hwc_device_close(struct hw_device_t *dev) ret = -1; } + if (window_close(&ctx->global_lcd_win) < 0) { + SEC_HWC_Log(HWC_LOG_ERROR, "%s::window_close() fail", __func__); + ret = -1; + } + for (i = 0; i < NUM_OF_WIN; i++) { if (window_close(&ctx->win[i]) < 0) SEC_HWC_Log(HWC_LOG_DEBUG, "%s::window_close() fail", __func__); @@ -1061,7 +1066,7 @@ static int hwc_device_open(const struct hw_module_t* module, const char* name, dev->device.prepare = hwc_prepare; dev->device.set = hwc_set; dev->device.eventControl = hwc_eventControl; - dev->device.blank = hwc_blank; + dev->device.blank = hwc_blank; dev->device.query = hwc_query; dev->device.registerProcs = hwc_registerProcs; *device = &dev->device.common; @@ -1069,17 +1074,24 @@ static int hwc_device_open(const struct hw_module_t* module, const char* name, //initializing memset(&(dev->fimc), 0, sizeof(s5p_fimc_t)); - /* open WIN0 & WIN1 here */ - for (int i = 0; i < NUM_OF_WIN; i++) { + /* open WIN0 & WIN1 here */ + for (int i = 0; i < NUM_OF_WIN; i++) { if (window_open(&(dev->win[i]), i) < 0) { SEC_HWC_Log(HWC_LOG_ERROR, "%s:: Failed to open window %d device ", __func__, i); - status = -EINVAL; - goto err; + status = -EINVAL; + goto err; } - } + } + + /* open window 2, used to query global LCD info */ + if (window_open(&dev->global_lcd_win, 2) < 0) { + SEC_HWC_Log(HWC_LOG_ERROR, "%s:: Failed to open window 2 device ", __func__); + status = -EINVAL; + goto err; + } - if (window_get_global_lcd_info(dev->win[0].fd, &dev->lcd_info) < 0) { + if (window_get_global_lcd_info(dev) < 0) { SEC_HWC_Log(HWC_LOG_ERROR, "%s::window_get_global_lcd_info is failed : %s", __func__, strerror(errno)); @@ -1152,6 +1164,9 @@ err: if (destroyFimc(&dev->fimc) < 0) SEC_HWC_Log(HWC_LOG_ERROR, "%s::destroyFimc() fail", __func__); + if (window_close(&dev->global_lcd_win) < 0) + SEC_HWC_Log(HWC_LOG_ERROR, "%s::window_close() fail", __func__); + for (int i = 0; i < NUM_OF_WIN; i++) { if (window_close(&dev->win[i]) < 0) SEC_HWC_Log(HWC_LOG_DEBUG, "%s::window_close() fail", __func__); |