This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

can no dequeue display buffer

Hi,

 

i want read the image from the camera and display it on the LCD through v4l2. But the program hangs while dequeue the display buffer.

 

I think, the problem is the framebuffer size bootargs. If i use only the bootargs below, the LCD works, but i have the descripted problem.

If i add "video=vpbe_fb:vid0=640x480x16,1800K@0,0:vid1=off:osd0=640x480x16,1800K@0,0:osd1=640x480x4,600K@0,0", the LCD don't work and i get some errors:

 

vpfe-capture vpfe-capture: v4l2 device registered

Leopard: switch to VGA imager-MT9V126 video input

mt9v126 1-0048: Detected a MT9V126 chip ID 2281

mt9v126: mt9v126 decoder driver registered !!

vpfe-capture vpfe-capture: v4l2 sub device mt9v126 registered

vpbe-osd vpbe-osd: OSD sub device probe success

vpbe-venc vpbe-venc: VENC sub device probe success

vpbe-v4l2 vpbe-v4l2: vpbe v4l2 device registered

Setting default output to Lcdout

Setting default mode to 320x240p60

vpbe-v4l2 vpbe-v4l2: Trying to register VPBE display device.

vpbe-v4l2 vpbe-v4l2: layer=c499d000,layer->video_dev=c499d0f4

vpbe-v4l2 vpbe-v4l2: Trying to register VPBE display device.

vpbe-v4l2 vpbe-v4l2: layer=c499d200,layer->video_dev=c499d2f4

vpbe-fb vpbe-fb: dm_osd0_fb: Initial window configuration is invalid.

Console: switching to colour frame buffer device 80x30

vpbe-fb vpbe-fb: dm_osd0_fb: 640x480x16@0,0 with framebuffer size 1800KB

vpbe-fb vpbe-fb: dm_vid0_fb: Initial window configuration is invalid.

vpbe-fb vpbe-fb: dm_vid0_fb: 640x480x16@0,0 with framebuffer size 1800KB

vpbe-fb vpbe-fb: dm_osd1_fb: Initial window configuration is invalid.

vpbe-fb vpbe-fb: dm_osd1_fb: 640x480x4@0,0 with framebuffer size 600KB

VPBE FB Driver probe success

DM365 IPIPEIF probed

 

The configuration failed, because of line 1599:

if (mode->xres < var->xres || mode->yres < var->yres)

 

https://github.com/Klaus-schwarzkopf/linux-davinci-sensortherm/blob/9b02bd74f4ebb0d598902a7c5618d73d7d4f6aca/drivers/media/video/davinci/vpbe_fb.c#L1599

 

My setup:

 

 

 

Can you help me?

 

 

Regards,

 

