summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-07-29 11:40:58 (GMT)
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-08-18 11:17:35 (GMT)
commit7f68127fa11f08c5468537eb28ca6b8b95d70f08 (patch)
tree19d50978149ec14f3c52b7aa5fbc45abb940a4e5
parent5d2db817df059aa1873560ea4d6f13624cbc823d (diff)
downloadlinux-7f68127fa11f08c5468537eb28ca6b8b95d70f08.tar.xz
[media] videodev2.h: defines to calculate blanking and frame sizes
It is very common to have to calculate the total width and height of the blanking and the full frame, so add a few defines that deal with that. 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>
-rw-r--r--include/uapi/linux/videodev2.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index fec0c20..437f1b0 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -1057,6 +1057,16 @@ struct v4l2_bt_timings {
or used depends on the hardware. */
#define V4L2_DV_FL_HALF_LINE (1 << 3)
+/* A few useful defines to calculate the total blanking and frame sizes */
+#define V4L2_DV_BT_BLANKING_WIDTH(bt) \
+ (bt->hfrontporch + bt->hsync + bt->hbackporch)
+#define V4L2_DV_BT_FRAME_WIDTH(bt) \
+ (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)
+#define V4L2_DV_BT_FRAME_HEIGHT(bt) \
+ (bt->height + V4L2_DV_BT_BLANKING_HEIGHT(bt))
/** struct v4l2_dv_timings - DV timings
* @type: the type of the timings