From: Huang Jiachai Date: Sat, 22 Apr 2017 03:18:08 +0000 (+0800) Subject: video: rockchip: fb: add fb ser par support 4k output X-Git-Tag: release-20171130_firefly~4^2~745 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=451d35846d19fbff5f68047b821f58591083cfc9;p=firefly-linux-kernel-4.4.55.git video: rockchip: fb: add fb ser par support 4k output Change-Id: Iad0a49b9b3f0f49c2bc71e8ed73fade1106b57ac Signed-off-by: Huang Jiachai --- diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 88a396c76b6c..b0b0878d44e6 100644 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -3283,6 +3283,8 @@ static int rk_fb_set_par(struct fb_info *info) if (var->grayscale >> 8) { xsize = (var->grayscale >> 8) & 0xfff; ysize = (var->grayscale >> 20) & 0xfff; + xsize |= (var->reserved[0] << 12); + var->reserved[0] = 0; if (xsize > screen->mode.xres) xsize = screen->mode.xres; if (ysize > screen->mode.yres) @@ -3674,8 +3676,9 @@ int rk_fb_switch_screen(struct rk_screen *screen, int enable, int lcdc_id) info = rk_fb->fb[dev_drv->fb_index_base]; info->var.grayscale &= 0xff; info->var.grayscale |= - (dev_drv->cur_screen->mode.xres << 8) + + ((dev_drv->cur_screen->mode.xres & 0xfff) << 8) + (dev_drv->cur_screen->mode.yres << 20); + info->var.reserved[0] |= (dev_drv->cur_screen->mode.xres >> 12); mutex_lock(&dev_drv->win_config); info->var.xoffset = 0; info->var.yoffset = 0; @@ -3749,8 +3752,9 @@ int rk_fb_switch_screen(struct rk_screen *screen, int enable, int lcdc_id) if (rk_fb->disp_mode == ONE_DUAL) { info->var.grayscale &= 0xff; info->var.grayscale |= - (dev_drv->cur_screen->xsize << 8) + + ((dev_drv->cur_screen->mode.xres & 0xfff) << 8) + (dev_drv->cur_screen->ysize << 20); + info->var.reserved[0] |= (dev_drv->cur_screen->mode.xres >> 12); } if (dev_drv->uboot_logo && win->state) { if (win->area[0].xpos || @@ -4281,7 +4285,8 @@ int rk_fb_register(struct rk_lcdc_driver *dev_drv, fbi->var.width = dev_drv->cur_screen->width; fbi->var.height = dev_drv->cur_screen->height; fbi->var.grayscale |= - (fbi->var.xres << 8) + (fbi->var.yres << 20); + ((fbi->var.xres & 0xfff) << 8) + (fbi->var.yres << 20); + fbi->var.reserved[0] |= (fbi->var.xres >> 12); #if defined(CONFIG_LOGO_LINUX_BMP) fbi->var.bits_per_pixel = 32; #else