v4l2-dv-timings: fix GTF calculation
PATCH 1/1 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 <[email protected]>
Cc Hans Verkuil <[email protected]>
Signed-off-by Martin Bugge <[email protected]>
--- drivers/media/v4l2-core/v4l2-dv-timings.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/v4l2-core/v4l2-dv-timings.c +1 -0
@@ -515,6 +515,7 @@ bool v4l2_detect_gtf(unsigned frame_height, aspect.denominator =9 ; } image_width = ((image_height * aspect.numerator) / aspect.denominator); + image_width = (image_width +GTF_CELL_GRAN /2 ) & ~(GTF_CELL_GRAN -1 );/* Horizontal */ if (default_gtf)
Signature · 1 line
1.8.1.4
Reviewed-by Hans Verkuil <[email protected]>
Regards,
Hans
Quoted 26 lines · Martin Bugge
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 <[email protected]>Cc Hans Verkuil <[email protected]>Signed-off-by Martin Bugge <[email protected]>--- drivers/media/v4l2-core/v4l2-dv-timings.c | 1 + 1 file changed, 1 insertion(+)drivers/media/v4l2-core/v4l2-dv-timings.c +1
-0@@ -515,6 +515,7 @@ bool v4l2_detect_gtf(unsigned frame_height, aspect.denominator =9 ; } image_width = ((image_height * aspect.numerator) / aspect.denominator); + image_width = (image_width +GTF_CELL_GRAN /2 ) & ~(GTF_CELL_GRAN -1 );/* Horizontal */ if (default_gtf)