Re: imx6ull capture from OV5640

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Fabio,
On Tue, Jan 05, 2021 at 11:32:29AM -0300, Fabio Estevam wrote:
> On Tue, Jan 5, 2021 at 10:45 AM Fabio Estevam <festevam@xxxxxxxxx> wrote:
> 
> > Just tested against next-20210105 and the original warning happens and
> > csi is no longer probed.
> >
> > I am using the same dtb that worked on 5.4.84.
> >
> > It looks like we have a regression.
> 
> And here is a fix that allows csi to probe:
> https://pastebin.com/raw/g6ijDf2N
> 
> Makes sense?

yup.

> 
> There is another error though: I do not see the message below as seen
> on 5.4 kernel:
> [   10.690711] imx-media: ov5640 1-003c:0 -> csi:0
> 
> And the same pipeline that worked with 5.4 does not work with linux-next:
> 
> # media-ctl -l "'ov5640 1-003c':0 -> 'csi':0[1]"
> media-ctl -l "'csi':1 -> 'csi capture':0[1]"
> media-ctl -v -V "'ov5640 1-003c':0 [fmt:UYVY8_2X8/320x240 field:none]"
> 
> # gst-launch-1.0 -v  v4l2src device=/dev/video1 ! v4l2convert ! fbdevsink
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Pipeline is PREROLLED ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps =
> video/x-raw, format=(string)UYVY, width=(int)320, height=(int)240,
> framerate=(fraction)30000/1001, interlace-mode=(string)progressive,
> colorim
> etry=(string)1:4:7:1
> /GstPipeline:pipeline0/v4l2convert:v4l2convert0.GstPad:src: caps =
> video/x-raw, format=(string)BGRx, width=(int)320, height=(int)240,
> framerate=(fraction)30000/1001, interlace-mode=(string)progressive
> /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0.GstPad:sink: caps =
> video/[  421.495561] alloc_contig_range: [9c480, 9c4a6) PFNs busy
> x-raw, format=(string)BGRx, width=(int)320, height=(int)240, fra[
> 421.504399] alloc_contig_range: [9c480, 9c4a6) PFNs busy
> merate=(fraction)30000/1001, interlace-mode=(string)progressive
> /GstPipeline:pipeline0/v4l2convert:v4l2convert0.GstPad:sink: c[
> 421.520989] alloc_contig_range: [9c480, 9c4a6) PFNs busy
> aps = video/x-raw, format=(string)UYVY, width=(int)320, height=([
> 421.533523] csi: pipeline start failed with -19
> int)240, framerate=(fraction)30000/1001,
> interlace-mode=(string)progressive, colorimetry=(string)1:4:7:1
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed
> to allocate required memory.
> Additional debug info:
> ../sys/v4l2/gstv4l2src.c(659): gst_v4l2src_decide_allocation ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> Buffer pool activation failed
> Execution ended after 0:00:00.106613417
> Setting pipeline to NULL ...
> Freeing pipeline ...
> #
> 
> Any ideas?

can you see if the following patch make it work again?


8<----------------------------------------------------

diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c
index a3f3df901704..fa8db9f1cfc8 100644
--- a/drivers/staging/media/imx/imx7-media-csi.c
+++ b/drivers/staging/media/imx/imx7-media-csi.c
@@ -499,6 +499,7 @@ static int imx7_csi_pad_link_validate(struct v4l2_subdev *sd,
                                      struct v4l2_subdev_format *sink_fmt)
 {
        struct imx7_csi *csi = v4l2_get_subdevdata(sd);
+       struct media_entity *src;
        struct media_pad *pad;
        int ret;
 
@@ -509,11 +510,21 @@ static int imx7_csi_pad_link_validate(struct v4l2_subdev *sd,
        if (!csi->src_sd)
                return -EPIPE;
 
+       src = &csi->src_sd->entity;
+
+       /*
+        * if the source is neither a mux or csi2 get the one directly upstream
+        * from this csi
+        */
+       if (src->function != MEDIA_ENT_F_VID_IF_BRIDGE &&
+           src->function != MEDIA_ENT_F_VID_MUX)
+               src = &csi->sd.entity;
+
        /*
         * find the entity that is selected by the CSI mux. This is needed
         * to distinguish between a parallel or CSI-2 pipeline.
         */
-       pad = imx_media_pipeline_pad(&csi->src_sd->entity, 0, 0, true);
+       pad = imx_media_pipeline_pad(src, 0, 0, true);
        if (!pad)
                return -ENODEV;

> 
> Thanks



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux