Welcome! Log In Create A New Profile

Advanced

[Wandcam ov5640] Can't use high resolution modes with width and height biggers than 1024.

Posted by Boadrius 
Hi everybody,

Few days ago, I've been playing with a WandCam (Sensor OmniVision OV5460) and with my Wandboard Solo's target (Freescale i.MX6 Solo). I've been using a 3.10.17-1.0.0 Kernel and all the modules of ov5640 CCD are installed correctly.
I'm trying to develop a program to take some captures from my Wandcam using v4l2, high resolution and RAW format. The matter is when I change the height of the capture to any mode bigger than 1024, like 6 mode, I've found this problem in dmesg:

imx-ipuv3 2400000.ipu: IC output size(1944) cannot exceed 1024

All the modes that ov5640_mipi.c can work are:

enum ov5640_mode {
	ov5640_mode_MIN = 0,
	ov5640_mode_VGA_640_480 = 0,
	ov5640_mode_QVGA_320_240 = 1,
	ov5640_mode_NTSC_720_480 = 2,
	ov5640_mode_PAL_720_576 = 3,
	ov5640_mode_720P_1280_720 = 4,
	ov5640_mode_1080P_1920_1080 = 5,
	ov5640_mode_QSXGA_2592_1944 = 6,
	ov5640_mode_QCIF_176_144 = 7,
	ov5640_mode_XGA_1024_768 = 8,
	ov5640_mode_MAX = 8,
	ov5640_mode_INIT = 0xff, /*only for sensor init*/
};


And the function that launchs the message is found in ipu_ic.c, and it's called _calc_resize_coeffs(...)

static int _calc_resize_coeffs(struct ipu_soc *ipu,
				uint32_t inSize, uint32_t outSize,
				uint32_t *resizeCoeff,
				uint32_t *downsizeCoeff)
{
	uint32_t tempSize;
	uint32_t tempDownsize;

	if (inSize > 4096) {
		dev_err(ipu->dev, "IC input size(%d) cannot exceed 4096\n",
			inSize);
		return -EINVAL;
	}
	/*
	 *  ----- THE PROBLEM IS HERE!   ----- 
	 */
	 
	if (outSize > 1024) {
		dev_err(ipu->dev, "IC output size(%d) cannot exceed 1024\n",
			outSize);
		return -EINVAL;
	}

	if ((outSize << 3) < inSize) {
		dev_err(ipu->dev, "IC cannot downsize more than 8:1\n"winking smiley;
		return -EINVAL;
	}

	/* Compute downsizing coefficient */
	/* Output of downsizing unit cannot be more than 1024 */
	tempDownsize = 0;
	tempSize = inSize;
	while (((tempSize > 1024) || (tempSize >= outSize * 2)) &&
	       (tempDownsize < 2)) {
		tempSize >>= 1;
		tempDownsize++;
	}
	*downsizeCoeff = tempDownsize;

	/* compute resizing coefficient using the following equation:
	   resizeCoeff = M*(SI -1)/(SO - 1)
	   where M = 2^13, SI - input size, SO - output size    */
	*resizeCoeff = (8192L * (tempSize - 1)) / (outSize - 1);
	if (*resizeCoeff >= 16384L) {
		dev_err(ipu->dev, "Overflow on IC resize coefficient.\n"winking smiley;
		return -EINVAL;
	}

	dev_dbg(ipu->dev, "resizing from %u -> %u pixels, "
		"downsize=%u, resize=%u.%lu (reg=%u)\n", inSize, outSize,
		*downsizeCoeff, (*resizeCoeff >= 8192L) ? 1 : 0,
		((*resizeCoeff & 0x1FFF) * 10000L) / 8192L, *resizeCoeff);

	return 0;
}


So I can't work with those modes biggers than 1024 :s Anybody knows why? I don't understant what's the meaning of outSize and inSize parameters, and why this function reduces the values of widht and height.

If anybody can explain me I'll be very grateful grinning smiley

Thank you so much!
Boadrius
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 13 plus 25?
Message: