media: vimc: debayer: Use subdev active state
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 24 Apr 2024 23:57:40 +0000 (02:57 +0300)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 26 Jun 2024 14:39:34 +0000 (16:39 +0200)
commit4c46cb2a7f1d63fa7b027af05e0393e4fe9ccb52
treeb3567ff9825f549385715264c899312b63db80fd
parentcf2552d87ac0e50f98c1e18d233a74ca58af819f
media: vimc: debayer: Use subdev active state

Store the active formats and crop rectangle in the subdevice active
state. This simplifies implementation of the format and selection
accessors, and allows using the v4l2_subdev_get_fmt() helper to
implement the .get_fmt() operation.

The active configuration that is used in the .process_frame() handler is
still stored in the vimc_debayer_device structure. The driver could
instead access the active state in the .process_frame() handler, but the
required locking could interfere with the real time constraints of the
frame processing. This data would be stored in registers in the
.s_stream() handler for real hardware, storing it in dedicated storage
thus mimics a real driver. To differentiate them from the rest of the
device private data, move the corresponding fields to a sub-structure of
vimc_debayer_device named hw.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/test-drivers/vimc/vimc-debayer.c