Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295005
b: refs/heads/master
c: d84279e
h: refs/heads/master
i:
  295003: 7aa40d5
v: v3
  • Loading branch information
Javier Martin authored and Mauro Carvalho Chehab committed Mar 8, 2012
1 parent f255f1a commit 6558a49
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cdc9d6f191d81aa1b1b34db9d3a33f779f5c5ec7
refs/heads/master: d84279e6d7266e11bef19de4f624849daa70bc48
38 changes: 19 additions & 19 deletions trunk/drivers/media/video/mx2_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ static struct soc_camera_host_ops mx2_soc_camera_host_ops = {
};

static void mx27_camera_frame_done_emma(struct mx2_camera_dev *pcdev,
int bufnum)
int bufnum, bool err)
{
struct mx2_fmt_cfg *prp = pcdev->emma_prp;
struct mx2_buffer *buf;
Expand Down Expand Up @@ -1245,7 +1245,10 @@ static void mx27_camera_frame_done_emma(struct mx2_camera_dev *pcdev,
list_del_init(&buf->queue);
do_gettimeofday(&vb->v4l2_buf.timestamp);
vb->v4l2_buf.sequence = pcdev->frame_count;
vb2_buffer_done(vb, VB2_BUF_STATE_DONE);
if (err)
vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
else
vb2_buffer_done(vb, VB2_BUF_STATE_DONE);
}

pcdev->frame_count++;
Expand Down Expand Up @@ -1296,35 +1299,32 @@ static irqreturn_t mx27_camera_emma_irq(int irq_emma, void *data)
}

if (status & (1 << 7)) { /* overflow */
u32 cntl;
/*
* We only disable channel 1 here since this is the only
* enabled channel
*
* FIXME: the correct DMA overflow handling should be resetting
* the buffer, returning an error frame, and continuing with
* the next one.
*/
cntl = readl(pcdev->base_emma + PRP_CNTL);
u32 cntl = readl(pcdev->base_emma + PRP_CNTL);
writel(cntl & ~(PRP_CNTL_CH1EN | PRP_CNTL_CH2EN),
pcdev->base_emma + PRP_CNTL);
writel(cntl, pcdev->base_emma + PRP_CNTL);
}
if (((status & (3 << 5)) == (3 << 5)) ||

buf = list_entry(pcdev->active_bufs.next,
struct mx2_buffer, queue);
mx27_camera_frame_done_emma(pcdev,
buf->bufnum, true);

status &= ~(1 << 7);
} else if (((status & (3 << 5)) == (3 << 5)) ||
((status & (3 << 3)) == (3 << 3))) {
/*
* Both buffers have triggered, process the one we're expecting
* to first
*/
buf = list_entry(pcdev->active_bufs.next,
struct mx2_buffer, queue);
mx27_camera_frame_done_emma(pcdev, buf->bufnum);
mx27_camera_frame_done_emma(pcdev, buf->bufnum, false);
status &= ~(1 << (6 - buf->bufnum)); /* mark processed */
} else if ((status & (1 << 6)) || (status & (1 << 4))) {
mx27_camera_frame_done_emma(pcdev, 0, false);
} else if ((status & (1 << 5)) || (status & (1 << 3))) {
mx27_camera_frame_done_emma(pcdev, 1, false);
}
if ((status & (1 << 6)) || (status & (1 << 4)))
mx27_camera_frame_done_emma(pcdev, 0);
if ((status & (1 << 5)) || (status & (1 << 3)))
mx27_camera_frame_done_emma(pcdev, 1);

irq_ok:
spin_unlock_irqrestore(&pcdev->lock, flags);
Expand Down

0 comments on commit 6558a49

Please sign in to comment.