OSDN Git Service

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)
commit46fe6e7dcededcf4aba88163fee80f4f7df23deb
treeca7b5a38fed5ad5f8bcbd5df1b63510f47db47d2
parentb4125e5b1bd70d3d9c22f8926e99c87967d71734
media: tvp5150: add FORMAT_TRY support for get/set selection handlers

Since commit 10d5509c8d50 ("[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