[renesas-drivers:master 38/42] drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c:141:29: error: passing argument 1 of 'media_pipeline_start' from incompatible pointer type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git master
head:   8fcf767e3b3cb218f3a4857d017c2363a86d6d1c
commit: 7a6442ed0ab855d764a0cc6e36d944e650543314 [38/42] Merge branch 'gmsl/for-renesas-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar into renesas-drivers
config: i386-allyesconfig (attached as .config)
compiler: gcc-8 (Debian 8.2.0-14) 8.2.0
reproduce:
        git checkout 7a6442ed0ab855d764a0cc6e36d944e650543314
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c: In function 'sun6i_video_start_streaming':
>> drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c:141:29: error: passing argument 1 of 'media_pipeline_start' from incompatible pointer type [-Werror=incompatible-pointer-types]
     ret = media_pipeline_start(&video->vdev.entity, &video->vdev.pipe);
                                ^~~~~~~~~~~~~~~~~~~
   In file included from include/media/media-device.h:26,
                    from include/media/v4l2-device.h:24,
                    from drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c:10:
   include/media/media-entity.h:1030:84: note: expected 'struct media_pad *' but argument is of type 'struct media_entity *'
    __must_check int media_pipeline_start(struct media_pad *pad,
                                                                                       ^  
>> drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c:205:22: error: passing argument 1 of 'media_pipeline_stop' from incompatible pointer type [-Werror=incompatible-pointer-types]
     media_pipeline_stop(&video->vdev.entity);
                         ^~~~~~~~~~~~~~~~~~~
   In file included from include/media/media-device.h:26,
                    from include/media/v4l2-device.h:24,
                    from drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c:10:
   include/media/media-entity.h:1055:44: note: expected 'struct media_pad *' but argument is of type 'struct media_entity *'
    void media_pipeline_stop(struct media_pad *pad);
                             ~~~~~~~~~~~~~~~~~~^~~
   drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c: In function 'sun6i_video_stop_streaming':
   drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c:229:22: error: passing argument 1 of 'media_pipeline_stop' from incompatible pointer type [-Werror=incompatible-pointer-types]
     media_pipeline_stop(&video->vdev.entity);
                         ^~~~~~~~~~~~~~~~~~~
   In file included from include/media/media-device.h:26,
                    from include/media/v4l2-device.h:24,
                    from drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c:10:
   include/media/media-entity.h:1055:44: note: expected 'struct media_pad *' but argument is of type 'struct media_entity *'
    void media_pipeline_stop(struct media_pad *pad);
                             ~~~~~~~~~~~~~~~~~~^~~
   cc1: some warnings being treated as errors

vim +/media_pipeline_start +141 drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c

5cc7522d Yong Deng 2018-10-30  128  
5cc7522d Yong Deng 2018-10-30  129  static int sun6i_video_start_streaming(struct vb2_queue *vq, unsigned int count)
5cc7522d Yong Deng 2018-10-30  130  {
5cc7522d Yong Deng 2018-10-30  131  	struct sun6i_video *video = vb2_get_drv_priv(vq);
5cc7522d Yong Deng 2018-10-30  132  	struct sun6i_csi_buffer *buf;
5cc7522d Yong Deng 2018-10-30  133  	struct sun6i_csi_buffer *next_buf;
5cc7522d Yong Deng 2018-10-30  134  	struct sun6i_csi_config config;
5cc7522d Yong Deng 2018-10-30  135  	struct v4l2_subdev *subdev;
5cc7522d Yong Deng 2018-10-30  136  	unsigned long flags;
5cc7522d Yong Deng 2018-10-30  137  	int ret;
5cc7522d Yong Deng 2018-10-30  138  
5cc7522d Yong Deng 2018-10-30  139  	video->sequence = 0;
5cc7522d Yong Deng 2018-10-30  140  
5cc7522d Yong Deng 2018-10-30 @141  	ret = media_pipeline_start(&video->vdev.entity, &video->vdev.pipe);
5cc7522d Yong Deng 2018-10-30  142  	if (ret < 0)
5cc7522d Yong Deng 2018-10-30  143  		goto clear_dma_queue;
5cc7522d Yong Deng 2018-10-30  144  
5cc7522d Yong Deng 2018-10-30  145  	if (video->mbus_code == 0) {
5cc7522d Yong Deng 2018-10-30  146  		ret = -EINVAL;
5cc7522d Yong Deng 2018-10-30  147  		goto stop_media_pipeline;
5cc7522d Yong Deng 2018-10-30  148  	}
5cc7522d Yong Deng 2018-10-30  149  
5cc7522d Yong Deng 2018-10-30  150  	subdev = sun6i_video_remote_subdev(video, NULL);
5cc7522d Yong Deng 2018-10-30  151  	if (!subdev)
5cc7522d Yong Deng 2018-10-30  152  		goto stop_media_pipeline;
5cc7522d Yong Deng 2018-10-30  153  
5cc7522d Yong Deng 2018-10-30  154  	config.pixelformat = video->fmt.fmt.pix.pixelformat;
5cc7522d Yong Deng 2018-10-30  155  	config.code = video->mbus_code;
5cc7522d Yong Deng 2018-10-30  156  	config.field = video->fmt.fmt.pix.field;
5cc7522d Yong Deng 2018-10-30  157  	config.width = video->fmt.fmt.pix.width;
5cc7522d Yong Deng 2018-10-30  158  	config.height = video->fmt.fmt.pix.height;
5cc7522d Yong Deng 2018-10-30  159  
5cc7522d Yong Deng 2018-10-30  160  	ret = sun6i_csi_update_config(video->csi, &config);
5cc7522d Yong Deng 2018-10-30  161  	if (ret < 0)
5cc7522d Yong Deng 2018-10-30  162  		goto stop_media_pipeline;
5cc7522d Yong Deng 2018-10-30  163  
5cc7522d Yong Deng 2018-10-30  164  	spin_lock_irqsave(&video->dma_queue_lock, flags);
5cc7522d Yong Deng 2018-10-30  165  
5cc7522d Yong Deng 2018-10-30  166  	buf = list_first_entry(&video->dma_queue,
5cc7522d Yong Deng 2018-10-30  167  			       struct sun6i_csi_buffer, list);
5cc7522d Yong Deng 2018-10-30  168  	buf->queued_to_csi = true;
5cc7522d Yong Deng 2018-10-30  169  	sun6i_csi_update_buf_addr(video->csi, buf->dma_addr);
5cc7522d Yong Deng 2018-10-30  170  
5cc7522d Yong Deng 2018-10-30  171  	sun6i_csi_set_stream(video->csi, true);
5cc7522d Yong Deng 2018-10-30  172  
5cc7522d Yong Deng 2018-10-30  173  	/*
5cc7522d Yong Deng 2018-10-30  174  	 * CSI will lookup the next dma buffer for next frame before the
5cc7522d Yong Deng 2018-10-30  175  	 * the current frame done IRQ triggered. This is not documented
5cc7522d Yong Deng 2018-10-30  176  	 * but reported by Ondřej Jirman.
5cc7522d Yong Deng 2018-10-30  177  	 * The BSP code has workaround for this too. It skip to mark the
5cc7522d Yong Deng 2018-10-30  178  	 * first buffer as frame done for VB2 and pass the second buffer
5cc7522d Yong Deng 2018-10-30  179  	 * to CSI in the first frame done ISR call. Then in second frame
5cc7522d Yong Deng 2018-10-30  180  	 * done ISR call, it mark the first buffer as frame done for VB2
5cc7522d Yong Deng 2018-10-30  181  	 * and pass the third buffer to CSI. And so on. The bad thing is
5cc7522d Yong Deng 2018-10-30  182  	 * that the first buffer will be written twice and the first frame
5cc7522d Yong Deng 2018-10-30  183  	 * is dropped even the queued buffer is sufficient.
5cc7522d Yong Deng 2018-10-30  184  	 * So, I make some improvement here. Pass the next buffer to CSI
5cc7522d Yong Deng 2018-10-30  185  	 * just follow starting the CSI. In this case, the first frame
5cc7522d Yong Deng 2018-10-30  186  	 * will be stored in first buffer, second frame in second buffer.
5cc7522d Yong Deng 2018-10-30  187  	 * This method is used to avoid dropping the first frame, it
5cc7522d Yong Deng 2018-10-30  188  	 * would also drop frame when lacking of queued buffer.
5cc7522d Yong Deng 2018-10-30  189  	 */
5cc7522d Yong Deng 2018-10-30  190  	next_buf = list_next_entry(buf, list);
5cc7522d Yong Deng 2018-10-30  191  	next_buf->queued_to_csi = true;
5cc7522d Yong Deng 2018-10-30  192  	sun6i_csi_update_buf_addr(video->csi, next_buf->dma_addr);
5cc7522d Yong Deng 2018-10-30  193  
5cc7522d Yong Deng 2018-10-30  194  	spin_unlock_irqrestore(&video->dma_queue_lock, flags);
5cc7522d Yong Deng 2018-10-30  195  
5cc7522d Yong Deng 2018-10-30  196  	ret = v4l2_subdev_call(subdev, video, s_stream, 1);
5cc7522d Yong Deng 2018-10-30  197  	if (ret && ret != -ENOIOCTLCMD)
5cc7522d Yong Deng 2018-10-30  198  		goto stop_csi_stream;
5cc7522d Yong Deng 2018-10-30  199  
5cc7522d Yong Deng 2018-10-30  200  	return 0;
5cc7522d Yong Deng 2018-10-30  201  
5cc7522d Yong Deng 2018-10-30  202  stop_csi_stream:
5cc7522d Yong Deng 2018-10-30  203  	sun6i_csi_set_stream(video->csi, false);
5cc7522d Yong Deng 2018-10-30  204  stop_media_pipeline:
5cc7522d Yong Deng 2018-10-30 @205  	media_pipeline_stop(&video->vdev.entity);
5cc7522d Yong Deng 2018-10-30  206  clear_dma_queue:
5cc7522d Yong Deng 2018-10-30  207  	spin_lock_irqsave(&video->dma_queue_lock, flags);
5cc7522d Yong Deng 2018-10-30  208  	list_for_each_entry(buf, &video->dma_queue, list)
5cc7522d Yong Deng 2018-10-30  209  		vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_QUEUED);
5cc7522d Yong Deng 2018-10-30  210  	INIT_LIST_HEAD(&video->dma_queue);
5cc7522d Yong Deng 2018-10-30  211  	spin_unlock_irqrestore(&video->dma_queue_lock, flags);
5cc7522d Yong Deng 2018-10-30  212  
5cc7522d Yong Deng 2018-10-30  213  	return ret;
5cc7522d Yong Deng 2018-10-30  214  }
5cc7522d Yong Deng 2018-10-30  215  

:::::: The code at line 141 was first introduced by commit
:::::: 5cc7522d89655770a4b838ea77aeedf62f151891 media: sun6i: Add support for Allwinner CSI V3s

:::::: TO: Yong Deng <yong.deng@xxxxxxxxxxxx>
:::::: CC: Mauro Carvalho Chehab <mchehab+samsung@xxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux