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)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 25 Oct 2022 15:40:07 +0000 (16:40 +0100)
If it is a progressive (non-interlaced) format, then ignore the
interlaced timing values.

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

index 86cae23cc44696fcdc2db1f22d9619701eb855df..29da1f4b4578e0a24bbdaf474bb39936cd67fae5 100644 (file)
@@ -1601,7 +1601,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))