media: v4l: subdev: Also return pads array information on stream functions
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 13 Oct 2023 07:31:37 +0000 (09:31 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 23 Nov 2023 17:31:19 +0000 (18:31 +0100)
commit049fa16b81c276f25a09abaa4e8f743470c3cdc8
tree92fb57facbc41106348f69aadaed83d0e76b9a21
parent52c2575db8faa1d93227a92a32deb2cd66b96614
media: v4l: subdev: Also return pads array information on stream functions

There are two sets of functions that return information from sub-device
state, one for stream-unaware users and another for stream-aware users.
Add support for stream-aware functions to return format, crop and compose
information from pad-based array that are functionally equivalent to the
old, stream-unaware ones.

Also check state is non-NULL, in order to guard against old drivers
potentially calling this with NULL state for active formats or selection
rectangles.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/v4l2-core/v4l2-subdev.c
include/media/v4l2-subdev.h