History

[media] v4l2-subdev.h: add 'which' field for the enum structs

While all other pad ops allow you to select whether to use the 'try' or the 'active' formats, the enum ops didn't have that option and always used 'try'. However, this will fail if a simple (e.g. PCI) bridge driver wants to use the enum pad op of a subdev that's also used in a complex platform driver like the omap3. Such a bridge driver generally wants to enum formats based on the active format. So add a new 'which' field to these structs. Note that V4L2_SUBDEV_FORMAT_TRY is 0, so the default remains TRY (applications need to set reserved to 0).

Hans Verkuil committed 11 years ago

Commit e1c47e71 parent f7234131 file · +9 −3Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/v4l2-subdev.h+9−3
@@ -69,12 +69,14 @@ struct v4l2_subdev_crop { · 68 unmodified lines
6969 * @pad: pad number, as reported by the media API
7070 * @index: format index during enumeration
7171 * @code: format code (MEDIA_BUS_FMT_ definitions)
72+ * @which: format type (from enum v4l2_subdev_format_whence)
7273 */
7374 struct v4l2_subdev_mbus_code_enum {
7475 __u32 pad;
7576 __u32 index;
7677 __u32 code;
77− __u32 reserved[9];
78+ __u32 which;
79+ __u32 reserved[8];
7880 };
7981
8082 /**
@@ -82,6 +84,7 @@ struct v4l2_subdev_mbus_code_enum { · 1 unmodified line
8284 * @pad: pad number, as reported by the media API
8385 * @index: format index during enumeration
8486 * @code: format code (MEDIA_BUS_FMT_ definitions)
87+ * @which: format type (from enum v4l2_subdev_format_whence)
8588 */
8689 struct v4l2_subdev_frame_size_enum {
8790 __u32 index;
@@ -91,7 +94,8 @@ struct v4l2_subdev_frame_size_enum { · 3 unmodified lines
9194 __u32 max_width;
9295 __u32 min_height;
9396 __u32 max_height;
94− __u32 reserved[9];
97+ __u32 which;
98+ __u32 reserved[8];
9599 };
96100
97101 /**
@@ -113,6 +117,7 @@ struct v4l2_subdev_frame_interval { · 15 unmodified lines
113117 * @width: frame width in pixels
114118 * @height: frame height in pixels
115119 * @interval: frame interval in seconds
120+ * @which: format type (from enum v4l2_subdev_format_whence)
116121 */
117122 struct v4l2_subdev_frame_interval_enum {
118123 __u32 index;
@@ -121,7 +126,8 @@ struct v4l2_subdev_frame_interval_enum { · 2 unmodified lines
121126 __u32 width;
122127 __u32 height;
123128 struct v4l2_fract interval;
124− __u32 reserved[9];
129+ __u32 which;
130+ __u32 reserved[8];
125131 };
126132
127133 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t