Lines Matching defs:gobuf
54 static void deactivate_buffer(struct go7007_buffer *gobuf)
58 if (gobuf->state != BUF_STATE_IDLE) {
59 list_del(&gobuf->stream);
60 gobuf->state = BUF_STATE_IDLE;
62 if (gobuf->page_count > 0) {
63 for (i = 0; i < gobuf->page_count; ++i)
64 page_cache_release(gobuf->pages[i]);
65 gobuf->page_count = 0;
71 struct go7007_buffer *gobuf, *next;
73 list_for_each_entry_safe(gobuf, next, &go->stream, stream) {
74 deactivate_buffer(gobuf);
133 static u32 get_frame_type_flag(struct go7007_buffer *gobuf, int format)
135 u8 *f = page_address(gobuf->pages[0]);
141 switch ((f[gobuf->frame_offset + 4] >> 6) & 0x3) {
153 switch ((f[gobuf->frame_offset + 5] >> 3) & 0x7) {
749 struct go7007_buffer *gobuf;
762 gobuf = &gofh->bufs[buf->index];
763 if (!gobuf->mapped)
767 if (gobuf->state != BUF_STATE_IDLE)
771 gobuf->offset = gobuf->user_addr & ~PAGE_MASK;
772 gobuf->bytesused = 0;
773 gobuf->frame_offset = 0;
774 gobuf->modet_active = 0;
775 if (gobuf->offset > 0)
776 gobuf->page_count = GO7007_BUF_PAGES + 1;
778 gobuf->page_count = GO7007_BUF_PAGES;
783 gobuf->user_addr & PAGE_MASK, gobuf->page_count,
784 1, 1, gobuf->pages, NULL);
787 if (ret != gobuf->page_count) {
790 page_cache_release(gobuf->pages[i]);
791 gobuf->page_count = 0;
795 gobuf->state = BUF_STATE_QUEUED;
797 list_add_tail(&gobuf->stream, &go->stream);
813 struct go7007_buffer *gobuf;
827 gobuf = list_entry(go->stream.next,
831 if (gobuf->state != BUF_STATE_DONE &&
836 if (gobuf->state == BUF_STATE_DONE)
846 if (gobuf->state != BUF_STATE_DONE)
850 deactivate_buffer(gobuf);
852 frame_type_flag = get_frame_type_flag(gobuf, go->format);
853 gobuf->state = BUF_STATE_IDLE;
856 buf->index = gobuf->index;
858 buf->bytesused = gobuf->bytesused;
861 buf->timestamp = gobuf->timestamp;
862 buf->sequence = gobuf->seq;
864 buf->m.offset = gobuf->index * GO7007_BUF_SIZE;
866 buf->reserved = gobuf->modet_active;
1357 struct go7007_buffer *gobuf = vma->vm_private_data;
1359 ++gobuf->mapped;
1364 struct go7007_buffer *gobuf = vma->vm_private_data;
1367 if (--gobuf->mapped == 0) {
1368 spin_lock_irqsave(&gobuf->go->spinlock, flags);
1369 deactivate_buffer(gobuf);
1370 spin_unlock_irqrestore(&gobuf->go->spinlock, flags);
1431 struct go7007_buffer *gobuf;
1435 gobuf = list_entry(gofh->go->stream.next, struct go7007_buffer, stream);
1437 if (gobuf->state == BUF_STATE_DONE)