History log of /linux-master/drivers/media/v4l2-core/v4l2-dv-timings.c
Revision Date Author Comments
# 5eef2141 16-Nov-2022 Hans Verkuil <hverkuil-cisco@xs4all.nl>

media: v4l2-dv-timings.c: fix too strict blanking sanity checks

Sanity checks were added to verify the v4l2_bt_timings blanking fields
in order to avoid integer overflows when userspace passes weird values.

But that assumed that userspace would correctly fill in the front porch,
backporch and sync values, but sometimes all you know is the total
blanking, which is then assigned to just one of these fields.

And that can fail with these checks.

So instead set a maximum for the total horizontal and vertical
blanking and check that each field remains below that.

That is still sufficient to avoid integer overflows, but it also
allows for more flexibility in how userspace fills in these fields.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: 4b6d66a45ed3 ("media: v4l2-dv-timings: add sanity checks for blanking values")
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# 4b6d66a4 13-Oct-2022 Hans Verkuil <hverkuil-cisco@xs4all.nl>

media: v4l2-dv-timings: add sanity checks for blanking values

Add sanity checks to v4l2_valid_dv_timings() to ensure that the provided
blanking values are reasonable.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: b18787ed1ce3 ([media] v4l2-dv-timings: add new helper module)
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# 4108b3e6 23-Jul-2021 Hans Verkuil <hverkuil-cisco@xs4all.nl>

media: v4l2-dv-timings.c: fix wrong condition in two for-loops

These for-loops should test against v4l2_dv_timings_presets[i].bt.width,
not if i < v4l2_dv_timings_presets[i].bt.width. Luckily nothing ever broke,
since the smallest width is still a lot higher than the total number of
presets, but it is wrong.

The last item in the presets array is all 0, so the for-loop must stop
when it reaches that sentinel.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: Krzysztof HaƂasa <khalasa@piap.pl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# d9739338 09-Oct-2019 zhong jiang <zhongjiang@huawei.com>

media: v4l2-dv-timings: Use DIV_ROUND_CLOSEST directly to make it readable

The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d
but is perhaps more readable.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# 1adbb827 09-Sep-2019 Hans Verkuil <hverkuil-cisco@xs4all.nl>

media: v4l2-dv-timings.c: fix format string

It should be "%u.%02u" instead of "%u.%u".

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: Bard Winther <bwinther@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 463659a0 13-Sep-2018 Hans Verkuil <hansverk@cisco.com>

media: hdmi.h: rename ADOBE_RGB to OPRGB and ADOBE_YCC to OPYCC

These names have been renamed in the CTA-861 standard due to trademark
issues. Replace them here as well so they are in sync with the standard.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Cc: stable@vger.kernel.org
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# db034018 14-Sep-2018 Hans Verkuil <hverkuil@xs4all.nl>

media: replace ADOBERGB by OPRGB

The CTA-861 standards have been updated to refer to opRGB instead
of AdobeRGB. The official standard is in fact named opRGB, so
switch to that.

The two old defines referring to ADOBERGB in the public API are
put under #ifndef __KERNEL__ and a comment mentions that they are
deprecated.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 9cfd2753 13-Sep-2018 Hans Verkuil <hans.verkuil@cisco.com>

media: cec/v4l2: move V4L2 specific CEC functions to V4L2

Several CEC functions are actually specific for use with receivers,
i.e. they should be part of the V4L2 subsystem, not CEC.

These functions deal with validating and modifying EDIDs for (HDMI)
receivers, and they do not actually have anything to do with the CEC
subsystem and whether or not CEC is enabled. The problem was that if
the CEC_CORE config option was not set, then these functions would
become stubs, but that's not right: they should always be valid.

So replace the cec_ prefix by v4l2_ and move them to v4l2-dv-timings.c.
Update all drivers that call these accordingly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: <stable@vger.kernel.org> # for v4.17 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 87f9ed85 21-Mar-2017 Jose Abreu <Jose.Abreu@synopsys.com>

media: v4l2-dv-timings: Introduce v4l2_calc_timeperframe helper

A new helper function was introduced to facilitate the calculation
of time per frame value whenever we have access to the full
v4l2_dv_timings structure.

This should be used only for receivers and only when there is
enough accuracy in the measured pixel clock value as well as in
the horizontal/vertical values.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 357a856a 14-Feb-2018 Hans Verkuil <hverkuil@xs4all.nl>

