diff options
author | Martin Bugge <[email protected]> | 2014-01-23 06:40:00 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <[email protected]> | 2014-02-04 06:45:47 -0200 |
commit | 257cc4b5c57060a65e9c805fb1c225688ebbca80 (patch) | |
tree | 524f3a8eb48bd3cac14290c83141b1f4efebc445 | |
parent | 1ba6c90161ac058f580e6ceb5ccc14dcd86365d1 (diff) |
[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 <[email protected]>
Signed-off-by: Martin Bugge <[email protected]>
Reviewed-by: Hans Verkuil <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r-- | drivers/media/v4l2-core/v4l2-dv-timings.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c index ee52b9f4a944..f7902fe8a526 100644 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c @@ -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) |