OSDN Git Service

media: microchip: microchip-isc: implement media controller
authorEugen Hristev <eugen.hristev@microchip.com>
Mon, 7 Nov 2022 14:18:16 +0000 (16:18 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 18 Nov 2022 14:48:18 +0000 (15:48 +0100)
commit86ff588c9ea47b92bfa99d6d1e466b2573baf51c
treeb16c9cde3194d2187b10bc65d2634869fb6fb21d
parentde32105cbe3c6f334c3ddc5c493efeeb439764be
media: microchip: microchip-isc: implement media controller

As a top MC video driver, the microchip-isc should not propagate the format
to the subdevice, it should rather check at start_streaming() time if the
subdev is properly configured with a compatible format.
Removed the whole format finding logic, and reworked the format
verification at start_streaming time, such that the ISC will return an
error if the subdevice is not properly configured.
To achieve this, media_pipeline_start is called and a link_validate
callback is created to check the formats.
With this being done, the module parameter 'sensor_preferred' makes no
sense anymore. The ISC should not decide which format the sensor is using.
The ISC should only cope with the situation and inform userspace if the
streaming is possible in the current configuration.
The redesign of the format propagation has also risen the question of the
enumfmt callback. If enumfmt is called with an mbus_code, the enumfmt
handler should only return the formats that are supported for this
mbus_code. Otherwise, the enumfmt will report all the formats that the ISC
could output.
With this rework, the dynamic list of user formats is removed. It makes no
more sense to identify at complete time which formats the sensor could
emit, and add those into a separate dynamic list.
The ISC will start with a simple preconfigured default format, and at
link validate time, decide whether it can use the format that is
configured on the sink or not.
From now on, the driver also advertises the IO_MC capability.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/microchip/Kconfig
drivers/media/platform/microchip/microchip-isc-base.c
drivers/media/platform/microchip/microchip-isc-scaler.c
drivers/media/platform/microchip/microchip-isc.h
drivers/media/platform/microchip/microchip-sama5d2-isc.c
drivers/media/platform/microchip/microchip-sama7g5-isc.c