Loading drivers/media/video/videobuf-core.c +146 −146 Original line number Diff line number Diff line Loading @@ -22,18 +22,21 @@ #include <media/videobuf-core.h> #define MAGIC_BUFFER 0x20070728 #define MAGIC_CHECK(is,should) if (unlikely((is) != (should))) \ { printk(KERN_ERR "magic mismatch: %x (expected %x)\n",is,should); BUG(); } #define MAGIC_CHECK(is, should) do { \ if (unlikely((is) != (should))) { \ printk(KERN_ERR "magic mismatch: %x (expected %x)\n", is, should); \ BUG(); } } while (0) static int debug = 0; static int debug; module_param(debug, int, 0644); MODULE_DESCRIPTION("helper module to manage video4linux buffers"); MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); MODULE_LICENSE("GPL"); #define dprintk(level, fmt, arg...) if (debug >= level) \ printk(KERN_DEBUG "vbuf: " fmt , ## arg) #define dprintk(level, fmt, arg...) do { \ if (debug >= level) \ printk(KERN_DEBUG "vbuf: " fmt , ## arg); } while (0) /* --------------------------------------------------------------------- */ Loading Loading @@ -75,7 +78,8 @@ int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr) } set_current_state(intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); if (vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED) if (vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED) schedule(); set_current_state(TASK_RUNNING); if (intr && signal_pending(current)) { Loading @@ -94,8 +98,8 @@ int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb, MAGIC_CHECK(vb->magic, MAGIC_BUFFER); MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS); /* FIXME: This is required to avoid OOPS on some cases, since mmap_mapper() method should be called before _iolock. /* FIXME: This is required to avoid OOPS on some cases, since mmap_mapper() method should be called before _iolock. On some cases, the mmap_mapper() is called only after scheduling. However, this way is just too dirty! Better to wait for some event. Loading Loading @@ -516,7 +520,8 @@ int videobuf_qbuf(struct videobuf_queue *q, switch (b->memory) { case V4L2_MEMORY_MMAP: if (0 == buf->baddr) { dprintk(1,"qbuf: mmap requested but buffer addr is zero!\n"); dprintk(1, "qbuf: mmap requested " "but buffer addr is zero!\n"); goto done; } break; Loading @@ -525,7 +530,8 @@ int videobuf_qbuf(struct videobuf_queue *q, dprintk(1, "qbuf: buffer length is not enough\n"); goto done; } if (VIDEOBUF_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr) if (VIDEOBUF_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr) q->ops->buf_release(q, buf); buf->baddr = b->m.userptr; break; Loading Loading @@ -1079,9 +1085,3 @@ EXPORT_SYMBOL_GPL(videobuf_poll_stream); EXPORT_SYMBOL_GPL(videobuf_mmap_setup); EXPORT_SYMBOL_GPL(videobuf_mmap_free); EXPORT_SYMBOL_GPL(videobuf_mmap_mapper); /* * Local variables: * c-basic-offset: 8 * End: */ Loading
drivers/media/video/videobuf-core.c +146 −146 Original line number Diff line number Diff line Loading @@ -22,18 +22,21 @@ #include <media/videobuf-core.h> #define MAGIC_BUFFER 0x20070728 #define MAGIC_CHECK(is,should) if (unlikely((is) != (should))) \ { printk(KERN_ERR "magic mismatch: %x (expected %x)\n",is,should); BUG(); } #define MAGIC_CHECK(is, should) do { \ if (unlikely((is) != (should))) { \ printk(KERN_ERR "magic mismatch: %x (expected %x)\n", is, should); \ BUG(); } } while (0) static int debug = 0; static int debug; module_param(debug, int, 0644); MODULE_DESCRIPTION("helper module to manage video4linux buffers"); MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); MODULE_LICENSE("GPL"); #define dprintk(level, fmt, arg...) if (debug >= level) \ printk(KERN_DEBUG "vbuf: " fmt , ## arg) #define dprintk(level, fmt, arg...) do { \ if (debug >= level) \ printk(KERN_DEBUG "vbuf: " fmt , ## arg); } while (0) /* --------------------------------------------------------------------- */ Loading Loading @@ -75,7 +78,8 @@ int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr) } set_current_state(intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); if (vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED) if (vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED) schedule(); set_current_state(TASK_RUNNING); if (intr && signal_pending(current)) { Loading @@ -94,8 +98,8 @@ int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb, MAGIC_CHECK(vb->magic, MAGIC_BUFFER); MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS); /* FIXME: This is required to avoid OOPS on some cases, since mmap_mapper() method should be called before _iolock. /* FIXME: This is required to avoid OOPS on some cases, since mmap_mapper() method should be called before _iolock. On some cases, the mmap_mapper() is called only after scheduling. However, this way is just too dirty! Better to wait for some event. Loading Loading @@ -516,7 +520,8 @@ int videobuf_qbuf(struct videobuf_queue *q, switch (b->memory) { case V4L2_MEMORY_MMAP: if (0 == buf->baddr) { dprintk(1,"qbuf: mmap requested but buffer addr is zero!\n"); dprintk(1, "qbuf: mmap requested " "but buffer addr is zero!\n"); goto done; } break; Loading @@ -525,7 +530,8 @@ int videobuf_qbuf(struct videobuf_queue *q, dprintk(1, "qbuf: buffer length is not enough\n"); goto done; } if (VIDEOBUF_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr) if (VIDEOBUF_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr) q->ops->buf_release(q, buf); buf->baddr = b->m.userptr; break; Loading Loading @@ -1079,9 +1085,3 @@ EXPORT_SYMBOL_GPL(videobuf_poll_stream); EXPORT_SYMBOL_GPL(videobuf_mmap_setup); EXPORT_SYMBOL_GPL(videobuf_mmap_free); EXPORT_SYMBOL_GPL(videobuf_mmap_mapper); /* * Local variables: * c-basic-offset: 8 * End: */