Hi all,
I want to get the output of the sensor connected to MIPI ch-0 of the i.MX8MPlus EVK board.
MIPI format is as follows
And I use following v4l2 command.
v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=sample.raw --stream-count=1
The sensor output is random pattern on the entire screen (666x741 [pixel]).
So random value should be stored to every pixel, but the value is 0 after x = 250. (See sample.png)
Please let me know if there are any missing settings.
The register settings that are considered necessary for MEDIABLK and ISI are described below.
Best regards,
已解决! 转到解答。
I checked the bsp source code, current bsp doesn't support raw 12
so try to add raw format in the driver
struct mxc_isi_fmt mxc_isi_out_formats[] = {
.memplanes = 1,
.colplanes = 1,
.mbus_code = MEDIA_BUS_FMT_RGB888_1X24,
+ }, {
+ .name = "RAW12",
+ .fourcc = V4L2_PIX_FMT_SBGGR12,
+ .depth = { 16 },
+ .color = MXC_ISI_OUT_FMT_RAW16,
+ .memplanes = 1,
+ .colplanes = 1,
+ .mbus_code = MEDIA_BUS_FMT_SBGGR12_1X12,
}
};
struct mxc_isi_fmt mxc_isi_src_formats[] = {
.depth = { 32 },
.memplanes = 1,
.colplanes = 1,
+ }, {
+ .name = "RAW12",
+ .fourcc = V4L2_PIX_FMT_SBGGR12,
+ .depth = { 12 },
+ .memplanes = 1,
+ .colplanes = 1,
}
};
struct mxc_isi_fmt *mxc_isi_get_src_fmt(struct v4l2_subdev_format *sd_fmt)
sd_fmt->format.code == MEDIA_BUS_FMT_YVYU8_2X8 ||
sd_fmt->format.code == MEDIA_BUS_FMT_AYUV8_1X32 ||
sd_fmt->format.code == MEDIA_BUS_FMT_UYVY8_2X8 ||
- sd_fmt->format.code == MEDIA_BUS_FMT_YUYV8_2X8)
- index = 1;
- else
- index = 0;
+ sd_fmt->format.code == MEDIA_BUS_FMT_YUYV8_2X8) {
+ index = 1;
+ } else if (sd_fmt->format.code == MEDIA_BUS_FMT_ARGB8888_1X32 ||
+ sd_fmt->format.code == MEDIA_BUS_FMT_RGB888_1X24 ||
+ sd_fmt->format.code == MEDIA_BUS_FMT_BGR888_1X24 ||
+ sd_fmt->format.code == MEDIA_BUS_FMT_RGB565_1X16) {
+ index = 0;
+ } else {
+ index = 2;
+ }
return &mxc_isi_src_formats[index];
}
I checked the bsp source code, current bsp doesn't support raw 12
so try to add raw format in the driver
struct mxc_isi_fmt mxc_isi_out_formats[] = {
.memplanes = 1,
.colplanes = 1,
.mbus_code = MEDIA_BUS_FMT_RGB888_1X24,
+ }, {
+ .name = "RAW12",
+ .fourcc = V4L2_PIX_FMT_SBGGR12,
+ .depth = { 16 },
+ .color = MXC_ISI_OUT_FMT_RAW16,
+ .memplanes = 1,
+ .colplanes = 1,
+ .mbus_code = MEDIA_BUS_FMT_SBGGR12_1X12,
}
};
struct mxc_isi_fmt mxc_isi_src_formats[] = {
.depth = { 32 },
.memplanes = 1,
.colplanes = 1,
+ }, {
+ .name = "RAW12",
+ .fourcc = V4L2_PIX_FMT_SBGGR12,
+ .depth = { 12 },
+ .memplanes = 1,
+ .colplanes = 1,
}
};
struct mxc_isi_fmt *mxc_isi_get_src_fmt(struct v4l2_subdev_format *sd_fmt)
sd_fmt->format.code == MEDIA_BUS_FMT_YVYU8_2X8 ||
sd_fmt->format.code == MEDIA_BUS_FMT_AYUV8_1X32 ||
sd_fmt->format.code == MEDIA_BUS_FMT_UYVY8_2X8 ||
- sd_fmt->format.code == MEDIA_BUS_FMT_YUYV8_2X8)
- index = 1;
- else
- index = 0;
+ sd_fmt->format.code == MEDIA_BUS_FMT_YUYV8_2X8) {
+ index = 1;
+ } else if (sd_fmt->format.code == MEDIA_BUS_FMT_ARGB8888_1X32 ||
+ sd_fmt->format.code == MEDIA_BUS_FMT_RGB888_1X24 ||
+ sd_fmt->format.code == MEDIA_BUS_FMT_BGR888_1X24 ||
+ sd_fmt->format.code == MEDIA_BUS_FMT_RGB565_1X16) {
+ index = 0;
+ } else {
+ index = 2;
+ }
return &mxc_isi_src_formats[index];
}
While reviewing the settings, I have two additional questions.
Best regards,