iMX6 IPU and driver restrictions for MIPI camera and its resolution

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX6 IPU and driver restrictions for MIPI camera and its resolution

1,177 Views
titusstalin
Contributor V

Hello,

Can you please answer the following questions ?

1) Is there any width and height restriction ?

2) What is the minimum values of width and height ?

3) What is the maximum values of width and height ?

4) What is the step (incremented) values of width and height ?

In imx6 reference manual, page no 2764.

Frame Height -> 1 line to 4096 lines

Frame Width -> 1 pixel to 8192 pixels

For progressive YUV 4:2:0 (non interleaved and
partial interleaved formats) the FH value should
be a multiple of 2.


For interlaced YUV 4:2:0 (non interleaved and
partial interleaved formats) the FH value should
be a multiple of 4.


drivers/media/platform/mxc/capture/mxc_v4l2_capture.c

static int mxc_v4l2_s_fmt(cam_data *cam, struct v4l2_format *f)
{

        /* stride line limitation */
        *width &= ~7;
        *height &= ~7;

        if (*width == 0 || *height == 0) {
            pr_err("ERROR: v4l2 capture: width or height"
                " too small.\n");
            return -EINVAL;
        }

        if ((cam->crop_current.width / *width > 8) ||
            ((cam->crop_current.width / *width == 8) &&
             (cam->crop_current.width % *width))) {
            *width = cam->crop_current.width / 8;
            if (*width % 8)
                *width += 8 - *width % 8;
            pr_err("ERROR: v4l2 capture: width exceeds limit "
                "resize to %d.\n",
                   *width);
        }

        if ((cam->crop_current.height / *height > 8) ||
            ((cam->crop_current.height / *height == 8) &&
             (cam->crop_current.height % *height))) {
            *height = cam->crop_current.height / 8;
            if (*height % 8)
                *height += 8 - *height % 8;
            pr_err("ERROR: v4l2 capture: height exceeds limit "
                   "resize to %d.\n",
                   *height);
        }

drivers/mxc/ipu3/ipu_common.c

int32_t ipu_init_channel_buffer(struct ipu_soc *ipu, ipu_channel_t channel,
                ipu_buffer_t type,
                uint32_t pixel_fmt,
                uint16_t width, uint16_t height,
                uint32_t stride,
                ipu_rotate_mode_t rot_mode,
                dma_addr_t phyaddr_0, dma_addr_t phyaddr_1,
                dma_addr_t phyaddr_2,
                uint32_t u, uint32_t v)
{
    uint32_t reg;
    uint32_t dma_chan;
    uint32_t burst_size;

    dma_chan = channel_2_dma(channel, type);
    if (!idma_is_valid(dma_chan))
        return -EINVAL;

    if (stride < width * bytes_per_pixel(pixel_fmt))
        stride = width * bytes_per_pixel(pixel_fmt);

    if (stride % 4) {
        dev_err(ipu->dev,
            "Stride not 32-bit aligned, stride = %d\n", stride);
        return -EINVAL;
    }

Thanks for your kind support.

Regards,

Titus S.

Labels (3)
0 Kudos
4 Replies

757 Views
art
NXP Employee
NXP Employee

The MIPI CSI2 camera frame width/height values and restrictions are the same as for the parallel CSI input since the MIPI CSI2 to IPU gasket just deserializes the data, coming on its serial lanes, and puts them to the parallel CSI input of the IPU module.


Have a great day,
Artur

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

757 Views
titusstalin
Contributor V

Thanks Artur for your reply.

I won't use IC (image converter) block and using CSI<->MEM channel. (and not CSI<->IC<->MEM)

BTW, I am able to stream the data with 2592x1944 resolution.

But I want to know, is there any restriction on width, height ??

Or I can use any resolution like 1x1, 234x234 etc., ??

What are all the parallel CSI width/height values and restrictions ??

Thanks again for your reply.

I greatly appreciate your help on this.

0 Kudos

757 Views
adc1
Contributor IV

Hi Titus,
if you refer to "Image Converter (IC) section at page 2743, you can see that IPU converter output is limited to 1024x1024 but it can operate a single image slice to convert greater images

https://community.nxp.com/message/312970?commentID=312970#comment-312970 

regards,
Andrea

0 Kudos

757 Views
titusstalin
Contributor V

Thanks Andrea for your reply.

I won't use IC (image converter) block and using CSI<->MEM channel.

Still is there any restriction ?

BTW, I am able to stream the data with 2592x1944 resolution.

But I want to know, is there any restriction on width, height ??

OR any resolution we can use like 1x1, 234x234 etc., ??

Thanks again for your reply.

0 Kudos