]> git.baikalelectronics.ru Git - kernel.git/commit
media: tvp5150: add FORMAT_TRY support for get/set selection handlers
authorMarco Felsch <m.felsch@pengutronix.de>
Thu, 12 Mar 2020 10:31:48 +0000 (11:31 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 12 Mar 2020 15:38:21 +0000 (16:38 +0100)
commitd63a3d695dadef3d41d177e5657c93bae1ca13c4
treeca7b5a38fed5ad5f8bcbd5df1b63510f47db47d2
parentd11dd4258900ea64c4de18b94819d8395e050946
media: tvp5150: add FORMAT_TRY support for get/set selection handlers

Since commit 7f5e871baf71 ("[media] v4l2: remove g/s_crop from video ops")
the 'which' field for set/get_selection must be FORMAT_ACTIVE. There is
no way to try different selections. The patch adds a helper function to
select the correct selection memory space (sub-device file handle or
driver state) which will be set/returned.

The selection rectangle is updated if the format is FORMAT_ACTIVE and
the rectangle position and/or size differs from the current set
rectangle.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/tvp5150.c