media: v4l2-dv-timings: add v4l2_hdmi_colorimetry()

Add the v4l2_hdmi_colorimetry() function so we have a single function
that determines the colorspace, YCbCr encoding, quantization range and
transfer function from the InfoFrame data.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# ddddfa78 07-Feb-2018 Hans Verkuil <hansverk@cisco.com>

media: add SPDX license info

Replace the old license information with the corresponding SPDX
license for the remaining media drivers that Cisco authored.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 4a3fad70 04-Jan-2018 Mauro Carvalho Chehab <mchehab@kernel.org>

media: fix usage of whitespaces and on indentation

On several places, whitespaces are being used for indentation,
or even at the end of the line.

Fix them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# d28b2cf9 29-Nov-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

media: v4l2-core: Fix kernel-doc markups

There are some troubles on kernel-doc markups, as warned:

drivers/media/v4l2-core/v4l2-dv-timings.c:259: warning: No description found for parameter 't1'
drivers/media/v4l2-core/v4l2-dv-timings.c:259: warning: No description found for parameter 't2'
drivers/media/v4l2-core/v4l2-dv-timings.c:259: warning: No description found for parameter 'pclock_delta'
drivers/media/v4l2-core/v4l2-dv-timings.c:259: warning: No description found for parameter 'match_reduced_fps'
drivers/media/v4l2-core/tuner-core.c:242: warning: bad line: internal parameters, like LNA mode
drivers/media/v4l2-core/tuner-core.c:765: warning: No description found for parameter 'mode'
drivers/media/v4l2-core/videobuf2-memops.c:127: warning: cannot understand function prototype: 'const struct vm_operations_struct vb2_common_vm_ops = '
drivers/media/v4l2-core/v4l2-mem2mem.c:190: warning: No description found for parameter 'm2m_dev'
drivers/media/v4l2-core/v4l2-mem2mem.c:291: warning: No description found for parameter 'm2m_ctx'
drivers/media/v4l2-core/videobuf-core.c:233: warning: No description found for parameter 'q'

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 65243076 14-Jul-2016 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: add helpers for vic and pixelaspect ratio

Add a helper to find timings based on the CEA-861 VIC code. Also,
add a helper that returns the pixel aspect ratio based on the
v4l2_dv_timings struct.

[mchehab@s-opensource.com: fix coding style]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 7389e6ef 14-Sep-2016 Charles-Antoine Couret <charles-antoine.couret@nexvision.fr>

[media] SDI: add flag for SDI formats and SMPTE 125M definition

Adding others generic flags, which could be used by many
components like GS1662.

Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@nexvision.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 8e20b803 13-Jan-2016 Hans Verkuil <hverkuil@xs4all.nl>

[media] v4l2-dv-timings: skip standards check for V4L2_DV_BT_CAP_CUSTOM

Skip validating the standards field in v4l2_valid_dv_timings() if the
V4L2_DV_BT_CAP_CUSTOM capability is set, since that implies that
non-standard timings are allowed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 85f9e06c 13-Nov-2015 Hans Verkuil <hverkuil@xs4all.nl>

[media] v4l2-dv-timings: add new arg to v4l2_match_dv_timings

Add the new match_reduced_fps argument to v4l2_match_dv_timings().
Depending on the situation you may or may not desire to match the
reduced_fps flag. Typically only HDMI transmitters will need to
check for this flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 8d7322f4 22-Sep-2015 Prashant Laddha <prladdha@cisco.com>

[media] v4l2-dv-timings: add condition checks for reduced fps

Added a helper function to check necessary conditions required for
reduced fps. The reduced fps is supported for CVT and CEA861 timings.
CVT supports reduced fps only if reduced blanking v2 (indicated by
vsync = 8) is true. Whereas CEA861 supports reduced fps if
V4L2_DV_FL_CAN_REDUCE_FPS flag is true.

Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 74c9c0fe 12-Nov-2015 Mats Randgaard <matrandg@cisco.com>

[media] v4l2-dv-timings: Compare horizontal blanking

hsync and hbackporch must also be compared

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 227da85e 12-Jun-2015 Prashant Laddha <prladdha@cisco.com>

[media] v4l2-dv-timings: print refresh rate with better precision

In many cases, refresh rate is not exact integer. In such cases,
fraction was lost and it used to print, say, 59 in case of 59.94.
Now, capturing the fraction up to 2 decimal places.

Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 1b3b3841 12-Jun-2015 Hans Verkuil <hverkuil@xs4all.nl>

