diff options
author | Lajos Molnar <molnar@ti.com> | 2011-10-03 17:07:48 -0500 |
---|---|---|
committer | Erik Gilling <konkers@android.com> | 2011-10-04 11:11:36 -0700 |
commit | 165c2c16af2cdf23b1ab87c4b6f1ce95827a8a1c (patch) | |
tree | da232d089c4e906b8b740f4ff22502ec7b48cdd2 /hwc/hwc.c | |
parent | eec1a7791b8c390c5088dc1a606e8de0f670f0c4 (diff) | |
download | hardware_ti_omap4-165c2c16af2cdf23b1ab87c4b6f1ce95827a8a1c.zip hardware_ti_omap4-165c2c16af2cdf23b1ab87c4b6f1ce95827a8a1c.tar.gz hardware_ti_omap4-165c2c16af2cdf23b1ab87c4b6f1ce95827a8a1c.tar.bz2 |
hwc: reset screen before first set
Move resetting of screen (blank/unblank) to just before first
set. Also turn off bootloader image, as blank/unblank does not
change the composition.
Change-Id: Ia1d25887dcc566ba2c20f8d390199d815d374d7a
Signed-off-by: Lajos Molnar <molnar@ti.com>
Diffstat (limited to 'hwc/hwc.c')
-rw-r--r-- | hwc/hwc.c | 42 |
1 files changed, 31 insertions, 11 deletions
@@ -1024,6 +1024,34 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t* return 0; } +static void omap4_hwc_reset_screen(omap4_hwc_device_t *hwc_dev) +{ + static int first_set = 1; + int ret; + + if (first_set) { + first_set = 0; + struct dsscomp_setup_dispc_data d = { + .num_mgrs = 1, + }; + /* remove bootloader image from the screen as blank/unblank does not change the composition */ + ret = ioctl(hwc_dev->dsscomp_fd, DSSCOMP_SETUP_DISPC, &d); + if (ret) + LOGW("failed to remove bootloader image"); + + /* blank and unblank fd to make sure display is properly programmed on boot. + * This is needed because the bootloader can not be trusted. + */ + ret = ioctl(hwc_dev->fb_fd, FBIOBLANK, FB_BLANK_POWERDOWN); + if (ret) + LOGW("failed to blank display"); + + ret = ioctl(hwc_dev->fb_fd, FBIOBLANK, FB_BLANK_UNBLANK); + if (ret) + LOGW("failed to blank display"); + } +} + static int omap4_hwc_set(struct hwc_composer_device *dev, hwc_display_t dpy, hwc_surface_t sur, hwc_layer_list_t* list) { @@ -1033,6 +1061,9 @@ static int omap4_hwc_set(struct hwc_composer_device *dev, hwc_display_t dpy, unsigned int i; pthread_mutex_lock(&hwc_dev->lock); + + omap4_hwc_reset_screen(hwc_dev); + char big_log[1024]; int e = sizeof(big_log); char *end = big_log + e; @@ -1385,17 +1416,6 @@ static int omap4_hwc_device_open(const hw_module_t* module, const char* name, goto done; } - /* blank and unblnk fd to make sure display is proppery programmed on boot - * this is needed because the bootloader can not be trusted - */ - ret = ioctl(hwc_dev->fb_fd, FBIOBLANK, FB_BLANK_POWERDOWN); - if (ret) - LOGW("failed to blank disolay"); - - ret = ioctl(hwc_dev->fb_fd, FBIOBLANK, FB_BLANK_UNBLANK); - if (ret) - LOGW("failed to blank disolay"); - /* get debug properties */ /* see if hwc is enabled at all */ |