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).
Showing the changes to include/uapi (1 of 1 file). Show all
Unified · Split
| @@ -69,12 +69,14 @@ struct v4l2_subdev_crop { · 68 unmodified lines | ||
| 69 | 69 | * @pad: pad number, as reported by the media API |
| 70 | 70 | * @index: format index during enumeration |
| 71 | 71 | * @code: format code (MEDIA_BUS_FMT_ definitions) |
| 72 | + * @which: format type (from enum v4l2_subdev_format_whence) | |
| 72 | 73 | */ |
| 73 | 74 | struct v4l2_subdev_mbus_code_enum { |
| 74 | 75 | __u32 pad; |
| 75 | 76 | __u32 index; |
| 76 | 77 | __u32 code; |
| 77 | − __u32 reserved[9]; | |
| 78 | + __u32 which; | |
| 79 | + __u32 reserved[8]; | |
| 78 | 80 | }; |
| 79 | 81 | |
| 80 | 82 | /** |
| @@ -82,6 +84,7 @@ struct v4l2_subdev_mbus_code_enum { · 1 unmodified line | ||
| 82 | 84 | * @pad: pad number, as reported by the media API |
| 83 | 85 | * @index: format index during enumeration |
| 84 | 86 | * @code: format code (MEDIA_BUS_FMT_ definitions) |
| 87 | + * @which: format type (from enum v4l2_subdev_format_whence) | |
| 85 | 88 | */ |
| 86 | 89 | struct v4l2_subdev_frame_size_enum { |
| 87 | 90 | __u32 index; |
| @@ -91,7 +94,8 @@ struct v4l2_subdev_frame_size_enum { · 3 unmodified lines | ||
| 91 | 94 | __u32 max_width; |
| 92 | 95 | __u32 min_height; |
| 93 | 96 | __u32 max_height; |
| 94 | − __u32 reserved[9]; | |
| 97 | + __u32 which; | |
| 98 | + __u32 reserved[8]; | |
| 95 | 99 | }; |
| 96 | 100 | |
| 97 | 101 | /** |
| @@ -113,6 +117,7 @@ struct v4l2_subdev_frame_interval { · 15 unmodified lines | ||
| 113 | 117 | * @width: frame width in pixels |
| 114 | 118 | * @height: frame height in pixels |
| 115 | 119 | * @interval: frame interval in seconds |
| 120 | + * @which: format type (from enum v4l2_subdev_format_whence) | |
| 116 | 121 | */ |
| 117 | 122 | struct v4l2_subdev_frame_interval_enum { |
| 118 | 123 | __u32 index; |
| @@ -121,7 +126,8 @@ struct v4l2_subdev_frame_interval_enum { · 2 unmodified lines | ||
| 121 | 126 | __u32 width; |
| 122 | 127 | __u32 height; |
| 123 | 128 | struct v4l2_fract interval; |
| 124 | − __u32 reserved[9]; | |
| 129 | + __u32 which; | |
| 130 | + __u32 reserved[8]; | |
| 125 | 131 | }; |
| 126 | 132 | |
| 127 | 133 | /** |