[media] v4l2-dv-timings: log if the timing is reduced blanking V2

The last CVT standard introduced reduced blanking version 2 which is signaled by
a vsync of 8. Log this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 5fea1bb7 10-Jun-2015 Prashant Laddha <prladdha@cisco.com>

[media] v4l2-dv-timings: add support for reduced blanking v2

Added support for reduced blanking version 2 (RB v2) in cvt timings.
Standard specifies a fixed vsync pulse of 8 lines to indicate RB v2
timings. Vertical back porch is fixed at 6 lines and vertical front
porch is remainder of vertical blanking time.

For RB v2, horizontal blanking is fixed at 80 pixels. Horizontal sync
is fixed at 32. All horizontal timing counts (active pixels, front,
back porches) can be specified upto a precision of 1.

RB v2 allows for non standard aspect ratios. In RB v2 vsync does not
indicate aspect ratio. In absence of aspect ratio v4l2_detect_cvt()
cannot calculate image width from image height. Hence extending the
v4l2_detect_cvt() to pass image width in case of RB v2.

Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# fd752429 10-Jun-2015 Fabian Frederick <fabf@skynet.be>

[media] v4l2-dv-timings: use swap() in v4l2_calc_aspect_ratio()

Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 061ddda6 21-May-2015 Prashant Laddha <prladdha@cisco.com>

[media] v4l2-dv-timings: add interlace support in detect cvt/gtf

Extend detect_cvt/gtf API to indicate the format type (interlaced
or progressive). In case of interlaced, the vertical front and back
porch and vsync values for both (odd,even) fields are considered to
derive image height. Populated vsync, vertical front, back porch
values in bt timing structure for even and odd fields and updated
the flags appropriately.

Also modified the functions calling the detect_cvt/gtf(). As of now
these functions are calling detect_cvt/gtf() with interlaced flag
set to false.

Cc: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 8cf6874e 05-Jun-2015 Hans Verkuil <hverkuil@xs4all.nl>

[media] v4l2-dv-timings: support interlaced in v4l2_print_dv_timings

The v4l2_print_dv_timings() didn't log the interlaced format correctly. The timings
for the bottom field weren't logged and the fields per second value was half of what
it should have been.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# dc0cf4cf 05-Jun-2015 Prashant Laddha <prladdha@cisco.com>

[media] v4l2-dv-timing: avoid rounding twice in gtf hblank calc

Currently, in gtf hblank calculations, the rounding is used twice,
one at intermediate division and one at final state where hblank
is rounded to nearest multiple of twice cell granularity. This
error got introduced in 'commit d7ed5a3ddaec ("[media]
v4l2-dv-timings: fix rounding in hblank and hsync calculation"),
where it missed combining the rounding step. Correcting the same
in this patch.

Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# c9bc9f50 05-May-2015 Prashant Laddha <prladdha@cisco.com>

[media] v4l2-dv-timings: fix overflow in gtf timings calculation

The intermediate calculation in the expression for hblank can exceed
32 bit signed range. This overflow can lead to negative values for
hblank. Typecasting intermediate variable to higher precision.

