Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: fix CVT vertical front and back porch values

CVT v1.1 spec says: "the vertical front porch shall in all cases be
fixed to 3 lines". The code in fbcvt.c instead sets the _back_ porch to
3 (plus margin).

After swapping cvt.v_front_porch and cvt.v_back_porch the resulting
timings were in line with CVT timings in VESA DMT spec.

The bug seems to be more than 9 years old, but I presume it has not been
noticed as usually the video timings come from the EDID or from the
timing tables in fbdev, and probably swapped values for vfp and vbp work
fine for most of the displays.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: David Ung <davidu@nvidia.com>
Cc: Antonino A. Daplas <adaplas@gmail.com>

+3 -3
+3 -3
drivers/video/fbdev/core/fbcvt.c
··· 369 369 cvt.h_back_porch = cvt.hblank/2 + cvt.h_margin; 370 370 cvt.h_front_porch = cvt.hblank - cvt.hsync - cvt.h_back_porch + 371 371 2 * cvt.h_margin; 372 - cvt.v_back_porch = 3 + cvt.v_margin; 373 - cvt.v_front_porch = cvt.vtotal - cvt.yres/cvt.interlace - 374 - cvt.v_back_porch - cvt.vsync; 372 + cvt.v_front_porch = 3 + cvt.v_margin; 373 + cvt.v_back_porch = cvt.vtotal - cvt.yres/cvt.interlace - 374 + cvt.v_front_porch - cvt.vsync; 375 375 fb_cvt_print_name(&cvt); 376 376 fb_cvt_convert_to_mode(&cvt, mode); 377 377