Lines Matching defs:output

79 	struct stf_v_buf *output = &cap->buffers;
82 output->active_buf = 0;
84 if (!output->buf[0])
87 addr0 = output->buf[0]->addr[0];
88 addr1 = output->buf[0]->addr[1];
96 static struct stfcamss_buffer *stf_buf_get_pending(struct stf_v_buf *output)
100 if (!list_empty(&output->pending_bufs)) {
101 buffer = list_first_entry(&output->pending_bufs,
113 struct stf_v_buf *output = &cap->buffers;
116 spin_lock_irqsave(&output->lock, flags);
118 output->state = STF_OUTPUT_IDLE;
119 output->buf[0] = stf_buf_get_pending(output);
121 if (!output->buf[0] && output->buf[1]) {
122 output->buf[0] = output->buf[1];
123 output->buf[1] = NULL;
126 if (output->buf[0])
127 output->state = STF_OUTPUT_SINGLE;
129 output->sequence = 0;
132 spin_unlock_irqrestore(&output->lock, flags);
138 struct stf_v_buf *output = &cap->buffers;
141 spin_lock_irqsave(&output->lock, flags);
143 output->state = STF_OUTPUT_OFF;
145 spin_unlock_irqrestore(&output->lock, flags);
266 static void stf_buf_add_ready(struct stf_v_buf *output,
270 list_add_tail(&buffer->queue, &output->ready_bufs);
273 static struct stfcamss_buffer *stf_buf_get_ready(struct stf_v_buf *output)
277 if (!list_empty(&output->ready_bufs)) {
278 buffer = list_first_entry(&output->ready_bufs,
287 static void stf_buf_add_pending(struct stf_v_buf *output,
291 list_add_tail(&buffer->queue, &output->pending_bufs);
294 static void stf_buf_update_on_last(struct stf_v_buf *output)
296 switch (output->state) {
298 output->state = STF_OUTPUT_SINGLE;
299 output->active_buf = !output->active_buf;
302 output->state = STF_OUTPUT_STOPPING;
309 static void stf_buf_update_on_next(struct stf_v_buf *output)
311 switch (output->state) {
313 output->active_buf = !output->active_buf;
325 struct stf_v_buf *output = &cap->buffers;
327 switch (output->state) {
329 stf_buf_add_pending(output, new_buf);
332 if (!output->buf[0]) {
333 output->buf[0] = new_buf;
335 output->state = STF_OUTPUT_SINGLE;
337 stf_buf_add_pending(output, new_buf);
341 if (output->last_buffer) {
342 output->buf[output->active_buf] = output->last_buffer;
343 output->last_buffer = NULL;
346 output->state = STF_OUTPUT_SINGLE;
347 stf_buf_add_pending(output, new_buf);
351 stf_buf_add_pending(output, new_buf);
356 static void stf_buf_flush(struct stf_v_buf *output, enum vb2_buffer_state state)
361 list_for_each_entry_safe(buf, t, &output->pending_bufs, queue) {
365 list_for_each_entry_safe(buf, t, &output->ready_bufs, queue) {
371 static void stf_buf_done(struct stf_v_buf *output)
377 if (output->state == STF_OUTPUT_OFF ||
378 output->state == STF_OUTPUT_RESERVED)
381 spin_lock_irqsave(&output->lock, flags);
383 while ((ready_buf = stf_buf_get_ready(output))) {
385 ready_buf->vb.sequence = output->sequence++;
390 spin_unlock_irqrestore(&output->lock, flags);
393 static void stf_change_buffer(struct stf_v_buf *output)
395 struct stf_capture *cap = container_of(output, struct stf_capture,
403 if (output->state == STF_OUTPUT_OFF ||
404 output->state == STF_OUTPUT_STOPPING ||
405 output->state == STF_OUTPUT_RESERVED ||
406 output->state == STF_OUTPUT_IDLE)
409 spin_lock_irqsave(&output->lock, flags);
411 active_index = output->active_buf;
413 ready_buf = output->buf[active_index];
416 active_index, output->state);
418 ready_buf = output->buf[active_index];
422 active_index, output->state);
428 output->buf[active_index] = stf_buf_get_pending(output);
429 if (!output->buf[active_index]) {
431 stf_buf_update_on_last(output);
433 new_addr = output->buf[active_index]->addr;
434 stf_buf_update_on_next(output);
437 if (output->state == STF_OUTPUT_STOPPING) {
438 output->last_buffer = ready_buf;
445 stf_buf_add_ready(output, ready_buf);
449 spin_unlock_irqrestore(&output->lock, flags);