camera rk30 : update a temp version.fix failed of 720p preview.
authorroot <root@zyc-desktop.(none)>
Tue, 10 Apr 2012 05:14:29 +0000 (13:14 +0800)
committerroot <root@zyc-desktop.(none)>
Tue, 10 Apr 2012 05:14:29 +0000 (13:14 +0800)
arch/arm/plat-rk/rk_camera.c
drivers/media/video/rk30_camera_oneframe.c

index b5addd65e60c5529b433253910316db40418fd7f..8bcd22c182c34f70717d92d15500472432284e4e 100755 (executable)
 #define PMEM_CAMIPP_NECESSARY_CIF_0    0x500000\r
 #elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x200000) /* 1280*720*1.5*4(preview) + 3M(capture raw) + 3M(jpeg encode output) */\r
 #define PMEM_CAM_NECESSARY_CIF_0   0xc00000\r
-#define PMEM_CAMIPP_NECESSARY_CIF_0    0x400000\r
+#define PMEM_CAMIPP_NECESSARY_CIF_0    0x600000\r
 #elif ((PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x100000) || (PMEM_SENSOR_FULL_RESOLUTION_CIF_0 == 0x130000))\r
 #define PMEM_CAM_NECESSARY_CIF_0   0x800000        /* 800*600*1.5*4(preview) + 2M(capture raw) + 2M(jpeg encode output) */\r
 #define PMEM_CAMIPP_NECESSARY_CIF_0    0x400000\r
 #define PMEM_CAMIPP_NECESSARY_CIF_1    0x500000\r
 #elif (PMEM_SENSOR_FULL_RESOLUTION_CIF_1== 0x200000) /* 1280*720*1.5*4(preview) + 3M(capture raw) + 3M(jpeg encode output) */\r
 #define PMEM_CAM_NECESSARY_CIF_1        0xc00000\r
-#define PMEM_CAMIPP_NECESSARY_CIF_1    0x400000\r
+#define PMEM_CAMIPP_NECESSARY_CIF_1    0x600000\r
 #elif ((PMEM_SENSOR_FULL_RESOLUTION_CIF_1 == 0x100000) || (PMEM_SENSOR_FULL_RESOLUTION_CIF_1 == 0x130000))\r
 #define PMEM_CAM_NECESSARY_CIF_1        0x800000                /* 800*600*1.5*4(preview) + 2M(capture raw) + 2M(jpeg encode output) */\r
 #define PMEM_CAMIPP_NECESSARY_CIF_1    0x400000\r
index 8a9460f9ed26a2af98e6b807825cf4f7f1798aa3..783afb308cfab736894c99638c6699ed430ff36b 100755 (executable)
@@ -183,8 +183,9 @@ module_param(debug, int, S_IRUGO|S_IWUSR);
 *v0.x.6 : this driver improve test framerate method;
 *v0.x.7 : digital zoom use the ipp to do scale and crop , otherwise ipp just do the scale. Something wrong with digital zoom if
           we do crop with cif and do scale with ipp , we will fix this  next version.
+*v0.x.8 : temp version,reinit capture list when setup video buf.
 */
-#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 2, 7)
+#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 2, 8)
 
 /* limit to rk29 hardware capabilities */
 #define RK_CAM_BUS_PARAM   (SOCAM_MASTER |\
@@ -383,6 +384,7 @@ static int rk_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
        }
     //must be reinit,or will be somthing wrong in irq process.
     pcdev->active = NULL;
+    INIT_LIST_HEAD(&pcdev->capture);
     RKCAMERA_DG("%s..%d.. videobuf size:%d, vipmem_buf size:%d, count:%d \n",__FUNCTION__,__LINE__, *size,pcdev->vipmem_size, *count);
 
     return 0;
@@ -654,6 +656,10 @@ static irqreturn_t rk_camera_irq(int irq, void *data)
             pcdev->frame_inval = 0;
         }
         vb = pcdev->active;
+        if(!vb){
+            printk("no acticve buffer!!!\n");
+            goto RK_CAMERA_IRQ_END;
+            }
                /* ddl@rock-chips.com : this vb may be deleted from queue */
                if ((vb->state == VIDEOBUF_QUEUED) || (vb->state == VIDEOBUF_ACTIVE)) {
                list_del_init(&vb->queue);
@@ -661,9 +667,14 @@ static irqreturn_t rk_camera_irq(int irq, void *data)
         pcdev->active = NULL;
         if (!list_empty(&pcdev->capture)) {
             pcdev->active = list_entry(pcdev->capture.next, struct videobuf_buffer, queue);
-                       if (pcdev->active) {
+                       if (pcdev->active && (pcdev->active->state == VIDEOBUF_QUEUED)) {
                                rk_videobuf_capture(pcdev->active,pcdev);
                        }
+            else if(pcdev->active){
+                printk("vb state is wrong ,del it \n");
+               list_del_init(&(pcdev->active->queue));
+                pcdev->active = NULL;
+                }
         }
         if (pcdev->active == NULL) {
                        RKCAMERA_DG("%s video_buf queue is empty!\n",__FUNCTION__);