Commit c61bd6a0 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] v4l2-common: add CVT and GTF detection functions

These two helper functions detect whether the analog video timings detected
by the video receiver match the VESA CVT or GTF standards.

They basically do the inverse of the CVT and GTF modeline calculations.

This patch also adds a helper function that will determine the aspect ratio
based on the provided EDID values. This aspect ratio can be given to the GTF
helper function.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c2a667fa
This diff is collapsed.
...@@ -216,4 +216,13 @@ bool v4l_match_dv_timings(const struct v4l2_dv_timings *t1, ...@@ -216,4 +216,13 @@ bool v4l_match_dv_timings(const struct v4l2_dv_timings *t1,
const struct v4l2_dv_timings *t2, const struct v4l2_dv_timings *t2,
unsigned pclock_delta); unsigned pclock_delta);
bool v4l2_detect_cvt(unsigned frame_height, unsigned hfreq, unsigned vsync,
u32 polarities, struct v4l2_dv_timings *fmt);
bool v4l2_detect_gtf(unsigned frame_height, unsigned hfreq, unsigned vsync,
u32 polarities, struct v4l2_fract aspect,
struct v4l2_dv_timings *fmt);
struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait);
#endif /* V4L2_COMMON_H_ */ #endif /* V4L2_COMMON_H_ */
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