summaryrefslogtreecommitdiffstats
path: root/libhwcomposer
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-21 21:08:45 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-21 21:08:45 -0800
commite7f908e9739922f38d2fd2715efdb7a3d0def232 (patch)
treed1c5f601c19c7c0b72fcfa600e3548079a4affb7 /libhwcomposer
parent6e9f2c509818043645d739097bf03cef29a41972 (diff)
parent05a93054a3f676292b6c8f445b1bf0f18c03ca42 (diff)
downloaddevice_samsung_crespo-e7f908e9739922f38d2fd2715efdb7a3d0def232.zip
device_samsung_crespo-e7f908e9739922f38d2fd2715efdb7a3d0def232.tar.gz
device_samsung_crespo-e7f908e9739922f38d2fd2715efdb7a3d0def232.tar.bz2
am 05a93054: Merge "libhwcomposer: fix to get correct fb information after runtime restart" into ics-mr1
* commit '05a93054a3f676292b6c8f445b1bf0f18c03ca42': libhwcomposer: fix to get correct fb information after runtime restart
Diffstat (limited to 'libhwcomposer')
-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 a90a67e..ef2b531 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);