width = source_fmt->width;
height = source_fmt->height;
+ /* Must have a valid CSI2 datatype. */
+ WARN_ON(!fmt->csi_dt);
+
/*
* Start the associated CSI2 Channel as well.
*
node_desc[node->id].link_pad - CSI2_NUM_CHANNELS);
fmt = find_format_by_code(source_fmt->code);
+ /* Must have a valid CSI2 datatype. */
+ WARN_ON(!fmt->csi_dt);
+
if (is_image_output_node(node)) {
width = source_fmt->width;
height = source_fmt->height;
if (is_image_output_node(node)) {
struct v4l2_pix_format *pix_fmt = &node->fmt.fmt.pix;
- const struct cfe_fmt *fmt;
+ const struct cfe_fmt *fmt = NULL;
+ unsigned int i;
if (source_fmt->width != pix_fmt->width ||
source_fmt->height != pix_fmt->height) {
goto out;
}
- fmt = find_format_by_code(source_fmt->code);
- if (!fmt || fmt->fourcc != pix_fmt->pixelformat) {
+ for (i = 0; i < ARRAY_SIZE(formats); i++) {
+ if (formats[i].code == source_fmt->code &&
+ formats[i].fourcc == pix_fmt->pixelformat) {
+ fmt = &formats[i];
+ break;
+ }
+ }
+ if (!fmt) {
cfe_err("Format mismatch!\n");
ret = -EINVAL;
goto out;