Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295006
b: refs/heads/master
c: a654ba1
h: refs/heads/master
v: v3
  • Loading branch information
Javier Martin authored and Mauro Carvalho Chehab committed Mar 8, 2012
1 parent 6558a49 commit efd9f19
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 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: d84279e6d7266e11bef19de4f624849daa70bc48
refs/heads/master: a654ba16fdbad8ffb5a6c0dd5098c6651bde08b5
26 changes: 12 additions & 14 deletions trunk/drivers/media/video/mx2_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ static void mx25_camera_frame_done(struct mx2_camera_dev *pcdev, int fb,
buf = NULL;
writel(0, pcdev->base_csi + fb_reg);
} else {
buf = list_entry(pcdev->capture.next, struct mx2_buffer,
buf = list_first_entry(&pcdev->capture, struct mx2_buffer,
queue);
vb = &buf->vb;
list_del(&buf->queue);
Expand Down Expand Up @@ -709,8 +709,8 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)

spin_lock_irqsave(&pcdev->lock, flags);

buf = list_entry(pcdev->capture.next,
struct mx2_buffer, queue);
buf = list_first_entry(&pcdev->capture, struct mx2_buffer,
queue);
buf->bufnum = 0;
vb = &buf->vb;
buf->state = MX2_STATE_ACTIVE;
Expand All @@ -719,8 +719,8 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count)
mx27_update_emma_buf(pcdev, phys, buf->bufnum);
list_move_tail(pcdev->capture.next, &pcdev->active_bufs);

buf = list_entry(pcdev->capture.next,
struct mx2_buffer, queue);
buf = list_first_entry(&pcdev->capture, struct mx2_buffer,
queue);
buf->bufnum = 1;
vb = &buf->vb;
buf->state = MX2_STATE_ACTIVE;
Expand Down Expand Up @@ -1205,8 +1205,7 @@ static void mx27_camera_frame_done_emma(struct mx2_camera_dev *pcdev,
struct vb2_buffer *vb;
unsigned long phys;

buf = list_entry(pcdev->active_bufs.next,
struct mx2_buffer, queue);
buf = list_first_entry(&pcdev->active_bufs, struct mx2_buffer, queue);

BUG_ON(buf->bufnum != bufnum);

Expand Down Expand Up @@ -1260,17 +1259,16 @@ static void mx27_camera_frame_done_emma(struct mx2_camera_dev *pcdev,
return;
}

buf = list_entry(pcdev->discard.next,
struct mx2_buffer, queue);
buf = list_first_entry(&pcdev->discard, struct mx2_buffer,
queue);
buf->bufnum = bufnum;

list_move_tail(pcdev->discard.next, &pcdev->active_bufs);
mx27_update_emma_buf(pcdev, pcdev->discard_buffer_dma, bufnum);
return;
}

buf = list_entry(pcdev->capture.next,
struct mx2_buffer, queue);
buf = list_first_entry(&pcdev->capture, struct mx2_buffer, queue);

buf->bufnum = bufnum;

Expand Down Expand Up @@ -1304,7 +1302,7 @@ static irqreturn_t mx27_camera_emma_irq(int irq_emma, void *data)
pcdev->base_emma + PRP_CNTL);
writel(cntl, pcdev->base_emma + PRP_CNTL);

buf = list_entry(pcdev->active_bufs.next,
buf = list_first_entry(&pcdev->active_bufs,
struct mx2_buffer, queue);
mx27_camera_frame_done_emma(pcdev,
buf->bufnum, true);
Expand All @@ -1316,8 +1314,8 @@ static irqreturn_t mx27_camera_emma_irq(int irq_emma, void *data)
* Both buffers have triggered, process the one we're expecting
* to first
*/
buf = list_entry(pcdev->active_bufs.next,
struct mx2_buffer, queue);
buf = list_first_entry(&pcdev->active_bufs, struct mx2_buffer,
queue);
mx27_camera_frame_done_emma(pcdev, buf->bufnum, false);
status &= ~(1 << (6 - buf->bufnum)); /* mark processed */
} else if ((status & (1 << 6)) || (status & (1 << 4))) {
Expand Down

0 comments on commit efd9f19

Please sign in to comment.