diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-18 15:53:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-18 15:53:54 -0500 |
commit | 4a7c1ff2362b7bfbc04990f42c21cefdff57f997 (patch) | |
tree | 82ac9c30ca95b6a92084f5535e6406866eb99cf3 /drivers/media/video/ivtv/ivtv-yuv.c | |
parent | 9278e634b4e063f415b46923a9ca4e74f42ec932 (diff) | |
parent | 36be126cb0ebe3000a65c1049f339a3e882a9a47 (diff) |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (57 commits)
[media] as3645a: Fix compilation by including slab.h
[media] s5p-fimc: Remove linux/version.h include from fimc-mdevice.c
[media] s5p-mfc: Remove linux/version.h include from s5p_mfc.c
[media] ds3000: using logical && instead of bitwise &
[media] v4l2-ctrls: make control names consistent
[media] DVB: dib0700, add support for Nova-TD LEDs
[media] DVB: dib0700, add corrected Nova-TD frontend_attach
[media] DVB: dib0700, separate stk7070pd initialization
[media] DVB: dib0700, move Nova-TD Stick to a separate set
[media] : add MODULE_FIRMWARE to dib0700
[media] DVB-CORE: remove superfluous DTV_CMDs
[media] s5p-jpeg: adapt to recent videobuf2 changes
[media] s5p-g2d: fixed a bug in controls setting function
[media] s5p-mfc: Fix volatile controls setup
[media] drivers/media/video/s5p-mfc/s5p_mfc.c: adjust double test
[media] drivers/media/video/s5p-fimc/fimc-capture.c: adjust double test
[media] s5p-fimc: Fix incorrect control ID assignment
[media] dvb_frontend: Don't call get_frontend() if idle
[media] DocBook/dvbproperty.xml: Remove DTV_MODULATION from ISDB-T
[media] DocBook/dvbproperty.xml: Fix ISDB-T delivery system parameters
...
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-yuv.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-yuv.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/media/video/ivtv/ivtv-yuv.c b/drivers/media/video/ivtv/ivtv-yuv.c index dcbab6ad4c26..2ad65eb29832 100644 --- a/drivers/media/video/ivtv/ivtv-yuv.c +++ b/drivers/media/video/ivtv/ivtv-yuv.c | |||
@@ -1149,23 +1149,37 @@ int ivtv_yuv_udma_stream_frame(struct ivtv *itv, void __user *src) | |||
1149 | { | 1149 | { |
1150 | struct yuv_playback_info *yi = &itv->yuv_info; | 1150 | struct yuv_playback_info *yi = &itv->yuv_info; |
1151 | struct ivtv_dma_frame dma_args; | 1151 | struct ivtv_dma_frame dma_args; |
1152 | int res; | ||
1152 | 1153 | ||
1153 | ivtv_yuv_setup_stream_frame(itv); | 1154 | ivtv_yuv_setup_stream_frame(itv); |
1154 | 1155 | ||
1155 | /* We only need to supply source addresses for this */ | 1156 | /* We only need to supply source addresses for this */ |
1156 | dma_args.y_source = src; | 1157 | dma_args.y_source = src; |
1157 | dma_args.uv_source = src + 720 * ((yi->v4l2_src_h + 31) & ~31); | 1158 | dma_args.uv_source = src + 720 * ((yi->v4l2_src_h + 31) & ~31); |
1158 | return ivtv_yuv_udma_frame(itv, &dma_args); | 1159 | /* Wait for frame DMA. Note that serialize_lock is locked, |
1160 | so to allow other processes to access the driver while | ||
1161 | we are waiting unlock first and later lock again. */ | ||
1162 | mutex_unlock(&itv->serialize_lock); | ||
1163 | res = ivtv_yuv_udma_frame(itv, &dma_args); | ||
1164 | mutex_lock(&itv->serialize_lock); | ||
1165 | return res; | ||
1159 | } | 1166 | } |
1160 | 1167 | ||
1161 | /* IVTV_IOC_DMA_FRAME ioctl handler */ | 1168 | /* IVTV_IOC_DMA_FRAME ioctl handler */ |
1162 | int ivtv_yuv_prep_frame(struct ivtv *itv, struct ivtv_dma_frame *args) | 1169 | int ivtv_yuv_prep_frame(struct ivtv *itv, struct ivtv_dma_frame *args) |
1163 | { | 1170 | { |
1164 | /* IVTV_DEBUG_INFO("yuv_prep_frame\n"); */ | 1171 | int res; |
1165 | 1172 | ||
1173 | /* IVTV_DEBUG_INFO("yuv_prep_frame\n"); */ | ||
1166 | ivtv_yuv_next_free(itv); | 1174 | ivtv_yuv_next_free(itv); |
1167 | ivtv_yuv_setup_frame(itv, args); | 1175 | ivtv_yuv_setup_frame(itv, args); |
1168 | return ivtv_yuv_udma_frame(itv, args); | 1176 | /* Wait for frame DMA. Note that serialize_lock is locked, |
1177 | so to allow other processes to access the driver while | ||
1178 | we are waiting unlock first and later lock again. */ | ||
1179 | mutex_unlock(&itv->serialize_lock); | ||
1180 | res = ivtv_yuv_udma_frame(itv, args); | ||
1181 | mutex_lock(&itv->serialize_lock); | ||
1182 | return res; | ||
1169 | } | 1183 | } |
1170 | 1184 | ||
1171 | void ivtv_yuv_close(struct ivtv *itv) | 1185 | void ivtv_yuv_close(struct ivtv *itv) |
@@ -1174,7 +1188,9 @@ void ivtv_yuv_close(struct ivtv *itv) | |||
1174 | int h_filter, v_filter_1, v_filter_2; | 1188 | int h_filter, v_filter_1, v_filter_2; |
1175 | 1189 | ||
1176 | IVTV_DEBUG_YUV("ivtv_yuv_close\n"); | 1190 | IVTV_DEBUG_YUV("ivtv_yuv_close\n"); |
1191 | mutex_unlock(&itv->serialize_lock); | ||
1177 | ivtv_waitq(&itv->vsync_waitq); | 1192 | ivtv_waitq(&itv->vsync_waitq); |
1193 | mutex_lock(&itv->serialize_lock); | ||
1178 | 1194 | ||
1179 | yi->running = 0; | 1195 | yi->running = 0; |
1180 | atomic_set(&yi->next_dma_frame, -1); | 1196 | atomic_set(&yi->next_dma_frame, -1); |