From: Huang Jiachai Date: Wed, 11 Nov 2015 10:22:36 +0000 (+0800) Subject: video: rockchip: lcdc: 3368: fix interlace mode update lead to logical error X-Git-Tag: firefly_0821_release~3540 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=421ee14ff7496a972291b0a65f24258604860e17;p=firefly-linux-kernel-4.4.55.git video: rockchip: lcdc: 3368: fix interlace mode update lead to logical error Change-Id: I01df39134171a24b4478d7e8b9a6447f2befde8a Fixes: 05d226be7eb7 ("video: lcdc: judge interlace mode from vmode bit mask") Signed-off-by: Huang Jiachai --- diff --git a/drivers/video/rockchip/lcdc/rk3368_lcdc.c b/drivers/video/rockchip/lcdc/rk3368_lcdc.c index 43cfdcaa4106..a2259e525934 100644 --- a/drivers/video/rockchip/lcdc/rk3368_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3368_lcdc.c @@ -2893,7 +2893,7 @@ static int dsp_y_pos(int mirror_en, struct rk_screen *screen, if (screen->y_mirror && mirror_en) pr_err("not support both win and global mirror\n"); - if (screen->mode.vmode & FB_VMODE_NONINTERLACED) { + if (!(screen->mode.vmode & FB_VMODE_INTERLACED)) { if ((!mirror_en) && (!screen->y_mirror)) pos = area->ypos + screen->mode.upper_margin + screen->mode.vsync_len; @@ -2901,7 +2901,7 @@ static int dsp_y_pos(int mirror_en, struct rk_screen *screen, pos = screen->mode.yres - area->ypos - area->ysize + screen->mode.upper_margin + screen->mode.vsync_len; - } else if (screen->mode.vmode & FB_VMODE_INTERLACED) { + } else { pos = area->ypos / 2 + screen->mode.upper_margin + screen->mode.vsync_len; area->ysize /= 2; @@ -3099,7 +3099,7 @@ static int win_2_3_set_par(struct lcdc_device *lcdc_dev, &win->area[i]); if (((win->area[i].xact != win->area[i].xsize) || (win->area[i].yact != win->area[i].ysize)) && - (screen->mode.vmode & FB_VMODE_NONINTERLACED)) { + !(screen->mode.vmode & FB_VMODE_INTERLACED)) { pr_err("win[%d]->area[%d],not support scale\n", win->id, i); pr_err("xact=%d,yact=%d,xsize=%d,ysize=%d\n", @@ -4788,7 +4788,7 @@ static irqreturn_t rk3368_lcdc_isr(int irq, void *dev_id) } lcdc_dev->driver.vsync_info.timestamp = timestamp; wake_up_interruptible_all(&lcdc_dev->driver.vsync_info.wait); - if ((screen->mode.vmode & FB_VMODE_NONINTERLACED) || + if (!(screen->mode.vmode & FB_VMODE_INTERLACED) || (line_scane_num >= dsp_vs_st_f1)) { lcdc_dev->driver.vsync_info.timestamp = timestamp; wake_up_interruptible_all(