summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-21 17:57:41 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-21 17:57:41 -0800
commit05a93054a3f676292b6c8f445b1bf0f18c03ca42 (patch)
treeea10a0d186fe12e4becdf4b18cd1c02ded85a3af
parent647f01f044e9ec88922aef591c3604f0664cfc03 (diff)
parent7c4b5c2d1820cdf3b753af4057b9f8b56d6a408d (diff)
downloaddevice_samsung_crespo-05a93054a3f676292b6c8f445b1bf0f18c03ca42.zip
device_samsung_crespo-05a93054a3f676292b6c8f445b1bf0f18c03ca42.tar.gz
device_samsung_crespo-05a93054a3f676292b6c8f445b1bf0f18c03ca42.tar.bz2
Merge "libhwcomposer: fix to get correct fb information after runtime restart" into ics-mr1
-rw-r--r--libhwcomposer/SecHWC.cpp3
-rw-r--r--libhwcomposer/SecHWCUtils.cpp22
-rw-r--r--libhwcomposer/SecHWCUtils.h2
3 files changed, 21 insertions, 6 deletions
diff --git a/libhwcomposer/SecHWC.cpp b/libhwcomposer/SecHWC.cpp
index 0f81277..c9970a1 100644
--- a/libhwcomposer/SecHWC.cpp
+++ b/libhwcomposer/SecHWC.cpp
@@ -487,7 +487,8 @@ static int hwc_device_open(const struct hw_module_t* module, const char* name,
}
}
- if (window_get_global_lcd_info(dev->win[0].fd, &dev->lcd_info) < 0) {
+ /* get default window config */
+ if (window_get_global_lcd_info(&dev->lcd_info) < 0) {
LOGE("%s::window_get_global_lcd_info is failed : %s",
__func__, strerror(errno));
status = -EINVAL;
diff --git a/libhwcomposer/SecHWCUtils.cpp b/libhwcomposer/SecHWCUtils.cpp
index c184348..4a5b7b4 100644
--- a/libhwcomposer/SecHWCUtils.cpp
+++ b/libhwcomposer/SecHWCUtils.cpp
@@ -41,6 +41,7 @@ int window_open(struct hwc_win_info_t *win, int id)
switch (id) {
case 0:
case 1:
+ case 2:
break;
default:
LOGE("%s::id(%d) is weird", __func__, id);
@@ -165,13 +166,22 @@ int window_hide(struct hwc_win_info_t *win)
return 0;
}
-int window_get_global_lcd_info(int fd, struct fb_var_screeninfo *lcd_info)
+int window_get_global_lcd_info(struct fb_var_screeninfo *lcd_info)
{
- if (ioctl(fd, FBIOGET_VSCREENINFO, lcd_info) < 0) {
- LOGE("FBIOGET_VSCREENINFO failed : %s", strerror(errno));
+ struct hwc_win_info_t win;
+ int ret = 0;
+
+ if (window_open(&win, 2) < 0) {
+ LOGE("%s:: Failed to open window 2 device ", __func__);
return -1;
}
+ if (ioctl(win.fd, FBIOGET_VSCREENINFO, lcd_info) < 0) {
+ LOGE("FBIOGET_VSCREENINFO failed : %s", strerror(errno));
+ ret = -1;
+ goto fun_err;
+ }
+
if (lcd_info->xres == 0) {
lcd_info->xres = DEFAULT_LCD_WIDTH;
lcd_info->xres_virtual = DEFAULT_LCD_WIDTH;
@@ -185,7 +195,11 @@ int window_get_global_lcd_info(int fd, struct fb_var_screeninfo *lcd_info)
if (lcd_info->bits_per_pixel == 0)
lcd_info->bits_per_pixel = DEFAULT_LCD_BPP;
- return 0;
+fun_err:
+ if (window_close(&win) < 0)
+ LOGE("%s::window2 close fail", __func__);
+
+ return ret;
}
int fimc_v4l2_set_src(int fd, unsigned int hw_ver, s5p_fimc_img_info *src)
diff --git a/libhwcomposer/SecHWCUtils.h b/libhwcomposer/SecHWCUtils.h
index 880e073..21d6598 100644
--- a/libhwcomposer/SecHWCUtils.h
+++ b/libhwcomposer/SecHWCUtils.h
@@ -127,7 +127,7 @@ int window_get_info(struct hwc_win_info_t *win);
int window_pan_display(struct hwc_win_info_t *win);
int window_show(struct hwc_win_info_t *win);
int window_hide(struct hwc_win_info_t *win);
-int window_get_global_lcd_info(int fd, struct fb_var_screeninfo *lcd_info);
+int window_get_global_lcd_info(struct fb_var_screeninfo *lcd_info);
int createFimc(s5p_fimc_t *fimc);
int destroyFimc(s5p_fimc_t *fimc);