From: Huang Jiachai Date: Fri, 11 Dec 2015 11:36:22 +0000 (+0800) Subject: video: rockchip: correct init extern screen before hdmi insert X-Git-Tag: firefly_0821_release~3543 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=80a46632d307c3c779e3aafa1f7c6244d4640451;p=firefly-linux-kernel-4.4.55.git video: rockchip: correct init extern screen before hdmi insert If we direct to use primary screen to init extern screen, the dsp_lut is not NULL, this will lead to enable gamma lut. Change-Id: I0934d57927b4b031a4484630120e3be0cfb14969 Signed-off-by: Huang Jiachai --- diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 69e6e852308a..9abdd9d6016f 100644 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -3944,7 +3944,7 @@ static int init_lcdc_device_driver(struct rk_fb *rk_fb, } dev_drv->trsm_ops = rk_fb_trsm_ops_get(screen->type); if (dev_drv->prop != PRMRY) - rk_fb_get_prmry_screen(screen); + rk_fb_get_extern_screen(screen); dev_drv->output_color = screen->color_mode; return 0; diff --git a/drivers/video/rockchip/screen/rk_screen.c b/drivers/video/rockchip/screen/rk_screen.c index d88b077d8154..b82a8e7218c3 100644 --- a/drivers/video/rockchip/screen/rk_screen.c +++ b/drivers/video/rockchip/screen/rk_screen.c @@ -5,6 +5,19 @@ #include "../hdmi/rockchip-hdmi.h" static struct rk_screen *rk_screen; + +int rk_fb_get_extern_screen(struct rk_screen *screen) +{ + if (unlikely(!rk_screen) || unlikely(!screen)) + return -1; + + memcpy(screen, rk_screen, sizeof(struct rk_screen)); + screen->dsp_lut = NULL; + screen->cabc_lut = NULL; + + return 0; +} + int rk_fb_get_prmry_screen(struct rk_screen *screen) { if (unlikely(!rk_screen) || unlikely(!screen)) diff --git a/include/linux/rk_fb.h b/include/linux/rk_fb.h index 0ad5319b80cb..42ee6d35e0e5 100755 --- a/include/linux/rk_fb.h +++ b/include/linux/rk_fb.h @@ -726,6 +726,7 @@ extern int rk_fb_register(struct rk_lcdc_driver *dev_drv, struct rk_lcdc_win *win, int id); extern int rk_fb_unregister(struct rk_lcdc_driver *dev_drv); extern struct rk_lcdc_driver *rk_get_lcdc_drv(char *name); +extern int rk_fb_get_extern_screen(struct rk_screen *screen); extern int rk_fb_get_prmry_screen( struct rk_screen *screen); extern int rk_fb_set_prmry_screen(struct rk_screen *screen); extern u32 rk_fb_get_prmry_screen_pixclock(void);