#define RK_CAM_NUM 6
#define RK29_CAM_SUPPORT_NUMS RK_CAM_NUM
-#define RK_CAM_SUPPORT_RESOLUTION 0x500000
+#define RK_CAM_SUPPORT_RESOLUTION 0x800000
/*---------------- Camera Sensor Must Define Macro Begin ------------------------*/
#define RK29_CAM_SENSOR_OV7675 ov7675
#define RK29_CAM_SENSOR_OV9650 ov9650
#define ov3640_FULL_RESOLUTION 0x300000 // 3 megapixel
#define ov3660_FULL_RESOLUTION 0x300000 // 3 megapixel
#define ov5640_FULL_RESOLUTION 0x500000 // 5 megapixel
-#define ov5642_FULL_RESOLUTION 0x500000 // 5 megapixel
+#if defined(CONFIG_SOC_CAMERA_OV5642_INTERPOLATION_8M)
+ #define ov5642_FULL_RESOLUTION 0x800000 // 8 megapixel
+#else
+ #define ov5642_FULL_RESOLUTION 0x500000 // 5 megapixel
+#endif
#define s5k6aa_FULL_RESOLUTION 0x130000 // 1.3 megapixel
#define mt9d112_FULL_RESOLUTION 0x200000 // 2 megapixel
#define mt9d113_FULL_RESOLUTION 0x200000 // 2 megapixel
#endif\r
\r
//CIF 0\r
-#if (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x500000)\r
+#if (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x800000) /* ddl@rock-chips.com : It is only support 5Mega interplate to 8Mega */\r
+#define PMEM_CAM_NECESSARY_CIF_0 0x1900000 /* 1280*720*1.5*4(preview) + 12M(capture raw) + 7M(jpeg encode output) */\r
+#define PMEM_CAMIPP_NECESSARY_CIF_0 0x800000\r
+#elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x500000)\r
#define PMEM_CAM_NECESSARY_CIF_0 0x1400000 /* 1280*720*1.5*4(preview) + 7.5M(capture raw) + 4M(jpeg encode output) */\r
#define PMEM_CAMIPP_NECESSARY_CIF_0 0x800000\r
#elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x300000)\r
#endif\r
\r
//CIF 1\r
-#if (PMEM_SENSOR_FULL_RESOLUTION_CIF_1 == 0x500000)\r
+#if (PMEM_SENSOR_FULL_RESOLUTION_CIF_1 == 0x800000) /* ddl@rock-chips.com : It is only support 5Mega interplate to 8Mega */\r
+#define PMEM_CAM_NECESSARY_CIF_1 0x1900000 /* 1280*720*1.5*4(preview) + 12M(capture raw) + 7M(jpeg encode output) */\r
+#define PMEM_CAMIPP_NECESSARY_CIF_1 0x800000\r
+#elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_1 == 0x500000)\r
#define PMEM_CAM_NECESSARY_CIF_1 0x1400000 /* 1280*720*1.5*4(preview) + 7.5M(capture raw) + 4M(jpeg encode output) */\r
#define PMEM_CAMIPP_NECESSARY_CIF_1 0x800000\r
#elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_1 == 0x300000)\r
bool "OV5642 user defined init series"
default n
+config SOC_CAMERA_OV5642_INTERPOLATION
+ bool "support sensor interpolation for higher resolution"
+ depends on SOC_CAMERA_OV5642
+choice
+ prompt "OV5642 interpolation resolution"
+ depends on SOC_CAMERA_OV5642_INTERPOLATION
+ default SOC_CAMERA_OV5642_INTERPOLATION_8M
+ ---help---
+ OV5642 interpolation resolution
+
+config SOC_CAMERA_OV5642_INTERPOLATION_8M
+ bool "8 megapixel 3264x2448"
+endchoice
+
choice
prompt "OV5642 Module Focus select"
depends on SOC_CAMERA_OV5642
config SOC_CAMERA_GC0308_INTERPOLATION
bool "support sensor interpolation for higher resolution"
depends on SOC_CAMERA_GC0308
-
-config SOC_CAMERA_GC0308_INTERPOLATION_2M
- bool "sensor interpolation 2 megapixel 1600x1200"
+choice
+ prompt "GC0308 interpolation resolution"
depends on SOC_CAMERA_GC0308_INTERPOLATION
- help
- 0x200000 2 megapixel 1600x1200
+ default SOC_CAMERA_GC0308_INTERPOLATION_1M
+ ---help---
+ GC0308 interpolation resolution
+config SOC_CAMERA_GC0308_INTERPOLATION_1M
+ bool "1 megapixel 1024x768"
+config SOC_CAMERA_GC0308_INTERPOLATION_2M
+ bool "2 megapixel 1600x1200"
config SOC_CAMERA_GC0308_INTERPOLATION_3M
- bool "sensor interpolation 3 megapixel 2048x1536"
- depends on SOC_CAMERA_GC0308_INTERPOLATION
- help
- 0x300000 3 megapixel 2048x1536
-
-config SOC_CAMERA_GC0308_INTERPOLATION_5M
- bool "sensor interpolation 5 megapixel 2592x1944"
- depends on SOC_CAMERA_GC0308_INTERPOLATION
- help
- 0x500000 5 megapixel 2592x1944
+ bool "3 megapixel 2048x1536"
+endchoice
config SOC_CAMERA_GC0309
tristate "GC0309 support for rockchip"
bool "support sensor interpolation for higher resolution"
depends on SOC_CAMERA_HI253
-config SOC_CAMERA_HI253_INTERPOLATION_3M
- bool "sensor interpolation 3 megapixel 2048x1536"
+choice
+ prompt "HI253 interpolation resolution"
depends on SOC_CAMERA_HI253_INTERPOLATION
- help
- 0x300000 3 megapixel 2048x1536
-
+ default SOC_CAMERA_HI253_INTERPOLATION_3M
+ ---help---
+ HI253 interpolation resolution
+
+config SOC_CAMERA_HI253_INTERPOLATION_3M
+ bool "3 megapixel 2048x1536"
config SOC_CAMERA_HI253_INTERPOLATION_5M
- bool "sensor interpolation 5 megapixel 2592x1944"
- depends on SOC_CAMERA_HI253_INTERPOLATION
- help
- 0x500000 5 megapixel 2592x1944
+ bool "5 megapixel 2592x1944"
+endchoice
config SOC_CAMERA_HI704
tristate "HI704 support for rockchip"
#define SENSOR_ID 0x9b
#define SENSOR_MIN_WIDTH 640//176
#define SENSOR_MIN_HEIGHT 480//144
+#define SENSOR_MAX_WIDTH_REAL 640
+#define SENSOR_MAX_HEIGHT_REAL 480
#if defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_5M)
#define SENSOR_MAX_WIDTH 2592
#define SENSOR_MAX_HEIGHT 1944
#define SENSOR_MAX_WIDTH 1600
#define SENSOR_MAX_HEIGHT 1200
#else
- #define SENSOR_MAX_WIDTH 640
- #define SENSOR_MAX_HEIGHT 480
+ #define SENSOR_MAX_WIDTH SENSOR_MAX_WIDTH_REAL
+ #define SENSOR_MAX_HEIGHT SENSOR_MAX_HEIGHT_REAL
#endif
#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */
#define SENSOR_INIT_HEIGHT 480
set_w = 1280;
set_h = 1024;
}
-#if defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_2M)||defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_3M) || defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_5M)
- else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) )
+#if defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION)
+ else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) )
{
- winseqe_set_addr = sensor_vga;
- set_w = 640;
- set_h = 480;
+ winseqe_set_addr = sensor_vga;
+ set_w = SENSOR_MAX_WIDTH_REAL;
+ set_h = SENSOR_MAX_HEIGHT_REAL;
}
#endif
mf->code = fmt->code;
}
+ /* ddl@rock-chips.com : It is query max resolution only. */
+ if (mf->reserved[6] == 0xfefe5a5a) {
+ mf->height = SENSOR_MAX_HEIGHT;
+ mf->width = SENSOR_MAX_WIDTH;
+ ret = 0;
+ goto sensor_try_fmt_end;
+ }
+
if (mf->height > SENSOR_MAX_HEIGHT)
mf->height = SENSOR_MAX_HEIGHT;
else if (mf->height < SENSOR_MIN_HEIGHT)
set_w = 1280;
set_h = 1024;
}
-#if defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_2M)||defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_3M) || defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_5M)
- else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) )
+#if defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION)
+ else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) )
{
- set_w = 640;
- set_h = 480;
+ set_w = SENSOR_MAX_WIDTH_REAL;
+ set_h = SENSOR_MAX_HEIGHT_REAL;
}
#endif
mf->height = set_h;
mf->colorspace = fmt->colorspace;
-
+sensor_try_fmt_end:
return ret;
}
#define SENSOR_ID 0x92
#define SENSOR_MIN_WIDTH 176
#define SENSOR_MIN_HEIGHT 144
+#define SENSOR_MAX_WIDTH_REAL 1600
+#define SENSOR_MAX_HEIGHT_REAL 1200
#if defined(CONFIG_SOC_CAMERA_HI253_INTERPOLATION_5M)
#define SENSOR_MAX_WIDTH 2592
#define SENSOR_MAX_HEIGHT 1944
#define SENSOR_MAX_WIDTH 2048
#define SENSOR_MAX_HEIGHT 1536
#else
- #define SENSOR_MAX_WIDTH 1600
- #define SENSOR_MAX_HEIGHT 1200
+ #define SENSOR_MAX_WIDTH SENSOR_MAX_WIDTH_REAL
+ #define SENSOR_MAX_HEIGHT SENSOR_MAX_HEIGHT_REAL
#endif
#define SENSOR_INIT_WIDTH 1600 /* Sensor pixel size for sensor_init_data array */
set_w = 1600;
set_h = 1200;
}
-#if defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_3M) || defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_5M)
+#if defined(CONFIG_SOC_CAMERA_HI253_INTERPOLATION)
else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) )
{
- winseqe_set_addr = sensor_uxga;
- set_w = 1600;
- set_h = 1200;
+ winseqe_set_addr = sensor_uxga;
+ set_w = SENSOR_MAX_WIDTH_REAL;
+ set_h = SENSOR_MAX_HEIGHT_REAL;
}
#endif
else
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct sensor *sensor = to_sensor(client);
const struct sensor_datafmt *fmt;
- int ret = 0;
+ int ret = 0,set_w,set_h;;
fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts,
ARRAY_SIZE(sensor_colour_fmts));
mf->code = fmt->code;
}
+ /* ddl@rock-chips.com : It is query max resolution only. */
+ if (mf->reserved[6] == 0xfefe5a5a) {
+ mf->height = SENSOR_MAX_HEIGHT;
+ mf->width = SENSOR_MAX_WIDTH;
+ ret = 0;
+ goto sensor_try_fmt_end;
+ }
+
if (mf->height > SENSOR_MAX_HEIGHT)
mf->height = SENSOR_MAX_HEIGHT;
else if (mf->height < SENSOR_MIN_HEIGHT)
mf->width = SENSOR_MAX_WIDTH;
else if (mf->width < SENSOR_MIN_WIDTH)
mf->width = SENSOR_MIN_WIDTH;
+
+ set_w = mf->width;
+ set_h = mf->height;
- mf->colorspace = fmt->colorspace;
+ if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg)
+ {
+ set_w = 176;
+ set_h = 144;
+ }
+ else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg)
+ {
+ set_w = 320;
+ set_h = 240;
+ }
+ else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg)
+ {
+ set_w = 352;
+ set_h = 288;
+ }
+ else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg)
+ {
+ set_w = 640;
+ set_h = 480;
+ }
+ else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg)
+ {
+ set_w = 800;
+ set_h = 600;
+ }
+ else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg)
+ {
+ set_w = 1280;
+ set_h = 1024;
+ }
+#if defined(CONFIG_SOC_CAMERA_HI253_INTERPOLATION)
+ else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) )
+ {
+ set_w = SENSOR_MAX_WIDTH_REAL;
+ set_h = SENSOR_MAX_HEIGHT_REAL;
+ }
+#endif
+
+ else
+ {
+ set_w = SENSOR_INIT_WIDTH;
+ set_h = SENSOR_INIT_HEIGHT;
+ }
+
+ mf->width = set_w;
+ mf->height = set_h;
+ mf->colorspace = fmt->colorspace;
+sensor_try_fmt_end:
return ret;
}
#define SENSOR_ID 0x5642
#define SENSOR_MIN_WIDTH 176
#define SENSOR_MIN_HEIGHT 144
-#define SENSOR_MAX_WIDTH 2592
-#define SENSOR_MAX_HEIGHT 1944
+#define SENSOR_MAX_WIDTH_REAL 2592
+#define SENSOR_MAX_HEIGHT_REAL 1944
+#if defined(CONFIG_SOC_CAMERA_OV5642_INTERPOLATION_8M)
+#define SENSOR_MAX_WIDTH 3264
+#define SENSOR_MAX_HEIGHT 2448
+#else
+#define SENSOR_MAX_WIDTH SENSOR_MAX_WIDTH_REAL
+#define SENSOR_MAX_HEIGHT SENSOR_MAX_HEIGHT_REAL
+#endif
#define SENSOR_INIT_WIDTH sensor_init_width /* Sensor pixel size for sensor_init_data array */
#define SENSOR_INIT_HEIGHT sensor_init_height
#define SENSOR_INIT_WINSEQADR sensor_init_winseq_p
ret = true;
} else if ((mf->width == 2592) && (mf->height == 1944)) {
ret = true;
+ } else if ((mf->width == 3264) && (mf->height == 2448)) {
+ ret = true;
}
if (ret == true)
set_w = 2592;
set_h = 1944;
}
+#if defined(CONFIG_SOC_CAMERA_OV5642_INTERPOLATION)
+ else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) )
+ {
+ winseqe_set_addr = sensor_qsxga;
+ set_w = SENSOR_MAX_WIDTH_REAL;
+ set_h = SENSOR_MAX_HEIGHT_REAL;
+ }
+#endif
else
{
winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */
if (fmt == NULL) {
fmt = &sensor->info_priv.fmt;
mf->code = fmt->code;
- }
+ }
+ /* ddl@rock-chips.com : It is query max resolution only. */
+ if (mf->reserved[6] == 0xfefe5a5a) {
+ mf->height = SENSOR_MAX_HEIGHT;
+ mf->width = SENSOR_MAX_WIDTH;
+ ret = 0;
+ printk("%s(%d): query resolution\n",__FUNCTION__,__LINE__);
+ goto sensor_try_fmt_end;
+ }
if (mf->height > SENSOR_MAX_HEIGHT)
mf->height = SENSOR_MAX_HEIGHT;
set_w = 2592;
set_h = 1944;
}
+#if defined(CONFIG_SOC_CAMERA_OV5642_INTERPOLATION)
+ else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) )
+ {
+ set_w = SENSOR_MAX_WIDTH_REAL;
+ set_h = SENSOR_MAX_HEIGHT_REAL;
+ }
+#endif
else
{
set_w = SENSOR_INIT_WIDTH;
mf->height = set_h;
mf->colorspace = fmt->colorspace;
-
+sensor_try_fmt_end:
return ret;
}
5.arm scale algorithm has something wrong(may exceed the bound of width or height) ,fix it.
*v0.x.15:
* 1. support rk3066b;
-
+*v0.x.17:
+* 1. support 8Mega picture;
*/
-#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 2, 0x15)
+#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 2, 0x17)
/* limit to rk29 hardware capabilities */
#define RK_CAM_BUS_PARAM (SOCAM_MASTER |\
int src_y_offset,src_uv_offset,dst_y_offset,dst_uv_offset,src_y_size,dst_y_size;
int scale_times,w,h;
int ret = 0;
+
/*
*ddl@rock-chips.com:
* IPP Dest image resolution is 2047x1088, so scale operation break up some times
}
}
}
-
do_ipp_err:
return ret;
}
zoomindstxIntInv = ((unsigned long)cropW<<16)/dstW + 1;
zoomindstyIntInv = ((unsigned long)cropH<<16)/dstH + 1;
-
+
//y
//for(y = 0; y<dstH - 1 ; y++ ) {
for(y = 0; y<dstH; y++ ) {
}
pdUV += dstW*2;
}
-
rk_camera_scale_crop_arm_end:
dmac_flush_range((void*)src,(void*)(src+pcdev->vipmem_bsize));
ret = true;
} else if ((f->fmt.pix.width == 2592) && (f->fmt.pix.height == 1944)) {
ret = true;
+ } else if ((f->fmt.pix.width == 3264) && (f->fmt.pix.height == 2448)) {
+ ret = true;
}
if (ret == true)
mf.field = pix->field;
mf.colorspace = pix->colorspace;
mf.code = xlate->code;
+ /* ddl@rock-chips.com : It is query max resolution only. */
+ if ((usr_w == 10000) && (usr_h == 10000)) {
+ mf.reserved[6] = 0xfefe5a5a;
+ }
ret = v4l2_subdev_call(sd, video, try_mbus_fmt, &mf);
if (ret < 0)