Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: atomisp: Call media_pipeline_alloc_start() in stream start

Call media_pipeline_alloc_start() from atomisp_start_streaming() to mark
all involved subdevs as busy so that the links cannot be changed through
the media-controller APIs while streaming.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Hans de Goede and committed by
Mauro Carvalho Chehab
1c3432df 20a7f799

+16
+15
drivers/staging/media/atomisp/pci/atomisp_ioctl.c
··· 902 902 if (ret) 903 903 goto out_unlock; 904 904 905 + /* 906 + * When running a classic v4l2 app after a media-controller aware 907 + * app, the CSI-receiver -> ISP link for the current sensor may be 908 + * disabled. Fix this up before marking the pipeline as started. 909 + */ 910 + mutex_lock(&isp->media_dev.graph_mutex); 911 + atomisp_setup_input_links(isp); 912 + ret = __media_pipeline_start(&asd->video_out.vdev.entity.pads[0], &asd->video_out.pipe); 913 + mutex_unlock(&isp->media_dev.graph_mutex); 914 + if (ret) { 915 + dev_err(isp->dev, "Error starting mc pipline: %d\n", ret); 916 + goto out_unlock; 917 + } 918 + 905 919 /* Input system HW workaround */ 906 920 atomisp_dma_burst_len_cfg(asd); 907 921 ··· 1068 1054 if (ret) 1069 1055 dev_warn(isp->dev, "Recreating streams failed: %d\n", ret); 1070 1056 1057 + media_pipeline_stop(&asd->video_out.vdev.entity.pads[0]); 1071 1058 mutex_unlock(&isp->mutex); 1072 1059 } 1073 1060
+1
drivers/staging/media/atomisp/pci/atomisp_subdev.h
··· 49 49 struct video_device vdev; 50 50 enum v4l2_buf_type type; 51 51 struct media_pad pad; 52 + struct media_pipeline pipe; 52 53 struct vb2_queue vb_queue; 53 54 /* Lock for vb_queue, when also taking isp->mutex this must be taken first! */ 54 55 struct mutex vb_queue_mutex;