From 3758e9ae0777ebd898e3ce97127a6e18ffe7db63 Mon Sep 17 00:00:00 2001 From: Huang Jiachai Date: Thu, 1 Dec 2016 14:35:43 +0800 Subject: [PATCH] video: rockchip: fb: update mirror for vr Change-Id: Ibdd0e60991490115428ed04027cbaef717951d3b Signed-off-by: Huang Jiachai --- drivers/video/rockchip/rk_fb.c | 6 ++++-- drivers/video/rockchip/rkfb_sysfs.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index e61fb7fedb1b..25563a453128 100644 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -3719,8 +3719,10 @@ int rk_fb_switch_screen(struct rk_screen *screen, int enable, int lcdc_id) memcpy(dev_drv->cur_screen, screen, sizeof(struct rk_screen)); dev_drv->cur_screen->xsize = dev_drv->cur_screen->mode.xres; dev_drv->cur_screen->ysize = dev_drv->cur_screen->mode.yres; - dev_drv->cur_screen->x_mirror = dev_drv->rotate_mode & X_MIRROR; - dev_drv->cur_screen->y_mirror = dev_drv->rotate_mode & Y_MIRROR; + dev_drv->cur_screen->x_mirror = + !!(dev_drv->rotate_mode & X_MIRROR); + dev_drv->cur_screen->y_mirror = + !!(dev_drv->rotate_mode & Y_MIRROR); } if (!dev_drv->uboot_logo || load_screen || diff --git a/drivers/video/rockchip/rkfb_sysfs.c b/drivers/video/rockchip/rkfb_sysfs.c index b5ad8520512e..de8acc5d2df3 100644 --- a/drivers/video/rockchip/rkfb_sysfs.c +++ b/drivers/video/rockchip/rkfb_sysfs.c @@ -126,6 +126,7 @@ static ssize_t set_screen_info(struct device *dev, ymirror = !!(rotate & Y_MIRROR); dev_drv->cur_screen->x_mirror = xmirror; dev_drv->cur_screen->y_mirror = ymirror; + dev_drv->rotate_mode = rotate; mutex_lock(&dev_drv->output_lock); mutex_lock(&dev_drv->win_config); if (dev_drv->ops->extern_func) -- 2.34.1