diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-02-09 11:00:45 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-08 12:51:25 -0400 |
commit | b43883d659aa3f3aced5e400538b200341e910e0 (patch) | |
tree | 3df28ffc8c5c1cfc276da278d8b49406d6c05b62 /drivers/media/video/omap3isp | |
parent | a32f2f90543853449f0e49eaf885e8d24d5809a7 (diff) |
[media] omap3isp: Fix frame number propagation
When propagating the frame number through the pipeline, the frame number
must be incremented at frame start by the appropriate IRQ handler. This
was properly handled for the CSI2 and CCP2 receivers, but not when the
CCDC parallel interface is used.
ADD frame number incrementation to the HS/VS interrupt handler. As the
HS/VS interrupt is also generated for frames received by the CSI2 and
CCP2 receivers, remove explicit propagation handling from the serial
receivers.
Reported-by: Kruno Mrak <kruno.mrak@matrix-vision.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Tested-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/omap3isp')
-rw-r--r-- | drivers/media/video/omap3isp/isp.c | 8 | ||||
-rw-r--r-- | drivers/media/video/omap3isp/ispccdc.c | 3 | ||||
-rw-r--r-- | drivers/media/video/omap3isp/ispccp2.c | 23 | ||||
-rw-r--r-- | drivers/media/video/omap3isp/ispcsi2.c | 20 | ||||
-rw-r--r-- | drivers/media/video/omap3isp/ispcsi2.h | 1 |
5 files changed, 6 insertions, 49 deletions
diff --git a/drivers/media/video/omap3isp/isp.c b/drivers/media/video/omap3isp/isp.c index 06afbc14f6ae..df6416c706fd 100644 --- a/drivers/media/video/omap3isp/isp.c +++ b/drivers/media/video/omap3isp/isp.c | |||
@@ -785,14 +785,6 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe, | |||
785 | } | 785 | } |
786 | } | 786 | } |
787 | 787 | ||
788 | /* Frame number propagation. In continuous streaming mode the number | ||
789 | * is incremented in the frame start ISR. In mem-to-mem mode | ||
790 | * singleshot is used and frame start IRQs are not available. | ||
791 | * Thus we have to increment the number here. | ||
792 | */ | ||
793 | if (pipe->do_propagation && mode == ISP_PIPELINE_STREAM_SINGLESHOT) | ||
794 | atomic_inc(&pipe->frame_number); | ||
795 | |||
796 | return 0; | 788 | return 0; |
797 | } | 789 | } |
798 | 790 | ||
diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c index 1f3c16d8f0b4..17207c7037f7 100644 --- a/drivers/media/video/omap3isp/ispccdc.c +++ b/drivers/media/video/omap3isp/ispccdc.c | |||
@@ -1410,6 +1410,9 @@ static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc) | |||
1410 | struct video_device *vdev = ccdc->subdev.devnode; | 1410 | struct video_device *vdev = ccdc->subdev.devnode; |
1411 | struct v4l2_event event; | 1411 | struct v4l2_event event; |
1412 | 1412 | ||
1413 | /* Frame number propagation */ | ||
1414 | atomic_inc(&pipe->frame_number); | ||
1415 | |||
1413 | memset(&event, 0, sizeof(event)); | 1416 | memset(&event, 0, sizeof(event)); |
1414 | event.type = V4L2_EVENT_FRAME_SYNC; | 1417 | event.type = V4L2_EVENT_FRAME_SYNC; |
1415 | event.u.frame_sync.frame_sequence = atomic_read(&pipe->frame_number); | 1418 | event.u.frame_sync.frame_sequence = atomic_read(&pipe->frame_number); |
diff --git a/drivers/media/video/omap3isp/ispccp2.c b/drivers/media/video/omap3isp/ispccp2.c index 70ddbf35b223..ee7dcda36b6d 100644 --- a/drivers/media/video/omap3isp/ispccp2.c +++ b/drivers/media/video/omap3isp/ispccp2.c | |||
@@ -161,7 +161,6 @@ static void ccp2_pwr_cfg(struct isp_ccp2_device *ccp2) | |||
161 | static void ccp2_if_enable(struct isp_ccp2_device *ccp2, u8 enable) | 161 | static void ccp2_if_enable(struct isp_ccp2_device *ccp2, u8 enable) |
162 | { | 162 | { |
163 | struct isp_device *isp = to_isp_device(ccp2); | 163 | struct isp_device *isp = to_isp_device(ccp2); |
164 | struct isp_pipeline *pipe = to_isp_pipeline(&ccp2->subdev.entity); | ||
165 | int i; | 164 | int i; |
166 | 165 | ||
167 | if (enable && ccp2->vdds_csib) | 166 | if (enable && ccp2->vdds_csib) |
@@ -178,19 +177,6 @@ static void ccp2_if_enable(struct isp_ccp2_device *ccp2, u8 enable) | |||
178 | ISPCCP2_CTRL_MODE | ISPCCP2_CTRL_IF_EN, | 177 | ISPCCP2_CTRL_MODE | ISPCCP2_CTRL_IF_EN, |
179 | enable ? (ISPCCP2_CTRL_MODE | ISPCCP2_CTRL_IF_EN) : 0); | 178 | enable ? (ISPCCP2_CTRL_MODE | ISPCCP2_CTRL_IF_EN) : 0); |
180 | 179 | ||
181 | /* For frame count propagation */ | ||
182 | if (pipe->do_propagation) { | ||
183 | /* We may want the Frame Start IRQ from LC0 */ | ||
184 | if (enable) | ||
185 | isp_reg_set(isp, OMAP3_ISP_IOMEM_CCP2, | ||
186 | ISPCCP2_LC01_IRQENABLE, | ||
187 | ISPCCP2_LC01_IRQSTATUS_LC0_FS_IRQ); | ||
188 | else | ||
189 | isp_reg_clr(isp, OMAP3_ISP_IOMEM_CCP2, | ||
190 | ISPCCP2_LC01_IRQENABLE, | ||
191 | ISPCCP2_LC01_IRQSTATUS_LC0_FS_IRQ); | ||
192 | } | ||
193 | |||
194 | if (!enable && ccp2->vdds_csib) | 180 | if (!enable && ccp2->vdds_csib) |
195 | regulator_disable(ccp2->vdds_csib); | 181 | regulator_disable(ccp2->vdds_csib); |
196 | } | 182 | } |
@@ -350,7 +336,6 @@ static void ccp2_lcx_config(struct isp_ccp2_device *ccp2, | |||
350 | ISPCCP2_LC01_IRQSTATUS_LC0_CRC_IRQ | | 336 | ISPCCP2_LC01_IRQSTATUS_LC0_CRC_IRQ | |
351 | ISPCCP2_LC01_IRQSTATUS_LC0_FSP_IRQ | | 337 | ISPCCP2_LC01_IRQSTATUS_LC0_FSP_IRQ | |
352 | ISPCCP2_LC01_IRQSTATUS_LC0_FW_IRQ | | 338 | ISPCCP2_LC01_IRQSTATUS_LC0_FW_IRQ | |
353 | ISPCCP2_LC01_IRQSTATUS_LC0_FS_IRQ | | ||
354 | ISPCCP2_LC01_IRQSTATUS_LC0_FSC_IRQ | | 339 | ISPCCP2_LC01_IRQSTATUS_LC0_FSC_IRQ | |
355 | ISPCCP2_LC01_IRQSTATUS_LC0_SSC_IRQ; | 340 | ISPCCP2_LC01_IRQSTATUS_LC0_SSC_IRQ; |
356 | 341 | ||
@@ -613,14 +598,6 @@ void omap3isp_ccp2_isr(struct isp_ccp2_device *ccp2) | |||
613 | if (omap3isp_module_sync_is_stopping(&ccp2->wait, &ccp2->stopping)) | 598 | if (omap3isp_module_sync_is_stopping(&ccp2->wait, &ccp2->stopping)) |
614 | return; | 599 | return; |
615 | 600 | ||
616 | /* Frame number propagation */ | ||
617 | if (lcx_irqstatus & ISPCCP2_LC01_IRQSTATUS_LC0_FS_IRQ) { | ||
618 | struct isp_pipeline *pipe = | ||
619 | to_isp_pipeline(&ccp2->subdev.entity); | ||
620 | if (pipe->do_propagation) | ||
621 | atomic_inc(&pipe->frame_number); | ||
622 | } | ||
623 | |||
624 | /* Handle queued buffers on frame end interrupts */ | 601 | /* Handle queued buffers on frame end interrupts */ |
625 | if (lcm_irqstatus & ISPCCP2_LCM_IRQSTATUS_EOF_IRQ) | 602 | if (lcm_irqstatus & ISPCCP2_LCM_IRQSTATUS_EOF_IRQ) |
626 | ccp2_isr_buffer(ccp2); | 603 | ccp2_isr_buffer(ccp2); |
diff --git a/drivers/media/video/omap3isp/ispcsi2.c b/drivers/media/video/omap3isp/ispcsi2.c index fcb5168996a7..75ac6d466962 100644 --- a/drivers/media/video/omap3isp/ispcsi2.c +++ b/drivers/media/video/omap3isp/ispcsi2.c | |||
@@ -378,21 +378,17 @@ static void csi2_timing_config(struct isp_device *isp, | |||
378 | static void csi2_irq_ctx_set(struct isp_device *isp, | 378 | static void csi2_irq_ctx_set(struct isp_device *isp, |
379 | struct isp_csi2_device *csi2, int enable) | 379 | struct isp_csi2_device *csi2, int enable) |
380 | { | 380 | { |
381 | u32 reg = ISPCSI2_CTX_IRQSTATUS_FE_IRQ; | ||
382 | int i; | 381 | int i; |
383 | 382 | ||
384 | if (csi2->use_fs_irq) | ||
385 | reg |= ISPCSI2_CTX_IRQSTATUS_FS_IRQ; | ||
386 | |||
387 | for (i = 0; i < 8; i++) { | 383 | for (i = 0; i < 8; i++) { |
388 | isp_reg_writel(isp, reg, csi2->regs1, | 384 | isp_reg_writel(isp, ISPCSI2_CTX_IRQSTATUS_FE_IRQ, csi2->regs1, |
389 | ISPCSI2_CTX_IRQSTATUS(i)); | 385 | ISPCSI2_CTX_IRQSTATUS(i)); |
390 | if (enable) | 386 | if (enable) |
391 | isp_reg_set(isp, csi2->regs1, ISPCSI2_CTX_IRQENABLE(i), | 387 | isp_reg_set(isp, csi2->regs1, ISPCSI2_CTX_IRQENABLE(i), |
392 | reg); | 388 | ISPCSI2_CTX_IRQSTATUS_FE_IRQ); |
393 | else | 389 | else |
394 | isp_reg_clr(isp, csi2->regs1, ISPCSI2_CTX_IRQENABLE(i), | 390 | isp_reg_clr(isp, csi2->regs1, ISPCSI2_CTX_IRQENABLE(i), |
395 | reg); | 391 | ISPCSI2_CTX_IRQSTATUS_FE_IRQ); |
396 | } | 392 | } |
397 | } | 393 | } |
398 | 394 | ||
@@ -690,14 +686,6 @@ static void csi2_isr_ctx(struct isp_csi2_device *csi2, | |||
690 | status = isp_reg_readl(isp, csi2->regs1, ISPCSI2_CTX_IRQSTATUS(n)); | 686 | status = isp_reg_readl(isp, csi2->regs1, ISPCSI2_CTX_IRQSTATUS(n)); |
691 | isp_reg_writel(isp, status, csi2->regs1, ISPCSI2_CTX_IRQSTATUS(n)); | 687 | isp_reg_writel(isp, status, csi2->regs1, ISPCSI2_CTX_IRQSTATUS(n)); |
692 | 688 | ||
693 | /* Propagate frame number */ | ||
694 | if (status & ISPCSI2_CTX_IRQSTATUS_FS_IRQ) { | ||
695 | struct isp_pipeline *pipe = | ||
696 | to_isp_pipeline(&csi2->subdev.entity); | ||
697 | if (pipe->do_propagation) | ||
698 | atomic_inc(&pipe->frame_number); | ||
699 | } | ||
700 | |||
701 | if (!(status & ISPCSI2_CTX_IRQSTATUS_FE_IRQ)) | 689 | if (!(status & ISPCSI2_CTX_IRQSTATUS_FE_IRQ)) |
702 | return; | 690 | return; |
703 | 691 | ||
@@ -1047,14 +1035,12 @@ static int csi2_set_stream(struct v4l2_subdev *sd, int enable) | |||
1047 | { | 1035 | { |
1048 | struct isp_csi2_device *csi2 = v4l2_get_subdevdata(sd); | 1036 | struct isp_csi2_device *csi2 = v4l2_get_subdevdata(sd); |
1049 | struct isp_device *isp = csi2->isp; | 1037 | struct isp_device *isp = csi2->isp; |
1050 | struct isp_pipeline *pipe = to_isp_pipeline(&csi2->subdev.entity); | ||
1051 | struct isp_video *video_out = &csi2->video_out; | 1038 | struct isp_video *video_out = &csi2->video_out; |
1052 | 1039 | ||
1053 | switch (enable) { | 1040 | switch (enable) { |
1054 | case ISP_PIPELINE_STREAM_CONTINUOUS: | 1041 | case ISP_PIPELINE_STREAM_CONTINUOUS: |
1055 | if (omap3isp_csiphy_acquire(csi2->phy) < 0) | 1042 | if (omap3isp_csiphy_acquire(csi2->phy) < 0) |
1056 | return -ENODEV; | 1043 | return -ENODEV; |
1057 | csi2->use_fs_irq = pipe->do_propagation; | ||
1058 | if (csi2->output & CSI2_OUTPUT_MEMORY) | 1044 | if (csi2->output & CSI2_OUTPUT_MEMORY) |
1059 | omap3isp_sbl_enable(isp, OMAP3_ISP_SBL_CSI2A_WRITE); | 1045 | omap3isp_sbl_enable(isp, OMAP3_ISP_SBL_CSI2A_WRITE); |
1060 | csi2_configure(csi2); | 1046 | csi2_configure(csi2); |
diff --git a/drivers/media/video/omap3isp/ispcsi2.h b/drivers/media/video/omap3isp/ispcsi2.h index 885ad79a7678..c57729b7e86e 100644 --- a/drivers/media/video/omap3isp/ispcsi2.h +++ b/drivers/media/video/omap3isp/ispcsi2.h | |||
@@ -145,7 +145,6 @@ struct isp_csi2_device { | |||
145 | u32 output; /* output to CCDC, memory or both? */ | 145 | u32 output; /* output to CCDC, memory or both? */ |
146 | bool dpcm_decompress; | 146 | bool dpcm_decompress; |
147 | unsigned int frame_skip; | 147 | unsigned int frame_skip; |
148 | bool use_fs_irq; | ||
149 | 148 | ||
150 | struct isp_csiphy *phy; | 149 | struct isp_csiphy *phy; |
151 | struct isp_csi2_ctx_cfg contexts[ISP_CSI2_MAX_CTX_NUM + 1]; | 150 | struct isp_csi2_ctx_cfg contexts[ISP_CSI2_MAX_CTX_NUM + 1]; |