mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
media: nxp: imx8-isi: Allow num_sources to be greater than num_sink
Allow num_sources (drvdata: num_channels) to be greater than num_sink (drvdata: num_ports + 1). ISI support stream multiplexing, such as differentiates multiple cameras from a single 2-lane MIPI input, or duplicates input stream into multiple outputs. So num_channels may be greater than num_ports at some platform. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20250522-8qxp_camera-v5-2-d4be869fdb7e@nxp.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
parent
c4891010d8
commit
2021b8d51c
|
|
@ -188,11 +188,12 @@ static int mxc_isi_crossbar_init_state(struct v4l2_subdev *sd,
|
|||
* Create a 1:1 mapping between pixel link inputs and outputs to
|
||||
* pipelines by default.
|
||||
*/
|
||||
routes = kcalloc(xbar->num_sources, sizeof(*routes), GFP_KERNEL);
|
||||
routing.num_routes = min(xbar->num_sinks - 1, xbar->num_sources);
|
||||
routes = kcalloc(routing.num_routes, sizeof(*routes), GFP_KERNEL);
|
||||
if (!routes)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < xbar->num_sources; ++i) {
|
||||
for (i = 0; i < routing.num_routes; ++i) {
|
||||
struct v4l2_subdev_route *route = &routes[i];
|
||||
|
||||
route->sink_pad = i;
|
||||
|
|
@ -200,7 +201,6 @@ static int mxc_isi_crossbar_init_state(struct v4l2_subdev *sd,
|
|||
route->flags = V4L2_SUBDEV_ROUTE_FL_ACTIVE;
|
||||
}
|
||||
|
||||
routing.num_routes = xbar->num_sources;
|
||||
routing.routes = routes;
|
||||
|
||||
ret = __mxc_isi_crossbar_set_routing(sd, state, &routing);
|
||||
|
|
@ -451,7 +451,7 @@ int mxc_isi_crossbar_init(struct mxc_isi_dev *isi)
|
|||
* the memory input.
|
||||
*/
|
||||
xbar->num_sinks = isi->pdata->num_ports + 1;
|
||||
xbar->num_sources = isi->pdata->num_ports;
|
||||
xbar->num_sources = isi->pdata->num_channels;
|
||||
num_pads = xbar->num_sinks + xbar->num_sources;
|
||||
|
||||
xbar->pads = kcalloc(num_pads, sizeof(*xbar->pads), GFP_KERNEL);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user