[media] SDI: add flag for SDI formats and SMPTE 125M definition
authorCharles-Antoine Couret <charles-antoine.couret@nexvision.fr>
Thu, 15 Sep 2016 15:29:50 +0000 (12:29 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 19 Sep 2016 17:34:41 +0000 (14:34 -0300)
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>
drivers/media/v4l2-core/v4l2-dv-timings.c
include/uapi/linux/v4l2-dv-timings.h
include/uapi/linux/videodev2.h

index 889de0a321529ace36560ddabd682b74f080de8d..730a7c392c1db22ce71a24ad44389fd7b54d5442 100644 (file)
@@ -306,7 +306,7 @@ void v4l2_print_dv_timings(const char *dev_prefix, const char *prefix,
                        (bt->polarities & V4L2_DV_VSYNC_POS_POL) ? "+" : "-",
                        bt->il_vsync, bt->il_vbackporch);
        pr_info("%s: pixelclock: %llu\n", dev_prefix, bt->pixelclock);
-       pr_info("%s: flags (0x%x):%s%s%s%s%s%s\n", dev_prefix, bt->flags,
+       pr_info("%s: flags (0x%x):%s%s%s%s%s%s%s\n", dev_prefix, bt->flags,
                        (bt->flags & V4L2_DV_FL_REDUCED_BLANKING) ?
                        " REDUCED_BLANKING" : "",
                        ((bt->flags & V4L2_DV_FL_REDUCED_BLANKING) &&
@@ -318,12 +318,15 @@ void v4l2_print_dv_timings(const char *dev_prefix, const char *prefix,
                        (bt->flags & V4L2_DV_FL_HALF_LINE) ?
                        " HALF_LINE" : "",
                        (bt->flags & V4L2_DV_FL_IS_CE_VIDEO) ?
-                       " CE_VIDEO" : "");
-       pr_info("%s: standards (0x%x):%s%s%s%s\n", dev_prefix, bt->standards,
+                       " CE_VIDEO" : "",
+                       (bt->flags & V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE) ?
+                       " FIRST_FIELD_EXTRA_LINE" : "");
+       pr_info("%s: standards (0x%x):%s%s%s%s%s\n", dev_prefix, bt->standards,
                        (bt->standards & V4L2_DV_BT_STD_CEA861) ?  " CEA" : "",
                        (bt->standards & V4L2_DV_BT_STD_DMT) ?  " DMT" : "",
                        (bt->standards & V4L2_DV_BT_STD_CVT) ?  " CVT" : "",
-                       (bt->standards & V4L2_DV_BT_STD_GTF) ?  " GTF" : "");
+                       (bt->standards & V4L2_DV_BT_STD_GTF) ?  " GTF" : "",
+                       (bt->standards & V4L2_DV_BT_STD_SDI) ?  " SDI" : "");
 }
 EXPORT_SYMBOL_GPL(v4l2_print_dv_timings);
 
index 086168e18ca83e462dcf088316d8f6c436cde42f..f31957166337b41f1a6c24e78d98c8c5b0d3e55c 100644 (file)
                V4L2_DV_FL_REDUCED_BLANKING) \
 }
 
+/* SDI timings definitions */
+
+/* SMPTE-125M */
+#define V4L2_DV_BT_SDI_720X487I60 { \
+       .type = V4L2_DV_BT_656_1120, \
+       V4L2_INIT_BT_TIMINGS(720, 487, 1, \
+               V4L2_DV_HSYNC_POS_POL, \
+               13500000, 16, 121, 0, 0, 19, 0, 0, 19, 0, \
+               V4L2_DV_BT_STD_SDI, \
+               V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE) \
+}
+
 #endif
index 5529741202b5ba398623cb4656bcb030620fcfa4..94f123f3e04e03307b4d662f13f6d2e0edacabfb 100644 (file)
@@ -1274,6 +1274,7 @@ struct v4l2_bt_timings {
 #define V4L2_DV_BT_STD_DMT     (1 << 1)  /* VESA Discrete Monitor Timings */
 #define V4L2_DV_BT_STD_CVT     (1 << 2)  /* VESA Coordinated Video Timings */
 #define V4L2_DV_BT_STD_GTF     (1 << 3)  /* VESA Generalized Timings Formula */
+#define V4L2_DV_BT_STD_SDI     (1 << 4)  /* SDI Timings */
 
 /* Flags */
 
@@ -1305,6 +1306,11 @@ struct v4l2_bt_timings {
  * use the range 16-235) as opposed to 0-255. All formats defined in CEA-861
  * except for the 640x480 format are CE formats. */
 #define V4L2_DV_FL_IS_CE_VIDEO                 (1 << 4)
+/* Some formats like SMPTE-125M have an interlaced signal with a odd
+ * total height. For these formats, if this flag is set, the first
+ * field has the extra line. If not, it is the second field.
+ */
+#define V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE              (1 << 5)
 
 /* A few useful defines to calculate the total blanking and frame sizes */
 #define V4L2_DV_BT_BLANKING_WIDTH(bt) \
@@ -1429,6 +1435,8 @@ struct v4l2_input {
 /* field 'status' - analog */
 #define V4L2_IN_ST_NO_H_LOCK   0x00000100  /* No horizontal sync lock */
 #define V4L2_IN_ST_COLOR_KILL  0x00000200  /* Color killer is active */
+#define V4L2_IN_ST_NO_V_LOCK   0x00000400  /* No vertical sync lock */
+#define V4L2_IN_ST_NO_STD_LOCK 0x00000800  /* No standard format lock */
 
 /* field 'status' - digital */
 #define V4L2_IN_ST_NO_SYNC     0x00010000  /* No synchronization lock */