aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-fimc
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2011-06-10 14:36:59 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-06 16:50:05 -0400
commit0295202ca7b2816ddccae83e6efcf6d24cc243c3 (patch)
treed6faa93cd93c2fded165ae9e8fb78f81ceea0f67 /drivers/media/video/s5p-fimc
parente1d72f4d521733bbf16cb5ba63683fe4147fa349 (diff)
[media] s5p-fimc: Use consistent names for the buffer list functions
Also correct and improve *_queue_add/pop functions description. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-fimc')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-capture.c6
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.c6
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.h38
3 files changed, 31 insertions, 19 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c
index 7fafd1228fbc..469384623952 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -84,12 +84,12 @@ static int fimc_capture_state_cleanup(struct fimc_dev *fimc)
84 84
85 /* Release buffers that were enqueued in the driver by videobuf2. */ 85 /* Release buffers that were enqueued in the driver by videobuf2. */
86 while (!list_empty(&cap->pending_buf_q)) { 86 while (!list_empty(&cap->pending_buf_q)) {
87 buf = pending_queue_pop(cap); 87 buf = fimc_pending_queue_pop(cap);
88 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); 88 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
89 } 89 }
90 90
91 while (!list_empty(&cap->active_buf_q)) { 91 while (!list_empty(&cap->active_buf_q)) {
92 buf = active_queue_pop(cap); 92 buf = fimc_active_queue_pop(cap);
93 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); 93 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
94 } 94 }
95 95
@@ -279,7 +279,7 @@ static void buffer_queue(struct vb2_buffer *vb)
279 279
280 fimc_hw_set_output_addr(fimc, &buf->paddr, buf_id); 280 fimc_hw_set_output_addr(fimc, &buf->paddr, buf_id);
281 buf->index = vid_cap->buf_index; 281 buf->index = vid_cap->buf_index;
282 active_queue_add(vid_cap, buf); 282 fimc_active_queue_add(vid_cap, buf);
283 283
284 if (++vid_cap->buf_index >= FIMC_MAX_OUT_BUFS) 284 if (++vid_cap->buf_index >= FIMC_MAX_OUT_BUFS)
285 vid_cap->buf_index = 0; 285 vid_cap->buf_index = 0;
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c
index 10aee626c7c9..33c706985763 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.c
+++ b/drivers/media/video/s5p-fimc/fimc-core.c
@@ -338,7 +338,7 @@ void fimc_capture_irq_handler(struct fimc_dev *fimc, bool final)
338 test_bit(ST_CAPT_RUN, &fimc->state) && final) { 338 test_bit(ST_CAPT_RUN, &fimc->state) && final) {
339 ktime_get_real_ts(&ts); 339 ktime_get_real_ts(&ts);
340 340
341 v_buf = active_queue_pop(cap); 341 v_buf = fimc_active_queue_pop(cap);
342 342
343 tv = &v_buf->vb.v4l2_buf.timestamp; 343 tv = &v_buf->vb.v4l2_buf.timestamp;
344 tv->tv_sec = ts.tv_sec; 344 tv->tv_sec = ts.tv_sec;
@@ -355,12 +355,12 @@ void fimc_capture_irq_handler(struct fimc_dev *fimc, bool final)
355 355
356 if (!list_empty(&cap->pending_buf_q)) { 356 if (!list_empty(&cap->pending_buf_q)) {
357 357
358 v_buf = pending_queue_pop(cap); 358 v_buf = fimc_pending_queue_pop(cap);
359 fimc_hw_set_output_addr(fimc, &v_buf->paddr, cap->buf_index); 359 fimc_hw_set_output_addr(fimc, &v_buf->paddr, cap->buf_index);
360 v_buf->index = cap->buf_index; 360 v_buf->index = cap->buf_index;
361 361
362 /* Move the buffer to the capture active queue */ 362 /* Move the buffer to the capture active queue */
363 active_queue_add(cap, v_buf); 363 fimc_active_queue_add(cap, v_buf);
364 364
365 dbg("next frame: %d, done frame: %d", 365 dbg("next frame: %d, done frame: %d",
366 fimc_hw_get_frame_index(fimc), v_buf->index); 366 fimc_hw_get_frame_index(fimc), v_buf->index);
diff --git a/drivers/media/video/s5p-fimc/fimc-core.h b/drivers/media/video/s5p-fimc/fimc-core.h
index 6ec8b37ce41e..82ac59776df7 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.h
+++ b/drivers/media/video/s5p-fimc/fimc-core.h
@@ -745,22 +745,27 @@ static inline void fimc_deactivate_capture(struct fimc_dev *fimc)
745} 745}
746 746
747/* 747/*
748 * Add buf to the capture active buffers queue. 748 * Buffer list manipulation functions. Must be called with fimc.slock held.
749 * Locking: Need to be called with fimc_dev::slock held.
750 */ 749 */
751static inline void active_queue_add(struct fimc_vid_cap *vid_cap, 750
752 struct fimc_vid_buffer *buf) 751/**
752 * fimc_active_queue_add - add buffer to the capture active buffers queue
753 * @buf: buffer to add to the active buffers list
754 */
755static inline void fimc_active_queue_add(struct fimc_vid_cap *vid_cap,
756 struct fimc_vid_buffer *buf)
753{ 757{
754 list_add_tail(&buf->list, &vid_cap->active_buf_q); 758 list_add_tail(&buf->list, &vid_cap->active_buf_q);
755 vid_cap->active_buf_cnt++; 759 vid_cap->active_buf_cnt++;
756} 760}
757 761
758/* 762/**
759 * Pop a video buffer from the capture active buffers queue 763 * fimc_active_queue_pop - pop buffer from the capture active buffers queue
760 * Locking: Need to be called with fimc_dev::slock held. 764 *
765 * The caller must assure the active_buf_q list is not empty.
761 */ 766 */
762static inline struct fimc_vid_buffer * 767static inline struct fimc_vid_buffer *fimc_active_queue_pop(
763active_queue_pop(struct fimc_vid_cap *vid_cap) 768 struct fimc_vid_cap *vid_cap)
764{ 769{
765 struct fimc_vid_buffer *buf; 770 struct fimc_vid_buffer *buf;
766 buf = list_entry(vid_cap->active_buf_q.next, 771 buf = list_entry(vid_cap->active_buf_q.next,
@@ -770,16 +775,23 @@ active_queue_pop(struct fimc_vid_cap *vid_cap)
770 return buf; 775 return buf;
771} 776}
772 777
773/* Add video buffer to the capture pending buffers queue */ 778/**
779 * fimc_pending_queue_add - add buffer to the capture pending buffers queue
780 * @buf: buffer to add to the pending buffers list
781 */
774static inline void fimc_pending_queue_add(struct fimc_vid_cap *vid_cap, 782static inline void fimc_pending_queue_add(struct fimc_vid_cap *vid_cap,
775 struct fimc_vid_buffer *buf) 783 struct fimc_vid_buffer *buf)
776{ 784{
777 list_add_tail(&buf->list, &vid_cap->pending_buf_q); 785 list_add_tail(&buf->list, &vid_cap->pending_buf_q);
778} 786}
779 787
780/* Add video buffer to the capture pending buffers queue */ 788/**
781static inline struct fimc_vid_buffer * 789 * fimc_pending_queue_pop - pop buffer from the capture pending buffers queue
782pending_queue_pop(struct fimc_vid_cap *vid_cap) 790 *
791 * The caller must assure the pending_buf_q list is not empty.
792 */
793static inline struct fimc_vid_buffer *fimc_pending_queue_pop(
794 struct fimc_vid_cap *vid_cap)
783{ 795{
784 struct fimc_vid_buffer *buf; 796 struct fimc_vid_buffer *buf;
785 buf = list_entry(vid_cap->pending_buf_q.next, 797 buf = list_entry(vid_cap->pending_buf_q.next,