Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] v4l: Replace enums with fixed-sized fields in public structure

The v4l2_mbus_framefmt structure will be part of the public userspace
API and used (albeit indirectly) as an ioctl argument. As such, its size
must be fixed across userspace ABIs.

Replace the v4l2_field and v4l2_colorspace enums by __u32 fields and add
padding for future enhancements.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Laurent Pinchart and committed by
Mauro Carvalho Chehab
84d0688d 2ef2d5a3

+9 -8
+9 -8
include/linux/v4l2-mediabus.h
··· 63 63 * struct v4l2_mbus_framefmt - frame format on the media bus 64 64 * @width: frame width 65 65 * @height: frame height 66 - * @code: data format code 67 - * @field: used interlacing type 68 - * @colorspace: colorspace of the data 66 + * @code: data format code (from enum v4l2_mbus_pixelcode) 67 + * @field: used interlacing type (from enum v4l2_field) 68 + * @colorspace: colorspace of the data (from enum v4l2_colorspace) 69 69 */ 70 70 struct v4l2_mbus_framefmt { 71 - __u32 width; 72 - __u32 height; 73 - __u32 code; 74 - enum v4l2_field field; 75 - enum v4l2_colorspace colorspace; 71 + __u32 width; 72 + __u32 height; 73 + __u32 code; 74 + __u32 field; 75 + __u32 colorspace; 76 + __u32 reserved[7]; 76 77 }; 77 78 78 79 #endif