media: rp1: cfe: Fix width & height in cfe_start_channel()
The logic for handling width & height in cfe_start_channel() is somewhat
odd and, afaics, broken. The code reads:
bool start_fe = is_fe_enabled(cfe) &&
test_all_nodes(cfe, NODE_ENABLED, NODE_STREAMING);
if (start_fe || is_image_output_node(node)) {
width = node->fmt.fmt.pix.width;
height = node->fmt.fmt.pix.height;
}
cfe_start_channel() is called for all video nodes that will be used. So
this means that if, say, fe_stats is enabled as the last node, start_fe
will be true, and width and height will be taken from fe_stats' node.
The width and height will thus contain garbage, which then gets
programmed to the csi2 registers.
It seems that this often still works fine, though, probably if the width
& height are large enough.
Drop the above code, and instead get the width & height from the csi2
subdev's sink pad for the csi2 channel that is used. For metadata the
width & height will be 0 as before.
Signed-off-by:
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Loading
Please register or sign in to comment