From 1c0c2c38a35454be863a344fdf28ed052332f78c Mon Sep 17 00:00:00 2001 From: Zheng Yang Date: Sat, 12 Jul 2014 15:03:35 +0800 Subject: [PATCH] rk3036: fb: load_screen is called once in function rk_fb_switch_screen(). tve: fix 7.5 IRE configure error for NTSC and PAL. --- drivers/video/rockchip/lcdc/rk3036_lcdc.c | 4 ++-- drivers/video/rockchip/rk_fb.c | 5 +++-- .../video/rockchip/tve/rk3036/rk3036_tve.c | 22 +++++++++---------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/video/rockchip/lcdc/rk3036_lcdc.c b/drivers/video/rockchip/lcdc/rk3036_lcdc.c index 2562ac175699..b67ceaecd36b 100644 --- a/drivers/video/rockchip/lcdc/rk3036_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3036_lcdc.c @@ -1168,14 +1168,14 @@ static int rk3036_lcdc_reg_dump(struct rk_lcdc_driver *dev_drv) int i, j; printk("back up reg:\n"); - for (i = 0; i <= (0x90 >> 4); i++) { + for (i = 0; i <= (0xDC >> 4); i++) { for (j = 0; j < 4; j++) printk("%08x ", *(regsbak + i * 4 + j)); printk("\n"); } printk("lcdc reg:\n"); - for (i = 0; i <= (0x90 >> 4); i++) { + for (i = 0; i <= (0xDC >> 4); i++) { for (j = 0; j < 4; j++) printk("%08x ", readl_relaxed(cbase + i * 4 + j)); printk("\n"); diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 3cacdd847a41..b462d3a49fa2 100755 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -2917,7 +2917,7 @@ int rk_fb_switch_screen(struct rk_screen *screen, int enable, int lcdc_id) struct fb_info *info = NULL; struct rk_lcdc_driver *dev_drv = NULL; char name[6]; - int i, win_id; + int i, win_id, load_screen = 0; if(screen == NULL) return -ENODEV; @@ -2991,8 +2991,9 @@ int rk_fb_switch_screen(struct rk_screen *screen, int enable, int lcdc_id) printk("%s win id %d state %d\n", info->fix.id, win_id, dev_drv->win[win_id]->logicalstate); if( dev_drv->win[win_id]->logicalstate ) { dev_drv->ops->open(dev_drv, win_id, 1); - if(win_id == 1) { + if(!load_screen) { dev_drv->ops->load_screen(dev_drv, 1); + load_screen = 1; } info->var.activate |= FB_ACTIVATE_FORCE; info->fbops->fb_set_par(info); diff --git a/drivers/video/rockchip/tve/rk3036/rk3036_tve.c b/drivers/video/rockchip/tve/rk3036/rk3036_tve.c index 6c3a1ea78f6e..537674fa8e9c 100644 --- a/drivers/video/rockchip/tve/rk3036/rk3036_tve.c +++ b/drivers/video/rockchip/tve/rk3036/rk3036_tve.c @@ -30,9 +30,9 @@ #endif static const struct fb_videomode rk3036_cvbs_mode [] = { - /* name refresh xres yres pixclock h_bp h_fp v_bp v_fp h_pw v_pw polariry PorI flag*/ - { "NTSC", 60, 720, 480, 27000000, 57, 19, 19, 0, 62, 3, 0, FB_VMODE_INTERLACED, 0}, - { "PAL", 50, 720, 576, 27000000, 69, 12, 19, 2, 63, 3, 0, FB_VMODE_INTERLACED, 0}, + /*name refresh xres yres pixclock h_bp h_fp v_bp v_fp h_pw v_pw polariry PorI flag*/ + {"NTSC",60, 720, 480, 27000000, 57, 19, 19, 0, 62, 3, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_INTERLACED, 0}, + {"PAL", 50, 720, 576, 27000000, 69, 12, 19, 2, 63, 3, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_INTERLACED, 0}, }; static struct rk3036_tve *rk3036_tve = NULL; @@ -72,7 +72,7 @@ static void tve_set_mode (int mode) tve_writel(TV_LUMA_FILTER2, 0xF332d919); if(mode == TVOUT_CVBS_NTSC) { - tve_writel(TV_ROUTING, v_DAC_SENSE_EN(0) | v_Y_IRE_7_5(0) | + tve_writel(TV_ROUTING, v_DAC_SENSE_EN(0) | v_Y_IRE_7_5(1) | v_Y_AGC_PULSE_ON(1) | v_Y_VIDEO_ON(1) | v_Y_SYNC_ON(1) | v_PIC_MODE(mode)); tve_writel(TV_BW_CTRL, v_CHROMA_BW(BP_FILTER_NTSC) | v_COLOR_DIFF_BW(COLOR_DIFF_FILTER_BW_1_3)); @@ -86,7 +86,7 @@ static void tve_set_mode (int mode) tve_writel(TV_ACT_TIMING, 0x169800FC); } else if (mode == TVOUT_CVBS_PAL) { - tve_writel(TV_ROUTING, v_DAC_SENSE_EN(0) | v_Y_IRE_7_5(1) | + tve_writel(TV_ROUTING, v_DAC_SENSE_EN(0) | v_Y_IRE_7_5(0) | v_Y_AGC_PULSE_ON(1) | v_Y_VIDEO_ON(1) | v_Y_SYNC_ON(1) | v_CVBS_MODE(mode)); tve_writel(TV_BW_CTRL, v_CHROMA_BW(BP_FILTER_PAL) | v_COLOR_DIFF_BW(COLOR_DIFF_FILTER_BW_1_3)); @@ -119,14 +119,14 @@ static int tve_switch_fb(const struct fb_videomode *modedb, int enable) screen->mode = *modedb; /* Pin polarity */ -// if(FB_SYNC_HOR_HIGH_ACT & modedb->sync) + if(FB_SYNC_HOR_HIGH_ACT & modedb->sync) screen->pin_hsync = 1; -// else -// screen->pin_hsync = 0; -// if(FB_SYNC_VERT_HIGH_ACT & modedb->sync) + else + screen->pin_hsync = 0; + if(FB_SYNC_VERT_HIGH_ACT & modedb->sync) screen->pin_vsync = 1; -// else -// screen->pin_vsync = 0; + else + screen->pin_vsync = 0; screen->pin_den = 0; screen->pin_dclk = 0; -- 2.34.1