diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2018-10-04 16:44:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-11-20 13:28:20 -0500 |
commit | 8cbd94bda98368d9fc0c5d69f64e221dbcb5a3a8 (patch) | |
tree | 837551426aeff8b42c9fd6e54ebee75473d38d66 /include/media/v4l2-dev.h | |
parent | 177bbc67812d96dfec517ef293017ca614a0955a (diff) | |
download | lwn-8cbd94bda98368d9fc0c5d69f64e221dbcb5a3a8.tar.gz lwn-8cbd94bda98368d9fc0c5d69f64e221dbcb5a3a8.zip |
media: v4l2-ioctl: add QUIRK_INVERTED_CROP
Some old Samsung drivers use the legacy crop API incorrectly:
the crop and compose targets are swapped. Normally VIDIOC_G_CROP
will return the CROP rectangle of a CAPTURE stream and the COMPOSE
rectangle of an OUTPUT stream.
The Samsung drivers do the opposite. Note that these drivers predate
the selection API.
If this 'QUIRK' flag is set, then the v4l2-ioctl core will swap
the CROP and COMPOSE targets as well.
That way backwards compatibility is ensured and we can convert the
Samsung drivers to the selection API.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'include/media/v4l2-dev.h')
-rw-r--r-- | include/media/v4l2-dev.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 456ac13eca1d..48531e57cc5a 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h @@ -74,10 +74,19 @@ struct v4l2_ctrl_handler; * indicates that file->private_data points to &struct v4l2_fh. * This flag is set by the core when v4l2_fh_init() is called. * All new drivers should use it. + * @V4L2_FL_QUIRK_INVERTED_CROP: + * some old M2M drivers use g/s_crop/cropcap incorrectly: crop and + * compose are swapped. If this flag is set, then the selection + * targets are swapped in the g/s_crop/cropcap functions in v4l2-ioctl.c. + * This allows those drivers to correctly implement the selection API, + * but the old crop API will still work as expected in order to preserve + * backwards compatibility. + * Never set this flag for new drivers. */ enum v4l2_video_device_flags { - V4L2_FL_REGISTERED = 0, - V4L2_FL_USES_V4L2_FH = 1, + V4L2_FL_REGISTERED = 0, + V4L2_FL_USES_V4L2_FH = 1, + V4L2_FL_QUIRK_INVERTED_CROP = 2, }; /* Priority helper functions */ |