diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-04-24 08:25:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-18 15:36:27 -0400 |
commit | 06bba75d2a3e0bf558421b7548a6248ed5c7bfec (patch) | |
tree | 6ad5a78667c7e938588f23c3c813e75f954cd7f3 /include/linux/videodev2.h | |
parent | dedb8cb1d64a118ac21eaabd941ac0b9acdd82fb (diff) |
[media] videodev2.h: add enum/query/cap dv_timings ioctls
These new ioctls make it possible for the dv_timings API to replace
the dv_preset API eventually.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/linux/videodev2.h')
-rw-r--r-- | include/linux/videodev2.h | 173 |
1 files changed, 149 insertions, 24 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index dc3e3ea28f99..13d84ed9d3a8 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -991,29 +991,56 @@ struct v4l2_dv_enum_preset { | |||
991 | * D V B T T I M I N G S | 991 | * D V B T T I M I N G S |
992 | */ | 992 | */ |
993 | 993 | ||
994 | /* BT.656/BT.1120 timing data */ | 994 | /** struct v4l2_bt_timings - BT.656/BT.1120 timing data |
995 | * @width: total width of the active video in pixels | ||
996 | * @height: total height of the active video in lines | ||
997 | * @interlaced: Interlaced or progressive | ||
998 | * @polarities: Positive or negative polarities | ||
999 | * @pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000 | ||
1000 | * @hfrontporch:Horizontal front porch in pixels | ||
1001 | * @hsync: Horizontal Sync length in pixels | ||
1002 | * @hbackporch: Horizontal back porch in pixels | ||
1003 | * @vfrontporch:Vertical front porch in lines | ||
1004 | * @vsync: Vertical Sync length in lines | ||
1005 | * @vbackporch: Vertical back porch in lines | ||
1006 | * @il_vfrontporch:Vertical front porch for the even field | ||
1007 | * (aka field 2) of interlaced field formats | ||
1008 | * @il_vsync: Vertical Sync length for the even field | ||
1009 | * (aka field 2) of interlaced field formats | ||
1010 | * @il_vbackporch:Vertical back porch for the even field | ||
1011 | * (aka field 2) of interlaced field formats | ||
1012 | * @standards: Standards the timing belongs to | ||
1013 | * @flags: Flags | ||
1014 | * @reserved: Reserved fields, must be zeroed. | ||
1015 | * | ||
1016 | * A note regarding vertical interlaced timings: height refers to the total | ||
1017 | * height of the active video frame (= two fields). The blanking timings refer | ||
1018 | * to the blanking of each field. So the height of the total frame is | ||
1019 | * calculated as follows: | ||
1020 | * | ||
1021 | * tot_height = height + vfrontporch + vsync + vbackporch + | ||
1022 | * il_vfrontporch + il_vsync + il_vbackporch | ||
1023 | * | ||
1024 | * The active height of each field is height / 2. | ||
1025 | */ | ||
995 | struct v4l2_bt_timings { | 1026 | struct v4l2_bt_timings { |
996 | __u32 width; /* width in pixels */ | 1027 | __u32 width; |
997 | __u32 height; /* height in lines */ | 1028 | __u32 height; |
998 | __u32 interlaced; /* Interlaced or progressive */ | 1029 | __u32 interlaced; |
999 | __u32 polarities; /* Positive or negative polarity */ | 1030 | __u32 polarities; |
1000 | __u64 pixelclock; /* Pixel clock in HZ. Ex. 74.25MHz->74250000 */ | 1031 | __u64 pixelclock; |
1001 | __u32 hfrontporch; /* Horizpontal front porch in pixels */ | 1032 | __u32 hfrontporch; |
1002 | __u32 hsync; /* Horizontal Sync length in pixels */ | 1033 | __u32 hsync; |
1003 | __u32 hbackporch; /* Horizontal back porch in pixels */ | 1034 | __u32 hbackporch; |
1004 | __u32 vfrontporch; /* Vertical front porch in pixels */ | 1035 | __u32 vfrontporch; |
1005 | __u32 vsync; /* Vertical Sync length in lines */ | 1036 | __u32 vsync; |
1006 | __u32 vbackporch; /* Vertical back porch in lines */ | 1037 | __u32 vbackporch; |
1007 | __u32 il_vfrontporch; /* Vertical front porch for bottom field of | 1038 | __u32 il_vfrontporch; |
1008 | * interlaced field formats | 1039 | __u32 il_vsync; |
1009 | */ | 1040 | __u32 il_vbackporch; |
1010 | __u32 il_vsync; /* Vertical sync length for bottom field of | 1041 | __u32 standards; |
1011 | * interlaced field formats | 1042 | __u32 flags; |
1012 | */ | 1043 | __u32 reserved[14]; |
1013 | __u32 il_vbackporch; /* Vertical back porch for bottom field of | ||
1014 | * interlaced field formats | ||
1015 | */ | ||
1016 | __u32 reserved[16]; | ||
1017 | } __attribute__ ((packed)); | 1044 | } __attribute__ ((packed)); |
1018 | 1045 | ||
1019 | /* Interlaced or progressive format */ | 1046 | /* Interlaced or progressive format */ |
@@ -1024,8 +1051,42 @@ struct v4l2_bt_timings { | |||
1024 | #define V4L2_DV_VSYNC_POS_POL 0x00000001 | 1051 | #define V4L2_DV_VSYNC_POS_POL 0x00000001 |
1025 | #define V4L2_DV_HSYNC_POS_POL 0x00000002 | 1052 | #define V4L2_DV_HSYNC_POS_POL 0x00000002 |
1026 | 1053 | ||
1027 | 1054 | /* Timings standards */ | |
1028 | /* DV timings */ | 1055 | #define V4L2_DV_BT_STD_CEA861 (1 << 0) /* CEA-861 Digital TV Profile */ |
1056 | #define V4L2_DV_BT_STD_DMT (1 << 1) /* VESA Discrete Monitor Timings */ | ||
1057 | #define V4L2_DV_BT_STD_CVT (1 << 2) /* VESA Coordinated Video Timings */ | ||
1058 | #define V4L2_DV_BT_STD_GTF (1 << 3) /* VESA Generalized Timings Formula */ | ||
1059 | |||
1060 | /* Flags */ | ||
1061 | |||
1062 | /* CVT/GTF specific: timing uses reduced blanking (CVT) or the 'Secondary | ||
1063 | GTF' curve (GTF). In both cases the horizontal and/or vertical blanking | ||
1064 | intervals are reduced, allowing a higher resolution over the same | ||
1065 | bandwidth. This is a read-only flag. */ | ||
1066 | #define V4L2_DV_FL_REDUCED_BLANKING (1 << 0) | ||
1067 | /* CEA-861 specific: set for CEA-861 formats with a framerate of a multiple | ||
1068 | of six. These formats can be optionally played at 1 / 1.001 speed. | ||
1069 | This is a read-only flag. */ | ||
1070 | #define V4L2_DV_FL_CAN_REDUCE_FPS (1 << 1) | ||
1071 | /* CEA-861 specific: only valid for video transmitters, the flag is cleared | ||
1072 | by receivers. | ||
1073 | If the framerate of the format is a multiple of six, then the pixelclock | ||
1074 | used to set up the transmitter is divided by 1.001 to make it compatible | ||
1075 | with 60 Hz based standards such as NTSC and PAL-M that use a framerate of | ||
1076 | 29.97 Hz. Otherwise this flag is cleared. If the transmitter can't generate | ||
1077 | such frequencies, then the flag will also be cleared. */ | ||
1078 | #define V4L2_DV_FL_REDUCED_FPS (1 << 2) | ||
1079 | /* Specific to interlaced formats: if set, then field 1 is really one half-line | ||
1080 | longer and field 2 is really one half-line shorter, so each field has | ||
1081 | exactly the same number of half-lines. Whether half-lines can be detected | ||
1082 | or used depends on the hardware. */ | ||
1083 | #define V4L2_DV_FL_HALF_LINE (1 << 0) | ||
1084 | |||
1085 | |||
1086 | /** struct v4l2_dv_timings - DV timings | ||
1087 | * @type: the type of the timings | ||
1088 | * @bt: BT656/1120 timings | ||
1089 | */ | ||
1029 | struct v4l2_dv_timings { | 1090 | struct v4l2_dv_timings { |
1030 | __u32 type; | 1091 | __u32 type; |
1031 | union { | 1092 | union { |
@@ -1037,6 +1098,64 @@ struct v4l2_dv_timings { | |||
1037 | /* Values for the type field */ | 1098 | /* Values for the type field */ |
1038 | #define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */ | 1099 | #define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */ |
1039 | 1100 | ||
1101 | |||
1102 | /** struct v4l2_enum_dv_timings - DV timings enumeration | ||
1103 | * @index: enumeration index | ||
1104 | * @reserved: must be zeroed | ||
1105 | * @timings: the timings for the given index | ||
1106 | */ | ||
1107 | struct v4l2_enum_dv_timings { | ||
1108 | __u32 index; | ||
1109 | __u32 reserved[3]; | ||
1110 | struct v4l2_dv_timings timings; | ||
1111 | }; | ||
1112 | |||
1113 | /** struct v4l2_bt_timings_cap - BT.656/BT.1120 timing capabilities | ||
1114 | * @min_width: width in pixels | ||
1115 | * @max_width: width in pixels | ||
1116 | * @min_height: height in lines | ||
1117 | * @max_height: height in lines | ||
1118 | * @min_pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000 | ||
1119 | * @max_pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000 | ||
1120 | * @standards: Supported standards | ||
1121 | * @capabilities: Supported capabilities | ||
1122 | * @reserved: Must be zeroed | ||
1123 | */ | ||
1124 | struct v4l2_bt_timings_cap { | ||
1125 | __u32 min_width; | ||
1126 | __u32 max_width; | ||
1127 | __u32 min_height; | ||
1128 | __u32 max_height; | ||
1129 | __u64 min_pixelclock; | ||
1130 | __u64 max_pixelclock; | ||
1131 | __u32 standards; | ||
1132 | __u32 capabilities; | ||
1133 | __u32 reserved[16]; | ||
1134 | } __attribute__ ((packed)); | ||
1135 | |||
1136 | /* Supports interlaced formats */ | ||
1137 | #define V4L2_DV_BT_CAP_INTERLACED (1 << 0) | ||
1138 | /* Supports progressive formats */ | ||
1139 | #define V4L2_DV_BT_CAP_PROGRESSIVE (1 << 1) | ||
1140 | /* Supports CVT/GTF reduced blanking */ | ||
1141 | #define V4L2_DV_BT_CAP_REDUCED_BLANKING (1 << 2) | ||
1142 | /* Supports custom formats */ | ||
1143 | #define V4L2_DV_BT_CAP_CUSTOM (1 << 3) | ||
1144 | |||
1145 | /** struct v4l2_dv_timings_cap - DV timings capabilities | ||
1146 | * @type: the type of the timings (same as in struct v4l2_dv_timings) | ||
1147 | * @bt: the BT656/1120 timings capabilities | ||
1148 | */ | ||
1149 | struct v4l2_dv_timings_cap { | ||
1150 | __u32 type; | ||
1151 | __u32 reserved[3]; | ||
1152 | union { | ||
1153 | struct v4l2_bt_timings_cap bt; | ||
1154 | __u32 raw_data[32]; | ||
1155 | }; | ||
1156 | }; | ||
1157 | |||
1158 | |||
1040 | /* | 1159 | /* |
1041 | * V I D E O I N P U T S | 1160 | * V I D E O I N P U T S |
1042 | */ | 1161 | */ |
@@ -2513,6 +2632,12 @@ struct v4l2_create_buffers { | |||
2513 | #define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd) | 2632 | #define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd) |
2514 | #define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd) | 2633 | #define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd) |
2515 | 2634 | ||
2635 | /* Experimental, these three ioctls may change over the next couple of kernel | ||
2636 | versions. */ | ||
2637 | #define VIDIOC_ENUM_DV_TIMINGS _IOWR('V', 96, struct v4l2_enum_dv_timings) | ||
2638 | #define VIDIOC_QUERY_DV_TIMINGS _IOR('V', 97, struct v4l2_dv_timings) | ||
2639 | #define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 98, struct v4l2_dv_timings_cap) | ||
2640 | |||
2516 | /* Reminder: when adding new ioctls please add support for them to | 2641 | /* Reminder: when adding new ioctls please add support for them to |
2517 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 2642 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
2518 | 2643 | ||