Klaus

  • ,

    Going through the description, looks like LCD supports 320x240p60.

    Klaus Schwarzkopf said:

    I think, the problem is the framebuffer size bootargs. If i use only the bootargs below, the LCD works, but i have the descripted problem.

    If i add "video=vpbe_fb:vid0=640x480x16,1800K@0,0:vid1=off:osd0=640x480x16,1800K@0,0:osd1=640x480x4,600K@0,0", the LCD don't work and i get some errors:

    I believe you cant set 640x480x16 if the display supports only 320x240p60.

    ------------------------------------------------------------------------------------------------------

    For the issue of sensor to LCD loop-back, the driver has a limitation due to shared resource between Digital output controller and Sensor, hence you are seeing the issue. This is the reason why no sensor-LCD loop-back application in arago.

     

  • Hi,

     

    Please check below things as well

    1, See if the enough buffers are enqueued in the display driver as per the requirement of the driver

    2, See if the pixel clock is configured correctly. If it is not, it may not be able to work properly.

    3, Check the /proc/interrupts entry in to see if the interrupts are occuring for the display. If it is, display is sending out the data, but driver is not allowing to dequeue buffers.

     

    Thanks,

    Brijesh Jadav

  • Hi,

    thanks for your helpful hints!

     

    @Brijesh Jadav

    I check your hints, see my next post!

     

    @Nagabhushana

     

    You are right, my mistake!

     

    Buffer size: (320x240x2)/1024 = 150K * 3 buffer = 450K

     

    Configuration 1:

    With this boot parameters: video=vpbe_fb:vid0=320x240x16,450K@0,0:vid1=320x240x16,450K@0,0

     

    * no error at boot time

     

    vpbe-fb vpbe-fb: dm_osd0_fb: 320x240x16@0,0 with framebuffer size 150KB

    vpbe-fb vpbe-fb: dm_vid0_fb: 320x240x16@0,0 with framebuffer size 450KB

    vpbe-fb vpbe-fb: dm_osd1_fb: 320x240x4@0,0 with framebuffer size 150KB

    vpbe-fb vpbe-fb: dm_vid1_fb: 320x240x16@0,0 with framebuffer size 450KB

     

    * LCD shows boot logo

    * can not open /dev/video5 or /dev/video6

     

    # cat /dev/video6 

    vpbe-v4l2 vpbe-v4l2: Display Manager failed to allocate layer

    vpbe-v4l2 vpbe-v4l2: Unable to configure video layer for id = 1

    cat: can't open '/dev/video6': Invalid argument

     

    Configuration 2:

    With this boot parameters: video=vpbe_fb:vid0=320x240x16,450K@0,0:vid1=320x240x16,450K@0,0:osd0=320x240x16,150K@0,0:osd1=320x240x4,150K@0,0

    * no error at boot time

    * no boot logo

    * can not open /dev/video5 or /dev/video6

     

    Configuration 3:

    Without boot parameters:

     

    * no error at boot time

    vpbe-fb vpbe-fb: dm_osd0_fb: 320x240x16@0,0 with framebuffer size 150KB

    vpbe-fb vpbe-fb: dm_vid0_fb: 0x0x16@0,0 with framebuffer size 225KB

    vpbe-fb vpbe-fb: dm_osd1_fb: 320x240x4@0,0 with framebuffer size 150KB

    vpbe-fb vpbe-fb: dm_vid1_fb: 0x0x16@0,0 with framebuffer size 225KB

     

    * LCD shows boot logo

    * can open /dev/video5 or /dev/video6

     

    # /make_media_dev.sh 

    # /mt9v126_ccdc_loopback_mmap 

    media device opened

    4.enumerating media entities

    [1]:81 0 mt9v126

    [2]:81 1 DAVINCI CCDC

    [3]:81 2 DAVINCI VIDEO CCDC output

    [4]:81 3 DAVINCI PREVIEWER

    [5]:81 4 DAVINCI VIDEO PRV input

    [6]:81 5 DAVINCI VIDEO PRV output

    [7]:81 6 DAVINCI RESIZER

    [8]:81 7 DLeopard: switch to VGA imager-MT9V126 video input

    AVINCI VIDEO RSZ input

    [9]:81 8 DAVINCI VIDEO RSZ output

    Leopard: switch to VGA imager-MT9V126 video input

     

    [b]:81 10 DAVINCI AF

    total number of entities: b

    **********************************************

    6. ENABLEing link [MT9V126]----------->[ccdc]

    [MT9V126]----------->[ccdc] ENABLED

    7. ENABLEing link [ccdc]----------->[video_node]

    [ccdc]----------->[video_node] ENABLED

    **********************************************

    5.enumerating links/pads for entities

    pads for entity 1=(0, OUTPUT) 

    [1:0]-------------->[2:0] ACTIVE

     

    pads for entity 2=(0, INPUT) (1, OUTPUT) 

    [2:1]-------------->[3:0] ACTIVE

    [2:1]-------------->[a:0] INACTIVE 

    [2:1]-------------->[b:0] INACTIVE 

    [2:1]-------------->[4:0] INACTIVE 

     

    pads for entity 3=(0, INPUT) 

     

    pads for entity 4=(0, INPUT) (1, OUTPUT) 

    [4:1]-------------->[6:0] INACTIVE 

    [4:1]-------------->[7:0] INACTIVE 

     

    pads for entity 5=(0, OUTPUT) 

    [5:0]-------------->[4:0] INACTIVE 

     

    pads for entity 6=(0, INPUT) 

     

    pads for entity 7=(0, INPUT) (1, OUTPUT) 

    [7:1]-------------->[9:0] INACTIVE 

     

    pads for entity 8=(0, OUTPUT) 

    [8:0]-------------->[7:0] INACTIVE 

     

    pads for entity 9=(0, INPUT) 

     

    pads for entity a=(0, INPUT) 

     

    pads for entity b=(0, INPUT) 

     

    **********************************************

    ccdc device opened

    display device opened

    8. setting format on pad of MT9V126 entity. . .

    successfully format is set on pad 0

    closed mt9v126 sub-device

    9. setting format on sink-pad of ccdc entity. . .

    successfully format is set on pad 0

    10. setting format on OF-pad of ccdc entity. . . 

    successfully format is set on pad 1

    **********************************************

    closed ccdc sub-device

    ccdc_output is video capture device

    ccdc_output does support streaming i/o

    enumerating INPUTS

    [0].Camera

    **********************************************

    setting camera input. . .

    successfully set camera input

    **********************************************

     

    Available image formats at the capture driver :-

    fmt_desc.index = 0

    fmt_desc.type = 1

    fmt_desc.description = 

    fmt_desc.pixelformat = 59565955

     

     

    Force Format: 59565955

     

    Selected image format at the capture driver :-

    fmt.fmt.pix.bytesperline = 1280

    fmt.fmt.pix.width = 640

    fmt.fmt.pix.height = 480

    fmt.fmt.pix.pixelformat = 59565955

     

    VIDIOC_CROPCAP

    setting format V4L2_PIX_FMT_UYVY

    successfully set the format on capture device

    capture_pitch: 500

    **********************************************

    3 buffers are supported for streaming (capture)

    **********************************************

    Querying capture buffers and MMAPing capture

    buffer 0 queried 

    buf length : 614400

    Capture Buffer 0 mapped at address 0x40336000.

    buffer 1 queried 

    buf length : 614400

    Capture Buffer 1 mapped at address 0x4044b000.

    buffer 2 queried 

    buf length : 614400

    Capture Buffer 2 mapped at address 0x4056a000.

    **********************************************

    setting Display output. . . 

    successfully set Display display

    Available image formats at the display driver :-

    fmt_desc.index = 0

    fmt_desc.type = 2

    fmt_desc.description = YUV 4:2:2 - UYVY

    fmt_desc.pixelformat = 59565955

    Test S_FMT display

    display S_FMT successful

    size image : 153600

    Test G_FMT display

    display G_FMT successful

    3. Test GetFormat

    dispheight = 240

    disppitch = 640

    dispwidth = 320

    imagesize = 153600, field 4

    Test REQBUF display

    3 buffers are supported for streaming (display)

    **********************************************

    Querying display buffers and MMAPing 

    buffer 0 queried 

    buf length : 153600

    Display Buffer 0 mapped at address 0x40048000.

    buffer 1 queried 

    buf length : 153600

    Display Buffer 1 mapped at address 0x402c3000.

    buffer 2 queried 

    buf length : 153600

    Display Buffer 2 mapped at address 0x403cc000.

    **********************************************

    Q capture BUF 0---40336000---96000

    Q capture BUF 1---4044b000---96000

    Q capture BUF 2---4056a000---96000

    Q display BUF 0---40048000---25800

    Q display BUF 1---402c3000---25800

    Q display BUF 2---403cc000---25800

    streaming started successfully

    Test STREAMON display

    display STREAMON successful

    Start while...

    Start while... 1

    DQ buffer from capture device

     I2C write failed

     

    quit program with ctrl+c

     

    # cat /proc/interrupts 

               CPU0

      0:        484       AINTC  vpfe_capture0

      1:        484       AINTC  vpfe_capture1

      5:          0       AINTC  Imp_Sdram_Irq

      8:      15037       AINTC  vpbe-v4l2

     16:          0       AINTC  edma

     17:          0       AINTC  edma_error

     26:       1280       AINTC  mmc0

     32:       4042       AINTC  clockevent

     33:          0       AINTC  free-run counter

     39:       4461       AINTC  i2c_davinci

     40:        370       AINTC  serial

     52:          0       AINTC  eth0

     53:      13395       AINTC  eth0

     54:      13467       AINTC  eth0

     55:          0       AINTC  eth0

    Err:          0

    Regards,
    Klaus

  • I am not sure about Configuration 1 and Configuration 2 failing.

    Regarding sensor to LCD loop-back, as I mentioned in earlier reply, there is a issue in driver.  I need to work on patch to fix the same. I don't know when I get time.

  • Brijesh Jadav said:
    1, See if the enough buffers are enqueued in the display driver as per the requirement of the driver

     

    I think, the display driver in drivers/media/video/davinci/vpbe_display.c use 3 buffers and my application use 3 buffers.

     

     

    Brijesh Jadav said:
    2, See if the pixel clock is configured correctly. If it is not, it may not be able to work properly.

     

    What pixel clock do you mean? Which registers?

     

     

    Brijesh Jadav said:
    3, Check the /proc/interrupts entry in to see if the interrupts are occuring for the display. If it is, display is sending out the data, but driver is not allowing to dequeue buffers.

     

    # cat /proc/interrupts 

               CPU0

      0:        484       AINTC  vpfe_capture0

      1:        484       AINTC  vpfe_capture1

      5:          0       AINTC  Imp_Sdram_Irq

      8:      15037       AINTC  vpbe-v4l2

     16:          0       AINTC  edma

     17:          0       AINTC  edma_error

     26:       1280       AINTC  mmc0

     32:       4042       AINTC  clockevent

     33:          0       AINTC  free-run counter

     39:       4461       AINTC  i2c_davinci

     40:        370       AINTC  serial

     52:          0       AINTC  eth0

     53:      13395       AINTC  eth0

     54:      13467       AINTC  eth0

     55:          0       AINTC  eth0

    Err:          0

     

    The interrupts looks ok.

     

     

    Thanks.

     

    Regards,

     

    Klaus

  • Hi,

     

    From the interrupts, it looks like it is outputting data. Can you see if the number of interrupts in /proc/interrupt matches with your fps?

     

    Thanks,

    Brijesh Jadav

     

  • Brijesh Jadav said:
    Can you see if the number of interrupts in /proc/interrupt matches with your fps?

     

    vpbe-v4l2 has 250 interrupts per sec. I think, this is to fast.

    Regards,

    Klaus

  • Klaus Schwarzkopf,

    Can you please try this patch? Since my setup is busy and I don't have application, I could not test it. Let me know what you observe.

    5305.0001-dm36x-fix-cpld-resets-corruption-during-lcd-enabling.patch.zip

     

  • Hi,

     

    This clearly tells that pixel clock is configured to almost four times the required pixel clock. Please look into the display driver and see where it is configuring pixel clock. Please configure it as required for your mode.

     

    But this should not cause hang while dequeuing the buffer. Are you able to dequeue at-least one buffer from the display driver?

     

    thanks,

    Brijesh Jadav

  • Nagabhushana said:

    Can you please try this patch? Since my setup is busy and I don't have application, I could not test it. Let me know what you observe.

    I use the dm365 processor. The patch is for dm368, right?

     

    Brijesh Jadav said:

    But this should not cause hang while dequeuing the buffer. Are you able to dequeue at-least one buffer from the display driver?

    I can no buffer dequeue.

     

  • Which(dm365) revision? I believe rev E and above is called dm368.

  • I'm sorry, for not responding for a long time.

    I use the leopardboard 365 and this board has no CPLD. So your patch can not help me and i can not test it.

    I changed to the PSP 03.01.01.39 with kernel 2.6.32 and it works for me.
    Thanks for your help.
    Regards,
    Klaus