diff options
author | Charles-Antoine Couret <charles-antoine.couret@nexvision.fr> | 2016-09-15 11:29:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-19 13:34:41 -0400 |
commit | 7389e6ef347443ac90116c2208bbdfb4f9d135ba (patch) | |
tree | fcf76bd851d0c0ee5d84d795e4b9789af8a56a49 | |
parent | 618cd932cd38b65d89eb31a5271999b6ccc59b2e (diff) |
[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>
-rw-r--r-- | drivers/media/v4l2-core/v4l2-dv-timings.c | 11 | ||||
-rw-r--r-- | include/uapi/linux/v4l2-dv-timings.h | 12 | ||||
-rw-r--r-- | include/uapi/linux/videodev2.h | 8 |
3 files changed, 27 insertions, 4 deletions
diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c index 889de0a32152..730a7c392c1d 100644 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c | |||
@@ -306,7 +306,7 @@ void v4l2_print_dv_timings(const char *dev_prefix, const char *prefix, | |||
306 | (bt->polarities & V4L2_DV_VSYNC_POS_POL) ? "+" : "-", | 306 | (bt->polarities & V4L2_DV_VSYNC_POS_POL) ? "+" : "-", |
307 | bt->il_vsync, bt->il_vbackporch); | 307 | bt->il_vsync, bt->il_vbackporch); |
308 | pr_info("%s: pixelclock: %llu\n", dev_prefix, bt->pixelclock); | 308 | pr_info("%s: pixelclock: %llu\n", dev_prefix, bt->pixelclock); |
309 | pr_info("%s: flags (0x%x):%s%s%s%s%s%s\n", dev_prefix, bt->flags, | 309 | pr_info("%s: flags (0x%x):%s%s%s%s%s%s%s\n", dev_prefix, bt->flags, |
310 | (bt->flags & V4L2_DV_FL_REDUCED_BLANKING) ? | 310 | (bt->flags & V4L2_DV_FL_REDUCED_BLANKING) ? |
311 | " REDUCED_BLANKING" : "", | 311 | " REDUCED_BLANKING" : "", |
312 | ((bt->flags & V4L2_DV_FL_REDUCED_BLANKING) && | 312 | ((bt->flags & V4L2_DV_FL_REDUCED_BLANKING) && |
@@ -318,12 +318,15 @@ void v4l2_print_dv_timings(const char *dev_prefix, const char *prefix, | |||
318 | (bt->flags & V4L2_DV_FL_HALF_LINE) ? | 318 | (bt->flags & V4L2_DV_FL_HALF_LINE) ? |
319 | " HALF_LINE" : "", | 319 | " HALF_LINE" : "", |
320 | (bt->flags & V4L2_DV_FL_IS_CE_VIDEO) ? | 320 | (bt->flags & V4L2_DV_FL_IS_CE_VIDEO) ? |
321 | " CE_VIDEO" : ""); | 321 | " CE_VIDEO" : "", |
322 | pr_info("%s: standards (0x%x):%s%s%s%s\n", dev_prefix, bt->standards, | 322 | (bt->flags & V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE) ? |
323 | " FIRST_FIELD_EXTRA_LINE" : ""); | ||
324 | pr_info("%s: standards (0x%x):%s%s%s%s%s\n", dev_prefix, bt->standards, | ||
323 | (bt->standards & V4L2_DV_BT_STD_CEA861) ? " CEA" : "", | 325 | (bt->standards & V4L2_DV_BT_STD_CEA861) ? " CEA" : "", |
324 | (bt->standards & V4L2_DV_BT_STD_DMT) ? " DMT" : "", | 326 | (bt->standards & V4L2_DV_BT_STD_DMT) ? " DMT" : "", |
325 | (bt->standards & V4L2_DV_BT_STD_CVT) ? " CVT" : "", | 327 | (bt->standards & V4L2_DV_BT_STD_CVT) ? " CVT" : "", |
326 | (bt->standards & V4L2_DV_BT_STD_GTF) ? " GTF" : ""); | 328 | (bt->standards & V4L2_DV_BT_STD_GTF) ? " GTF" : "", |
329 | (bt->standards & V4L2_DV_BT_STD_SDI) ? " SDI" : ""); | ||
327 | } | 330 | } |
328 | EXPORT_SYMBOL_GPL(v4l2_print_dv_timings); | 331 | EXPORT_SYMBOL_GPL(v4l2_print_dv_timings); |
329 | 332 | ||
diff --git a/include/uapi/linux/v4l2-dv-timings.h b/include/uapi/linux/v4l2-dv-timings.h index 086168e18ca8..f31957166337 100644 --- a/include/uapi/linux/v4l2-dv-timings.h +++ b/include/uapi/linux/v4l2-dv-timings.h | |||
@@ -934,4 +934,16 @@ | |||
934 | V4L2_DV_FL_REDUCED_BLANKING) \ | 934 | V4L2_DV_FL_REDUCED_BLANKING) \ |
935 | } | 935 | } |
936 | 936 | ||
937 | /* SDI timings definitions */ | ||
938 | |||
939 | /* SMPTE-125M */ | ||
940 | #define V4L2_DV_BT_SDI_720X487I60 { \ | ||
941 | .type = V4L2_DV_BT_656_1120, \ | ||
942 | V4L2_INIT_BT_TIMINGS(720, 487, 1, \ | ||
943 | V4L2_DV_HSYNC_POS_POL, \ | ||
944 | 13500000, 16, 121, 0, 0, 19, 0, 0, 19, 0, \ | ||
945 | V4L2_DV_BT_STD_SDI, \ | ||
946 | V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE) \ | ||
947 | } | ||
948 | |||
937 | #endif | 949 | #endif |
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 5529741202b5..94f123f3e04e 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h | |||
@@ -1274,6 +1274,7 @@ struct v4l2_bt_timings { | |||
1274 | #define V4L2_DV_BT_STD_DMT (1 << 1) /* VESA Discrete Monitor Timings */ | 1274 | #define V4L2_DV_BT_STD_DMT (1 << 1) /* VESA Discrete Monitor Timings */ |
1275 | #define V4L2_DV_BT_STD_CVT (1 << 2) /* VESA Coordinated Video Timings */ | 1275 | #define V4L2_DV_BT_STD_CVT (1 << 2) /* VESA Coordinated Video Timings */ |
1276 | #define V4L2_DV_BT_STD_GTF (1 << 3) /* VESA Generalized Timings Formula */ | 1276 | #define V4L2_DV_BT_STD_GTF (1 << 3) /* VESA Generalized Timings Formula */ |
1277 | #define V4L2_DV_BT_STD_SDI (1 << 4) /* SDI Timings */ | ||
1277 | 1278 | ||
1278 | /* Flags */ | 1279 | /* Flags */ |
1279 | 1280 | ||
@@ -1305,6 +1306,11 @@ struct v4l2_bt_timings { | |||
1305 | * use the range 16-235) as opposed to 0-255. All formats defined in CEA-861 | 1306 | * use the range 16-235) as opposed to 0-255. All formats defined in CEA-861 |
1306 | * except for the 640x480 format are CE formats. */ | 1307 | * except for the 640x480 format are CE formats. */ |
1307 | #define V4L2_DV_FL_IS_CE_VIDEO (1 << 4) | 1308 | #define V4L2_DV_FL_IS_CE_VIDEO (1 << 4) |
1309 | /* Some formats like SMPTE-125M have an interlaced signal with a odd | ||
1310 | * total height. For these formats, if this flag is set, the first | ||
1311 | * field has the extra line. If not, it is the second field. | ||
1312 | */ | ||
1313 | #define V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE (1 << 5) | ||
1308 | 1314 | ||
1309 | /* A few useful defines to calculate the total blanking and frame sizes */ | 1315 | /* A few useful defines to calculate the total blanking and frame sizes */ |
1310 | #define V4L2_DV_BT_BLANKING_WIDTH(bt) \ | 1316 | #define V4L2_DV_BT_BLANKING_WIDTH(bt) \ |
@@ -1429,6 +1435,8 @@ struct v4l2_input { | |||
1429 | /* field 'status' - analog */ | 1435 | /* field 'status' - analog */ |
1430 | #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */ | 1436 | #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */ |
1431 | #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */ | 1437 | #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */ |
1438 | #define V4L2_IN_ST_NO_V_LOCK 0x00000400 /* No vertical sync lock */ | ||
1439 | #define V4L2_IN_ST_NO_STD_LOCK 0x00000800 /* No standard format lock */ | ||
1432 | 1440 | ||
1433 | /* field 'status' - digital */ | 1441 | /* field 'status' - digital */ |
1434 | #define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */ | 1442 | #define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */ |