Commit 257cc4b5 authored by Martin Bugge's avatar Martin Bugge Committed by Mauro Carvalho Chehab

[media] v4l2-dv-timings: fix GTF calculation

Round off image width to nearest 8 (GTF_CELL_GRAN)

A source sending a GTF (Generalized Timing Formula) format have no means of
signalling image width. The assumed aspect ratio may result in an odd image
width but according to the standard image width should be in multiple of 8.

Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: default avatarMartin Bugge <marbugge@cisco.com>
Reviewed-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 1ba6c901
...@@ -515,6 +515,7 @@ bool v4l2_detect_gtf(unsigned frame_height, ...@@ -515,6 +515,7 @@ bool v4l2_detect_gtf(unsigned frame_height,
aspect.denominator = 9; aspect.denominator = 9;
} }
image_width = ((image_height * aspect.numerator) / aspect.denominator); image_width = ((image_height * aspect.numerator) / aspect.denominator);
image_width = (image_width + GTF_CELL_GRAN/2) & ~(GTF_CELL_GRAN - 1);
/* Horizontal */ /* Horizontal */
if (default_gtf) if (default_gtf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment