Hi @joanxie,
We have an ISP in our Camera board so the output our board sends in UYVY only.
I have also tried getting few logs and below are they.
[ 33.975283] Inside DWC MIPI CSI2 Get Fmt
[ 33.975299] pad 0 code 0 field 0
[ 33.975304] colorspace 0 width 0 height 0
[ 33.975309] AR1335 pad 0 code 8198 field 1
[ 33.975313] colorspace 8 width 640 height 480
[ 33.975317] Ret value 0
[ 33.975319] pad 0 code 8198 field 1
[ 33.975322] colorspace 8 width 640 height 480
[ 33.975326] csi2h_fmt code 8198 csi2h_fmt reg 25
[ 33.980369] Inside MXC isi cap stream on
[ 33.980389] Config Parm Entry
[ 33.980392] MXC ISI Source Fmt init
[ 33.980395] UYVY_2x8 8198
[ 33.980401] pad 4 code 8198 field 0
[ 33.980404] colorspace 8 width 640 height 480
[ 33.980408] dst_f->fmt->mbus_code: 8198
[ 33.980412] mxc_isi.0: set remote fmt fail! -22
This is prints I have added in those functions
static int dwc_mipi_csi2_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *cfg, struct v4l2_subdev_format *format)
{
struct dwc_mipi_csi2_host *csi2h = sd_to_dwc_mipi_csi2h(sd);
struct v4l2_mbus_framefmt *mf = &csi2h->format;
struct media_pad *source_pad;
struct v4l2_subdev *sen_sd;
struct csi2h_pix_format const *csi2h_fmt;
int ret;
printk("Inside DWC MIPI CSI2 Get Fmt\n");
/* Get remote source pad */
source_pad = dwc_csi2_get_remote_sensor_pad(csi2h);
if (!source_pad) {
v4l2_err(&csi2h->sd, "%s, No remote pad found!\n", __func__);
return -EINVAL;
}
/* Get remote source pad subdev */
sen_sd = dwc_get_remote_subdev(csi2h, __func__);
if (!sen_sd) {
v4l2_err(&csi2h->sd, "%s, No remote subdev found!\n", __func__);
return -EINVAL;
}
format->pad = source_pad->index;
printk("pad %d code %d field %d\n", format->pad, format->format.code, format->format.field);
printk("colorspace %d width %d height %d\n\n", format->format.colorspace, format->format.width, format->format.height);
ret = v4l2_subdev_call(sen_sd, pad, get_fmt, NULL, format);
if (ret < 0) {
v4l2_err(&csi2h->sd, "%s, call get_fmt of subdev failed!\n", __func__);
return ret;
}
printk("Ret value %d\n", ret);
printk("pad %d code %d field %d\n", format->pad, format->format.code, format->format.field);
printk("colorspace %d width %d height %d\n\n", format->format.colorspace, format->format.width, format->format.height);
memcpy(mf, &format->format, sizeof(struct v4l2_mbus_framefmt));
csi2h_fmt = find_csi2h_format(mf->code);
if (!csi2h_fmt) {
printk("Not\n");
csi2h_fmt = &dwc_csi2h_formats[0];
mf->code = csi2h_fmt->code;
}
csi2h->csi2h_fmt = csi2h_fmt;
printk("csi2h_fmt code %d csi2h_fmt reg %d\n\n", csi2h->csi2h_fmt->code, csi2h->csi2h_fmt->fmt_reg);
return 0;
}
This is the prints I have added in my driver
static int ar1335_get_fmt(struct v4l2_subdev *sd,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct v4l2_mbus_framefmt *mf = &format->format;
struct ar1335 *sensor = to_ar1335_dev(client);
int ret = 0;
if (format->pad)
return -EINVAL;
format->format.code = sensor->fmt.code;
format->format.colorspace = sensor->fmt.colorspace;
format->format.field = V4L2_FIELD_NONE;
format->format.width = sensor->pix.width;
format->format.height = sensor->pix.height;
printk("AR1335 pad %d code %d field %d\n", format->pad, format->format.code, format->format.field);
printk("colorspace %d width %d height %d\n\n", format->format.colorspace, format->format.width, format->format.height);
return ret;
}
These are the dmesg logs we get when do stream on with the previously said command.
in imx8-isi-cap.c inside the above said error function am also implementing this
src_fmt.format.code = MEDIA_BUS_FMT_UYVY8_2X8;
before that v4l2_subdev_call.
in dwc-mipi-csi2.c file I have added the below
static const struct csi2h_pix_format dwc_csi2h_formats[] = {
{
.code = MEDIA_BUS_FMT_UYVY8_2X8,
.fmt_reg = 0x19,
}, {
.code = MEDIA_BUS_FMT_UYVY8_1X16,
.fmt_reg = 0x1A,
},
I want to know the fmt_reg val for these as MEDIA_BUS_FMT_UYVY8_2X8 is my format. And by this error [33.980412] mxc_isi.0: set remote fmt fail! -22 where should I concentrate, either in dwc-mipi-csi2.c file as it is the subdev of imx8-isi-cap.c or should I debug on imx8-isi-cap.c.
I don't know what I am missing. Kindly help me to solve it.
Thanks,
Naveen.