OSDN Git Service

media: v4l2-ioctl: add QUIRK_INVERTED_CROP
authorHans Verkuil <hans.verkuil@cisco.com>
Thu, 4 Oct 2018 20:44:01 +0000 (16:44 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 20 Nov 2018 18:28:20 +0000 (13:28 -0500)
commit8cbd94bda98368d9fc0c5d69f64e221dbcb5a3a8
tree837551426aeff8b42c9fd6e54ebee75473d38d66
parent177bbc67812d96dfec517ef293017ca614a0955a
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>
drivers/media/v4l2-core/v4l2-ioctl.c
include/media/v4l2-dev.h