[media] omap3isp: ccdc: Only complete buffer when all fields are captured

Checking that the captured field corresponds to the last required field
depending on the requested field order before completing the buffer
isn't enough. When the first field at stream start corresponds to the
last required field, this would result in returning an interlaced buffer
containing a single field.

Fix this by keeping track of the fields captured in the buffer, and make
sure that both fields are present for alternate field orders.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This commit is contained in:
Laurent Pinchart
2014-06-07 20:57:07 -03:00
committed by Mauro Carvalho Chehab
parent aec2de0e93
commit 93d7badf1b
2 changed files with 58 additions and 27 deletions

View File

@@ -93,6 +93,10 @@ struct ispccdc_lsc {
#define CCDC_PAD_SOURCE_VP 2
#define CCDC_PADS_NUM 3
#define CCDC_FIELD_TOP 1
#define CCDC_FIELD_BOTTOM 2
#define CCDC_FIELD_BOTH 3
/*
* struct isp_ccdc_device - Structure for the CCDC module to store its own
* information
@@ -114,6 +118,7 @@ struct ispccdc_lsc {
* @update: Bitmask of controls to update during the next interrupt
* @shadow_update: Controls update in progress by userspace
* @bt656: Whether the input interface uses BT.656 synchronization
* @fields: The fields (CCDC_FIELD_*) stored in the current buffer
* @underrun: A buffer underrun occurred and a new buffer has been queued
* @state: Streaming state
* @lock: Serializes shadow_update with interrupt handler
@@ -143,6 +148,8 @@ struct isp_ccdc_device {
unsigned int shadow_update;
bool bt656;
unsigned int fields;
unsigned int underrun:1;
enum isp_pipeline_stream_state state;
spinlock_t lock;