Cc: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
[hans.verkuil@cisco.com: made the denominator u32, since that's what div_u64 expects]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 9c3f2052 22-Apr-2015 Prashant Laddha <prladdha@cisco.com>

[media] v4l2-dv-timings: replace hsync magic number with a macro

This change will not change timing calculation. In CVT generator
spreadsheet the nominal value of hsync (as a percentage of line)
is 8 percent.

Cc: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 947ed99e 22-Apr-2015 Prashant Laddha <prladdha@cisco.com>

[media] v4l2-dv-timings: add sanity checks in cvt,gtf calculations

Wrong values of hfreq and image height can lead to strange timings.
Avoid timing calculations for such values.

Suggested By: Martin Bugge <marbugge@cisco.com>

Cc: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# d7ed5a3d 22-Apr-2015 Prashant Laddha <prladdha@cisco.com>

[media] v4l2-dv-timings: fix rounding in hblank and hsync calculation

Changed the rounding calculation for hblank and hsync to match it
to equations in cvt and gtf standards.

In cvt calculation, hsync needs to be rounded down.

In gtf calculations, hblank needs to be rounded to nearest multiple
of twice the cell granularity and hsync needs to be rounded to the
nearest multiple of cell granularity.

Cc: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# f6747658 22-Apr-2015 Prashant Laddha <prladdha@cisco.com>

[media] v4l2-dv-timings: fix rounding error in vsync_bp calculation

Changed the rounding offsets used in vsync_bp calculation in cvt and
gtf timings. The results for vsync_bp should now match with results
from timing generator spreadsheets for cvt and gtf standards.

In the vsync_bp calculation for cvt, always round down the value of
(CVT_MIN_VSYNC_BP / h_period_est) and then add 1. It thus, reflects
the equation used in timing generator spreadsheet. Using 1999999 as
rounding offset, could pontentially lead to bumping up the vsync_bp
value by extra 1.

In the vsync_bp calculations for gtf, instead of round up or round
down, round the (CVT_MIN_VSYNC_BP / h_period_est) to the nearest
integer.

Thanks to Martin Bugge <marbugge@cisco.com> for validating with
standards and suggestions on equations.

Cc: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 74d802d8 03-Apr-2015 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: log new V4L2_DV_FL_IS_CE_VIDEO flag

Add support for the new flag to v4l2_print_dv_timings().

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# c166845c 20-Sep-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: only check standards if non-zero

If one or both of the timings being compared have the standards field
with value 0, then accept that. Only check for matching standards if
both timings have actually filled in that field.

Otherwise no match will ever be found since when timings are detected
the standards field will typically be set to 0 by the driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# f71920ef 14-Jun-2014 Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>

[media] media: v4l2-core: v4l2-dv-timings.c: Cleaning up code wrong value used in aspect ratio

Wrong value used in same cases for the aspect ratio.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: stable@vger.kernel.org # for v3.12 and up
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# bc96f30c 08-Apr-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings.c: add the new 4K timings to the list

Add the new CEA-861-F and DMT 4K timings to the list of predefined
timings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# c4885ada 04-Mar-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: add module name, description, license

I completely forgot to add them when I made this module. Loading this module
without it will taint the kernel, which is not intended.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org # for v3.12 and up
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 3be55e04 31-Jan-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: mention missing 'reduced blanking V2'

The VESA standard added a version 2 of the reduced blanking formula.
Note in the comment that this is not yet supported by the v4l2_detect_cvt
function. Obviously this should be implemented eventually, but for now add
this as a reminder.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 257cc4b5 23-Jan-2014 Martin Bugge <marbugge@cisco.com>

[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: Martin Bugge <marbugge@cisco.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# b8f0fff4 19-Aug-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: add callback to handle exceptions

In most cases the v4l2_bt_timings_cap struct has all the information
necessary to determine valid timings, but occasionally there are exceptions.
Add a callback function to be able to test for those exceptions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 70b65494 19-Aug-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: rename v4l2_dv_valid_timings to v4l2_valid_dv_timings

All other functions follow the v4l2_<foo>_dv_timings pattern, do the same for
this function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# d1c65ad6 19-Aug-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: export the timings list

Some drivers need to be able to access the full list of timings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 074ca43f 19-Aug-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: fill in type field

The detect_cvt/gtf functions didn't fill in the type field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# ef1ed8f5 15-Aug-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: rename v4l_match_dv_timings to v4l2_match_dv_timings

It's the only function in v4l2-dv-timings.c with the v4l prefix instead
of v4l2. Make it consistent with the other functions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 0216dc2f 15-Aug-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: add v4l2_print_dv_timings helper

Drivers often have to log the contents of a dv_timings struct. Adding
this helper will make it easier for drivers to do so.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# c3e75c7d 14-Aug-2013 Martin Bugge <marbugge@cisco.com>

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

This patch fixes two errors that caused incorrect format detections:
The first bug is in the calculation of the vertical backporch: the combined
period of vsync and backporch must *exceed* a certain minimum value, and not
be equal to it.
The second bug is a rounding error in the reduced blanking calculation:
expand the ideal_duty_cylce to be in parts per ten thousand to avoid
rounding errors.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 25764158 29-Jul-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2: move dv-timings related code to v4l2-dv-timings.c

v4l2-common.c contained a bunch of dv-timings related functions.
Move that to the new v4l2-dv-timings.c which is a more appropriate
place for them.
There aren't many drivers that do HDTV, so it is a good idea to separate
common code related to that into a module of its own.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# b18787ed 29-Jul-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2-dv-timings: add new helper module

This module makes it easy to filter valid timings from the full list of
CEA and DMT timings based on the timings capabilities.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>