video: rockchip: correct init extern screen before hdmi insert
authorHuang Jiachai <hjc@rock-chips.com>
Fri, 11 Dec 2015 11:36:22 +0000 (19:36 +0800)
committerHuang Jiachai <hjc@rock-chips.com>
Thu, 17 Dec 2015 07:21:13 +0000 (15:21 +0800)
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 <hjc@rock-chips.com>
drivers/video/rockchip/rk_fb.c
drivers/video/rockchip/screen/rk_screen.c
include/linux/rk_fb.h

index 69e6e852308a06f686c3345e90e9b19aeb9feb3b..9abdd9d6016f093f87b1b9d4cd8523e3c19ef7c2 100644 (file)
@@ -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;
index d88b077d8154d1f95fc9c37c37b3ee4024f18cff..b82a8e7218c34724924d7069859d40e09fdefe0e 100644 (file)
@@ -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))
index 0ad5319b80cb6a848bcc52b2f726f13055b008cd..42ee6d35e0e5057b27252a814a5ff88ddd2b7048 100755 (executable)
@@ -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);