aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-yuv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-yuv.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-yuv.c22
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 */
1162int ivtv_yuv_prep_frame(struct ivtv *itv, struct ivtv_dma_frame *args) 1169int 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
1171void ivtv_yuv_close(struct ivtv *itv) 1185void 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);