media: rkisp1: isp: Use V4L2 subdev active state
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 26 Jan 2023 01:10:01 +0000 (03:10 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 12 Oct 2023 07:46:37 +0000 (09:46 +0200)
commit2cce0a369dbdb59d806f9c0c3599ff74a864c0f4
tree6c5dee307e36e19f668deb36a5e8126fbd4bcada
parent88f870f6ecc410b4de6d75c1e1b82c3ad38a3a39
media: rkisp1: isp: Use V4L2 subdev active state

Use the V4L2 subdev active state API to store the active format and crop
rectangle. This simplifies the driver not only by dropping the state
stored in the rkisp1_isp structure, but also by replacing the ops_lock
with the state lock.

The rkisp1_isp.sink_fmt field needs to be kept, as it is accessed from
the stats interrupt handler. To simplify the rkisp1_isp_set_sink_fmt()
implementation, the field is now set when starting the ISP, instead of
when setting the format.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c