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.

Few questions on davinci_vpfe.c

Hi.

I'm testing with DM365 to produce dual stream in continuous mode; D1 + VGA.

I can get two YUV420 buffers, but sometimes I met the following logs after Capture_put().

"vpfe ccdc capture vpfe ccdc capture. 1: Second output present"

"vpfe ccdc capture vpfe ccdc capture. 1: capture buffer size is less than required size"

After the second log, the next Capture_get() never returns.

 

Following those logs, i found something i can't understand in davinci_vpfe.c.

1. VIDIOC_S_FMT

common->second_out_img_sz = imp_hw_if->get_line_length(1) * imp_hw_if->get_image_height(1);

second_out_img_sz is 307200 (=640*480). is it right? i think it should be 460800 to hold YUV420 VGA.

2. VIDIOC_QBUF

                if (common->second_out_img_sz)
                    expected_buf_size += common->second_out_img_sz;
                if (tbuf.length < (expected_buf_size + common->second_out_img_sz))
                {
                    mutex_unlock(&common->buffer_queue.  lock);
                    dev_err(vpfe_dev, "capture buffer size is less " "than required size");
                    return -EINVAL;
                }
the above condition considers second_out_img_sz twice. and this condition makes the next Capture_get() blocked.

 

I changed them; second_out_img_sz is set to 460800 and the condition checks second_out_img_sz once.

It seems working fine.

 

And one more question on VIDIOC_QBUF:

           if (!(list_empty(&common->dma_queue)) ||
                (common->curFrm != common->nextFrm) ||
                !(common->started) ||
                (common->started && (0 == channel->field_id))) {
                ret =
                    videobuf_qbuf(&common->buffer_queue,
                          (struct v4l2_buffer *)
                          arg);
                break;
            }

Can i get information for the condition? Especially what does 'common->curFrm != common->nextFrm' mean?

I think normally the condition is true and videobuf_qbuf() is called and completed VIDIOC_QBUF task.

But, when it goes false for some reason, it calls vpfe_buffer_prepare() and it prints "vpfe ccdc capture vpfe ccdc capture. 1: Second output present".

 

I asked TI FAE about those VPFE logs also.

But, in this post, I hope that i can get useful information in code level.

 

Best Regards,

Jinkyu Park