AnsweredAssumed Answered

iMX6 IPU and driver restrictions for MIPI camera and its resolution

Question asked by Titus Stalin on Mar 27, 2017
Latest reply on Mar 30, 2017 by Titus Stalin

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.

Outcomes