ioctl(fd, VIDIOC_DQBUF, &buf) in mx8_v4l2_cap_drm.c is returning fail(negative value)

cancel
Showing results for 
Search instead for 
Did you mean: 

ioctl(fd, VIDIOC_DQBUF, &buf) in mx8_v4l2_cap_drm.c is returning fail(negative value)

451 Views
mallibeerala
Contributor III

Hi,

I am working on I.MX8QM board, now I am trying to implement V4L2 drivers.

ioctl(fd, VIDIOC_DQBUF, &buf) is calling in mx8_v4l2_cap_drm.c, As per my understanding ioctl is implemented in mxc-isi-cap.c and it is returned negative value.

Please suggest us to resolve this Issue.

Thanks & Regards,
Mallikarjuna B.

0 Kudos
6 Replies

448 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Mallikarjuna

 

one can try to attach sensor to board, for example OV5640 MIPI CSI board (mini SAS)

https://www.nxp.com/part/MINISASTOCSI#/

with imx8qm-mek-ov5640.dts

https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8qm-mek-o...

Use function print_help()

https://source.codeaurora.org/external/imx/imx-test/tree/test/mxc_v4l2_test/mx8_v4l2_cap_drm.c?h=lf-...

 

Best regards
igor

0 Kudos

442 Views
mallibeerala
Contributor III

Hi,

We connected MIPI camera to J10 port of I.MX8QM board, we could able to see picture on HDMI port(J6) by running camera drm application, Now Instead of camera we are connected, video ADC board, which is supplying video data in MIPI format. Now we are facing this Issue.

Q1. How can I know data is reached to I.MX-CSI2 port, any status register is available in CSI2-IP or any debug info.

Thanks & Regards,
Mallikarjuna B. 

 

0 Kudos

436 Views
igorpadykov
NXP TechSupport
NXP TechSupport

one can dump the STS registers to check errors:

 

static irqreturn_t mxc_isi_irq_handler(int irq, void *priv)
{
 struct mxc_isi_dev *mxc_isi = priv;
 struct device *dev = &mxc_isi->pdev->dev;
 u32 status;

 spin_lock(&mxc_isi->slock);

 status = mxc_isi_get_irq_status(mxc_isi);
+ printk("STS = 0x%x\n", status);
 mxc_isi_clean_irq_status(mxc_isi, status);

 if (status & CHNL_STS_FRM_STRD_MASK) {

 

Best regards
igor

0 Kudos

427 Views
mallibeerala
Contributor III

Hi,

I am getting status data "STS = 0x60008200 & STS = 0x60008100" coming continuously when I am giving input video signal from my video decoder board, when I disconnected input video signal to I.MX board status data is not coming.

Whether MIPI data is reaching to I.MX board or not, please confirm.

Thanks & Regards,
Mallikarjuna B.

0 Kudos

422 Views
igorpadykov
NXP TechSupport
NXP TechSupport

>Whether MIPI data is reaching to I.MX board or not, please confirm.

 

yes as from "STS = 0x60008200 & STS = 0x60008100", BUF1,2_ACTIVE

Current frame being stored in Buffer 1,2, based on description in sect.15.6.1.5.1.7 Channel Status Register (CHNL_STS)    i.MX 8QuadMax Applications Processor Reference Manual

In general may be recommended to check "hs_settle", this setting should follow MIPI CSI2 clock frequency of the camera module.

https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/imx8/mxc-mipi-csi2_...

Also recommended to recheck video ADC specification, verify that output format is
supported by the i.MX8QM MIPI-CSI module.

 

Best regards
igor

0 Kudos

366 Views
mallibeerala
Contributor III

Hi,

We are giving 60Hz frame rate video data to CSI2 in MIPI format(YUV422 16bit & resolution as 1600x900), I am setting timeperframe.denominator value as 30fps in g_parm function. still I am getting STS as below and screen going to black color, continuous interrupt handler is invoked.

[ 52.491245] STS = 0x60008200
.[ 52.507911] STS = 0x60008100
.[ 52.524578] STS = 0x60008200
.[ 52.541244] STS = 0x60008100
.[ 52.559562] STS = 0x60008200
.[ 52.574579] STS = 0x60008100
.[ 52.591244] STS = 0x60008200
.[ 52.609562] STS = 0x60008100
.[ 52.624577] STS = 0x60008200
.[ 52.641243] STS = 0x60008100
.[ 52.657910] STS = 0x60008200
.[ 52.674577] STS = 0x60008100
.[ 52.694523] STS = 0x60000200
.[ 52.724575] STS = 0x6000c100
.[ 52.741242] STS = 0x60008200
.[ 52.757908] STS = 0x60008100

As per STS data following error I am getting, Please help us to resolve this Issue.

mallibeerala_0-1638276964961.png

Thanks & Regards,
Mallikarjuna B.

0 Kudos