]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: videodev2.h: V4L2_DV_BT_BLANKING_HEIGHT should check 'interlaced'
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 12 Oct 2022 15:46:17 +0000 (16:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:56:56 +0000 (23:56 +0900)
[ Upstream commit 8fd3bbf345cd96f284266ba863b20844ebc628a6 ]

If it is a progressive (non-interlaced) format, then ignore the
interlaced timing values.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: c8ae9e737bfc ([media] videodev2.h: defines to calculate blanking and frame sizes)
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/uapi/linux/videodev2.h

index 3210b3c82a4a2637a562746d7f0f8709d90b298e..9c89429f31130a3a6a50f99c252706a04dd3d701 100644 (file)
@@ -1496,7 +1496,8 @@ struct v4l2_bt_timings {
        ((bt)->width + V4L2_DV_BT_BLANKING_WIDTH(bt))
 #define V4L2_DV_BT_BLANKING_HEIGHT(bt) \
        ((bt)->vfrontporch + (bt)->vsync + (bt)->vbackporch + \
-        (bt)->il_vfrontporch + (bt)->il_vsync + (bt)->il_vbackporch)
+        ((bt)->interlaced ? \
+         ((bt)->il_vfrontporch + (bt)->il_vsync + (bt)->il_vbackporch) : 0))
 #define V4L2_DV_BT_FRAME_HEIGHT(bt) \
        ((bt)->height + V4L2_DV_BT_BLANKING_HEIGHT(bt))