Hi Krzysztof, On Fri, Oct 07, 2022 at 06:57:19AM +0200, Krzysztof Hałasa wrote: > Laurent Pinchart writes: > > > This matches the driver implementation of .set_fmt(), but that's because > > the driver is *really* wrong :-( It uses the format to configure the > > crop rectangle, which is not right. This needs to be fixed. > > How should it work? The crop rectangle should be configured using .set_selection() ([1]). Following the V4L2 subdev API to the latter, the pad format exposed by the subdev should then be identical to the crop rectangle size. Many sensor drivers however use .set_fmt() to configure binning or skipping (after cropping), which in theory should be done by exposing a second subdev (the CCS driver does that for instance, to my knowledge it's the only sensor driver compliant with [1]). This is an area that requires improvements in the API, the topic was on the agenda of the media summit we held at the ELC-E conference a few weeks ago. [1] https://linuxtv.org/downloads/v4l-dvb-apis/userspace-api/v4l/dev-subdev.html#types-of-selection-targets -- Regards, Laurent Pinchart