[ragnatech:media-tree 314/369] drivers/media/platform/vivid/vivid-vid-cap.c:565:34: error: macro "v4l2_find_nearest_size" requires 6 arguments, but only 5 given

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

 



tree:   git://git.ragnatech.se/linux media-tree
head:   238f694e1b7f8297f1256c57e41f69c39576c9b4
commit: ac53212880a1af2191fd469dab275b94cd9d13c8 [314/369] media: vivid: Use v4l2_find_nearest_size
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout ac53212880a1af2191fd469dab275b94cd9d13c8
        # save the attached .config to linux build tree
        make.cross ARCH=sh 

Note: the ragnatech/media-tree HEAD 238f694e1b7f8297f1256c57e41f69c39576c9b4 builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

   drivers/media/platform/vivid/vivid-vid-cap.c: In function 'vivid_try_fmt_vid_cap':
>> drivers/media/platform/vivid/vivid-vid-cap.c:565:34: error: macro "v4l2_find_nearest_size" requires 6 arguments, but only 5 given
                mp->width, mp->height);
                                     ^
>> drivers/media/platform/vivid/vivid-vid-cap.c:564:4: error: 'v4l2_find_nearest_size' undeclared (first use in this function); did you mean '__v4l2_find_nearest_size'?
       v4l2_find_nearest_size(webcam_sizes, width, height,
       ^~~~~~~~~~~~~~~~~~~~~~
       __v4l2_find_nearest_size
   drivers/media/platform/vivid/vivid-vid-cap.c:564:4: note: each undeclared identifier is reported only once for each function it appears in

vim +/v4l2_find_nearest_size +565 drivers/media/platform/vivid/vivid-vid-cap.c

ef834f783 Hans Verkuil            2014-08-25  540  
ef834f783 Hans Verkuil            2014-08-25  541  int vivid_try_fmt_vid_cap(struct file *file, void *priv,
ef834f783 Hans Verkuil            2014-08-25  542  			struct v4l2_format *f)
ef834f783 Hans Verkuil            2014-08-25  543  {
ef834f783 Hans Verkuil            2014-08-25  544  	struct v4l2_pix_format_mplane *mp = &f->fmt.pix_mp;
ef834f783 Hans Verkuil            2014-08-25  545  	struct v4l2_plane_pix_format *pfmt = mp->plane_fmt;
ef834f783 Hans Verkuil            2014-08-25  546  	struct vivid_dev *dev = video_drvdata(file);
ef834f783 Hans Verkuil            2014-08-25  547  	const struct vivid_fmt *fmt;
ef834f783 Hans Verkuil            2014-08-25  548  	unsigned bytesperline, max_bpl;
ef834f783 Hans Verkuil            2014-08-25  549  	unsigned factor = 1;
ef834f783 Hans Verkuil            2014-08-25  550  	unsigned w, h;
ef834f783 Hans Verkuil            2014-08-25  551  	unsigned p;
ef834f783 Hans Verkuil            2014-08-25  552  
1fc78bc9d Mauro Carvalho Chehab   2014-09-02  553  	fmt = vivid_get_format(dev, mp->pixelformat);
ef834f783 Hans Verkuil            2014-08-25  554  	if (!fmt) {
ef834f783 Hans Verkuil            2014-08-25  555  		dprintk(dev, 1, "Fourcc format (0x%08x) unknown.\n",
ef834f783 Hans Verkuil            2014-08-25  556  			mp->pixelformat);
ef834f783 Hans Verkuil            2014-08-25  557  		mp->pixelformat = V4L2_PIX_FMT_YUYV;
1fc78bc9d Mauro Carvalho Chehab   2014-09-02  558  		fmt = vivid_get_format(dev, mp->pixelformat);
ef834f783 Hans Verkuil            2014-08-25  559  	}
ef834f783 Hans Verkuil            2014-08-25  560  
ef834f783 Hans Verkuil            2014-08-25  561  	mp->field = vivid_field_cap(dev, mp->field);
ef834f783 Hans Verkuil            2014-08-25  562  	if (vivid_is_webcam(dev)) {
ef834f783 Hans Verkuil            2014-08-25  563  		const struct v4l2_frmsize_discrete *sz =
ac5321288 Sakari Ailus            2018-02-08 @564  			v4l2_find_nearest_size(webcam_sizes, width, height,
0545629e5 Mauro Carvalho Chehab   2017-09-22 @565  					       mp->width, mp->height);
ef834f783 Hans Verkuil            2014-08-25  566  
ef834f783 Hans Verkuil            2014-08-25  567  		w = sz->width;
ef834f783 Hans Verkuil            2014-08-25  568  		h = sz->height;
ef834f783 Hans Verkuil            2014-08-25  569  	} else if (vivid_is_sdtv_cap(dev)) {
ef834f783 Hans Verkuil            2014-08-25  570  		w = 720;
ef834f783 Hans Verkuil            2014-08-25  571  		h = (dev->std_cap & V4L2_STD_525_60) ? 480 : 576;
ef834f783 Hans Verkuil            2014-08-25  572  	} else {
ef834f783 Hans Verkuil            2014-08-25  573  		w = dev->src_rect.width;
ef834f783 Hans Verkuil            2014-08-25  574  		h = dev->src_rect.height;
ef834f783 Hans Verkuil            2014-08-25  575  	}
ef834f783 Hans Verkuil            2014-08-25  576  	if (V4L2_FIELD_HAS_T_OR_B(mp->field))
ef834f783 Hans Verkuil            2014-08-25  577  		factor = 2;
ef834f783 Hans Verkuil            2014-08-25  578  	if (vivid_is_webcam(dev) ||
ef834f783 Hans Verkuil            2014-08-25  579  	    (!dev->has_scaler_cap && !dev->has_crop_cap && !dev->has_compose_cap)) {
ef834f783 Hans Verkuil            2014-08-25  580  		mp->width = w;
ef834f783 Hans Verkuil            2014-08-25  581  		mp->height = h / factor;
ef834f783 Hans Verkuil            2014-08-25  582  	} else {
ef834f783 Hans Verkuil            2014-08-25  583  		struct v4l2_rect r = { 0, 0, mp->width, mp->height * factor };
ef834f783 Hans Verkuil            2014-08-25  584  
d1e5d8bd4 Hans Verkuil            2016-04-03  585  		v4l2_rect_set_min_size(&r, &vivid_min_rect);
d1e5d8bd4 Hans Verkuil            2016-04-03  586  		v4l2_rect_set_max_size(&r, &vivid_max_rect);
ef834f783 Hans Verkuil            2014-08-25  587  		if (dev->has_scaler_cap && !dev->has_compose_cap) {
ef834f783 Hans Verkuil            2014-08-25  588  			struct v4l2_rect max_r = { 0, 0, MAX_ZOOM * w, MAX_ZOOM * h };
ef834f783 Hans Verkuil            2014-08-25  589  
d1e5d8bd4 Hans Verkuil            2016-04-03  590  			v4l2_rect_set_max_size(&r, &max_r);
ef834f783 Hans Verkuil            2014-08-25  591  		} else if (!dev->has_scaler_cap && dev->has_crop_cap && !dev->has_compose_cap) {
d1e5d8bd4 Hans Verkuil            2016-04-03  592  			v4l2_rect_set_max_size(&r, &dev->src_rect);
ef834f783 Hans Verkuil            2014-08-25  593  		} else if (!dev->has_scaler_cap && !dev->has_crop_cap) {
d1e5d8bd4 Hans Verkuil            2016-04-03  594  			v4l2_rect_set_min_size(&r, &dev->src_rect);
ef834f783 Hans Verkuil            2014-08-25  595  		}
ef834f783 Hans Verkuil            2014-08-25  596  		mp->width = r.width;
ef834f783 Hans Verkuil            2014-08-25  597  		mp->height = r.height / factor;
ef834f783 Hans Verkuil            2014-08-25  598  	}
ef834f783 Hans Verkuil            2014-08-25  599  
ef834f783 Hans Verkuil            2014-08-25  600  	/* This driver supports custom bytesperline values */
ef834f783 Hans Verkuil            2014-08-25  601  
ddcaee9dd Hans Verkuil            2015-03-09  602  	mp->num_planes = fmt->buffers;
5086924ad Hans Verkuil            2017-03-06  603  	for (p = 0; p < fmt->buffers; p++) {
ef834f783 Hans Verkuil            2014-08-25  604  		/* Calculate the minimum supported bytesperline value */
ddcaee9dd Hans Verkuil            2015-03-09  605  		bytesperline = (mp->width * fmt->bit_depth[p]) >> 3;
ef834f783 Hans Verkuil            2014-08-25  606  		/* Calculate the maximum supported bytesperline value */
ddcaee9dd Hans Verkuil            2015-03-09  607  		max_bpl = (MAX_ZOOM * MAX_WIDTH * fmt->bit_depth[p]) >> 3;
ddcaee9dd Hans Verkuil            2015-03-09  608  
ef834f783 Hans Verkuil            2014-08-25  609  		if (pfmt[p].bytesperline > max_bpl)
ef834f783 Hans Verkuil            2014-08-25  610  			pfmt[p].bytesperline = max_bpl;
ef834f783 Hans Verkuil            2014-08-25  611  		if (pfmt[p].bytesperline < bytesperline)
ef834f783 Hans Verkuil            2014-08-25  612  			pfmt[p].bytesperline = bytesperline;
5086924ad Hans Verkuil            2017-03-06  613  
5086924ad Hans Verkuil            2017-03-06  614  		pfmt[p].sizeimage = (pfmt[p].bytesperline * mp->height) /
5086924ad Hans Verkuil            2017-03-06  615  				fmt->vdownsampling[p] + fmt->data_offset[p];
5086924ad Hans Verkuil            2017-03-06  616  
ef834f783 Hans Verkuil            2014-08-25  617  		memset(pfmt[p].reserved, 0, sizeof(pfmt[p].reserved));
ef834f783 Hans Verkuil            2014-08-25  618  	}
5086924ad Hans Verkuil            2017-03-06  619  	for (p = fmt->buffers; p < fmt->planes; p++)
5086924ad Hans Verkuil            2017-03-06  620  		pfmt[0].sizeimage += (pfmt[0].bytesperline * mp->height *
5086924ad Hans Verkuil            2017-03-06  621  			(fmt->bit_depth[p] / fmt->vdownsampling[p])) /
5086924ad Hans Verkuil            2017-03-06  622  			(fmt->bit_depth[0] / fmt->vdownsampling[0]);
5086924ad Hans Verkuil            2017-03-06  623  
ef834f783 Hans Verkuil            2014-08-25  624  	mp->colorspace = vivid_colorspace_cap(dev);
429175e41 Ricardo Ribalda Delgado 2016-07-18  625  	if (fmt->color_enc == TGP_COLOR_ENC_HSV)
429175e41 Ricardo Ribalda Delgado 2016-07-18  626  		mp->hsv_enc = vivid_hsv_enc_cap(dev);
429175e41 Ricardo Ribalda Delgado 2016-07-18  627  	else
3e8a78d13 Hans Verkuil            2014-11-17  628  		mp->ycbcr_enc = vivid_ycbcr_enc_cap(dev);
ca5316db0 Hans Verkuil            2015-04-28  629  	mp->xfer_func = vivid_xfer_func_cap(dev);
3e8a78d13 Hans Verkuil            2014-11-17  630  	mp->quantization = vivid_quantization_cap(dev);
ef834f783 Hans Verkuil            2014-08-25  631  	memset(mp->reserved, 0, sizeof(mp->reserved));
ef834f783 Hans Verkuil            2014-08-25  632  	return 0;
ef834f783 Hans Verkuil            2014-08-25  633  }
ef834f783 Hans Verkuil            2014-08-25  634  

:::::: The code at line 565 was first introduced by commit
:::::: 0545629e50af60e7afad9d6023a546aed1081a8e media: v4l2-common: get rid of struct v4l2_discrete_probe

:::::: TO: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxxx>
:::::: CC: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxxx>

---
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 Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux