Skip to content

Commit 83edd73

Browse files
DarrenEtheridgetomba
authored andcommitted
video: da8xx-fb: fixing timing off by one errors
The LCD controller represents some of the timing fields with a 0 in the register representing 1. This was not taken into account when these registers were being set. Interestingly enough not all of the LCDC controller timing registers implement this representation so carefully went through the technical reference manual to only "fix" the correct timings. Signed-off-by: Darren Etheridge <detheridge@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
1 parent a592d9f commit 83edd73

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/video/da8xx-fb.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,9 @@ static void lcd_cfg_horizontal_sync(int back_porch, int pulse_width,
407407
u32 reg;
408408

409409
reg = lcdc_read(LCD_RASTER_TIMING_0_REG) & 0xf;
410-
reg |= ((back_porch & 0xff) << 24)
411-
| ((front_porch & 0xff) << 16)
412-
| ((pulse_width & 0x3f) << 10);
410+
reg |= (((back_porch-1) & 0xff) << 24)
411+
| (((front_porch-1) & 0xff) << 16)
412+
| (((pulse_width-1) & 0x3f) << 10);
413413
lcdc_write(reg, LCD_RASTER_TIMING_0_REG);
414414
}
415415

@@ -421,7 +421,7 @@ static void lcd_cfg_vertical_sync(int back_porch, int pulse_width,
421421
reg = lcdc_read(LCD_RASTER_TIMING_1_REG) & 0x3ff;
422422
reg |= ((back_porch & 0xff) << 24)
423423
| ((front_porch & 0xff) << 16)
424-
| ((pulse_width & 0x3f) << 10);
424+
| (((pulse_width-1) & 0x3f) << 10);
425425
lcdc_write(reg, LCD_RASTER_TIMING_1_REG);
426426
}
427427

0 commit comments

Comments
 (0)