summaryrefslogtreecommitdiffstats
path: root/libhwcomposer
diff options
context:
space:
mode:
authorjung-min.oh <jung-min.oh@samsung.com>2011-11-18 21:41:14 +0900
committerMathias Agopian <mathias@google.com>2011-11-21 15:04:00 -0800
commit7c4b5c2d1820cdf3b753af4057b9f8b56d6a408d (patch)
tree05393c050e14d44584bc7886878036cfd6736b74 /libhwcomposer
parent037a316053578a4fc520d5311ee322bad1d291fe (diff)
downloaddevice_samsung_crespo-7c4b5c2d1820cdf3b753af4057b9f8b56d6a408d.zip
device_samsung_crespo-7c4b5c2d1820cdf3b753af4057b9f8b56d6a408d.tar.gz
device_samsung_crespo-7c4b5c2d1820cdf3b753af4057b9f8b56d6a408d.tar.bz2
libhwcomposer: fix to get correct fb information after runtime restart
Modify to get fb information from default window in order to get correct information after runtime restart. This patch is for Issue 5624445. Change-Id: I4e7741637032b69a9e4d3a11f7273a766f77e5d9 Signed-off-by: jung-min.oh <jung-min.oh@samsung.com>
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 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);