diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:35:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:35:11 -0400 |
commit | 0851668fdd97e526b2a41f794b785c204dd3d3e0 (patch) | |
tree | 4ef7c20a8be8393006c6fe9627eb29dd30877d61 /drivers/media/video/videobuf-dma-contig.c | |
parent | 00ebb6382b8d9c7c15b5f8ad230670d8161d38dd (diff) | |
parent | 7655e594945289b418af39f6669fea4666a7b520 (diff) |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (505 commits)
[media] af9015: Fix max I2C message size when used with tda18271
[media] IR: initialize ir_raw_event in few more drivers
[media] Guard a divide in v4l1 compat layer
[media] imon: fix nomouse modprobe option
[media] imon: remove redundant change_protocol call
[media] imon: fix my egregious brown paper bag w/rdev/idev split
[media] cafe_ccic: Configure ov7670 correctly
[media] ov7670: allow configuration of image size, clock speed, and I/O method
[media] af9015: support for DigitalNow TinyTwin v3 [1f4d:9016]
[media] af9015: map DigitalNow TinyTwin v2 remote
[media] DigitalNow TinyTwin remote controller
[media] af9015: RC fixes and improvements
videodev2.h.xml: Update to reflect the latest changes at videodev2.h
[media] v4l: document new Bayer and monochrome pixel formats
[media] DocBook/v4l: Add missing formats used on gspca cpia1 and sn9c2028
[media] firedtv: add parameter to fake ca_system_ids in CA_INFO
[media] tm6000: fix a macro coding style issue
tm6000: Remove some ugly debug code
[media] Nova-S-Plus audio line input
[media] [RFC,1/1] V4L2: Use new CAP bits in existing RDS capable drivers
...
Diffstat (limited to 'drivers/media/video/videobuf-dma-contig.c')
-rw-r--r-- | drivers/media/video/videobuf-dma-contig.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/media/video/videobuf-dma-contig.c b/drivers/media/video/videobuf-dma-contig.c index 6ff9e4bac3ea..c9691115f2d2 100644 --- a/drivers/media/video/videobuf-dma-contig.c +++ b/drivers/media/video/videobuf-dma-contig.c | |||
@@ -28,7 +28,6 @@ struct videobuf_dma_contig_memory { | |||
28 | void *vaddr; | 28 | void *vaddr; |
29 | dma_addr_t dma_handle; | 29 | dma_addr_t dma_handle; |
30 | unsigned long size; | 30 | unsigned long size; |
31 | int is_userptr; | ||
32 | }; | 31 | }; |
33 | 32 | ||
34 | #define MAGIC_DC_MEM 0x0733ac61 | 33 | #define MAGIC_DC_MEM 0x0733ac61 |
@@ -63,7 +62,7 @@ static void videobuf_vm_close(struct vm_area_struct *vma) | |||
63 | struct videobuf_dma_contig_memory *mem; | 62 | struct videobuf_dma_contig_memory *mem; |
64 | 63 | ||
65 | dev_dbg(q->dev, "munmap %p q=%p\n", map, q); | 64 | dev_dbg(q->dev, "munmap %p q=%p\n", map, q); |
66 | mutex_lock(&q->vb_lock); | 65 | videobuf_queue_lock(q); |
67 | 66 | ||
68 | /* We need first to cancel streams, before unmapping */ | 67 | /* We need first to cancel streams, before unmapping */ |
69 | if (q->streaming) | 68 | if (q->streaming) |
@@ -103,7 +102,7 @@ static void videobuf_vm_close(struct vm_area_struct *vma) | |||
103 | 102 | ||
104 | kfree(map); | 103 | kfree(map); |
105 | 104 | ||
106 | mutex_unlock(&q->vb_lock); | 105 | videobuf_queue_unlock(q); |
107 | } | 106 | } |
108 | } | 107 | } |
109 | 108 | ||
@@ -120,7 +119,6 @@ static const struct vm_operations_struct videobuf_vm_ops = { | |||
120 | */ | 119 | */ |
121 | static void videobuf_dma_contig_user_put(struct videobuf_dma_contig_memory *mem) | 120 | static void videobuf_dma_contig_user_put(struct videobuf_dma_contig_memory *mem) |
122 | { | 121 | { |
123 | mem->is_userptr = 0; | ||
124 | mem->dma_handle = 0; | 122 | mem->dma_handle = 0; |
125 | mem->size = 0; | 123 | mem->size = 0; |
126 | } | 124 | } |
@@ -147,7 +145,6 @@ static int videobuf_dma_contig_user_get(struct videobuf_dma_contig_memory *mem, | |||
147 | 145 | ||
148 | offset = vb->baddr & ~PAGE_MASK; | 146 | offset = vb->baddr & ~PAGE_MASK; |
149 | mem->size = PAGE_ALIGN(vb->size + offset); | 147 | mem->size = PAGE_ALIGN(vb->size + offset); |
150 | mem->is_userptr = 0; | ||
151 | ret = -EINVAL; | 148 | ret = -EINVAL; |
152 | 149 | ||
153 | down_read(&mm->mmap_sem); | 150 | down_read(&mm->mmap_sem); |
@@ -181,9 +178,6 @@ static int videobuf_dma_contig_user_get(struct videobuf_dma_contig_memory *mem, | |||
181 | pages_done++; | 178 | pages_done++; |
182 | } | 179 | } |
183 | 180 | ||
184 | if (!ret) | ||
185 | mem->is_userptr = 1; | ||
186 | |||
187 | out_up: | 181 | out_up: |
188 | up_read(¤t->mm->mmap_sem); | 182 | up_read(¤t->mm->mmap_sem); |
189 | 183 | ||
@@ -349,10 +343,11 @@ void videobuf_queue_dma_contig_init(struct videobuf_queue *q, | |||
349 | enum v4l2_buf_type type, | 343 | enum v4l2_buf_type type, |
350 | enum v4l2_field field, | 344 | enum v4l2_field field, |
351 | unsigned int msize, | 345 | unsigned int msize, |
352 | void *priv) | 346 | void *priv, |
347 | struct mutex *ext_lock) | ||
353 | { | 348 | { |
354 | videobuf_queue_core_init(q, ops, dev, irqlock, type, field, msize, | 349 | videobuf_queue_core_init(q, ops, dev, irqlock, type, field, msize, |
355 | priv, &qops); | 350 | priv, &qops, ext_lock); |
356 | } | 351 | } |
357 | EXPORT_SYMBOL_GPL(videobuf_queue_dma_contig_init); | 352 | EXPORT_SYMBOL_GPL(videobuf_queue_dma_contig_init); |
358 | 353 | ||