Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2ecb257 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] v4l2: standardize log start/end message



For drivers that properly use the v4l2 framework (i.e. set v4l2_dev in the
video_device struct), the start and end messages of VIDIOC_LOG_STATUS are
now generated automatically. People tended to forget these, but the v4l2-ctl
tool scans for these messages, and it also makes it easier to read the status
output in the kernel log.

The cx18, ivtv and bttv drivers were changed since they no longer need to
log these start/end messages.

In saa7164 two empty log_status functions were removed.

Also added a helper function to v4l2-ctrl.c that can be used as the
vidioc_log_status callback if all you need to do is to log the current control
values. This is now used by pwc and vivi.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Cc: Steven Toth <stoth@kernellabs.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent eb224c29
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -2035,11 +2035,7 @@ static int bttv_log_status(struct file *file, void *f)
	struct bttv_fh *fh  = f;
	struct bttv *btv = fh->btv;

	pr_info("%d: ========  START STATUS CARD #%d  ========\n",
		btv->c.nr, btv->c.nr);
	bttv_call_all(btv, core, log_status);
	pr_info("%d: ========  END STATUS CARD   #%d  ========\n",
		btv->c.nr, btv->c.nr);
	return 0;
}

+0 −4
Original line number Diff line number Diff line
@@ -1085,8 +1085,6 @@ static int cx18_log_status(struct file *file, void *fh)
	struct v4l2_audio audin;
	int i;

	CX18_INFO("=================  START STATUS CARD #%d  "
		  "=================\n", cx->instance);
	CX18_INFO("Version: %s  Card: %s\n", CX18_VERSION, cx->card_name);
	if (cx->hw_flags & CX18_HW_TVEEPROM) {
		struct tveeprom tv;
@@ -1120,8 +1118,6 @@ static int cx18_log_status(struct file *file, void *fh)
	CX18_INFO("Read MPEG/VBI: %lld/%lld bytes\n",
			(long long)cx->mpg_data_received,
			(long long)cx->vbi_data_inserted);
	CX18_INFO("==================  END STATUS CARD #%d  "
		  "==================\n", cx->instance);
	return 0;
}

+0 −5
Original line number Diff line number Diff line
@@ -1485,8 +1485,6 @@ static int ivtv_log_status(struct file *file, void *fh)
	struct v4l2_audio audin;
	int i;

	IVTV_INFO("=================  START STATUS CARD #%d  =================\n",
		       itv->instance);
	IVTV_INFO("Version: %s Card: %s\n", IVTV_VERSION, itv->card_name);
	if (itv->hw_flags & IVTV_HW_TVEEPROM) {
		struct tveeprom tv;
@@ -1568,9 +1566,6 @@ static int ivtv_log_status(struct file *file, void *fh)
	IVTV_INFO("Read MPG/VBI: %lld/%lld bytes\n",
			(long long)itv->mpg_data_received,
			(long long)itv->vbi_data_inserted);
	IVTV_INFO("==================  END STATUS CARD #%d  ==================\n",
			itv->instance);

	return 0;
}

+1 −9
Original line number Diff line number Diff line
@@ -1146,14 +1146,6 @@ static int pwc_s_parm(struct file *file, void *fh,
	return ret;
}

static int pwc_log_status(struct file *file, void *priv)
{
	struct pwc_device *pdev = video_drvdata(file);

	v4l2_ctrl_handler_log_status(&pdev->ctrl_handler, PWC_NAME);
	return 0;
}

const struct v4l2_ioctl_ops pwc_ioctl_ops = {
	.vidioc_querycap		    = pwc_querycap,
	.vidioc_enum_input		    = pwc_enum_input,
@@ -1169,7 +1161,7 @@ const struct v4l2_ioctl_ops pwc_ioctl_ops = {
	.vidioc_dqbuf			    = pwc_dqbuf,
	.vidioc_streamon		    = pwc_streamon,
	.vidioc_streamoff		    = pwc_streamoff,
	.vidioc_log_status		    = pwc_log_status,
	.vidioc_log_status		    = v4l2_ctrl_log_status,
	.vidioc_enum_framesizes		    = pwc_enum_framesizes,
	.vidioc_enum_frameintervals	    = pwc_enum_frameintervals,
	.vidioc_g_parm			    = pwc_g_parm,
+0 −6
Original line number Diff line number Diff line
@@ -791,11 +791,6 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
	return 0;
}

static int vidioc_log_status(struct file *file, void *priv)
{
	return 0;
}

static int fill_queryctrl(struct saa7164_encoder_params *params,
	struct v4l2_queryctrl *c)
{
@@ -1347,7 +1342,6 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
	.vidioc_g_ext_ctrls	 = vidioc_g_ext_ctrls,
	.vidioc_s_ext_ctrls	 = vidioc_s_ext_ctrls,
	.vidioc_try_ext_ctrls	 = vidioc_try_ext_ctrls,
	.vidioc_log_status	 = vidioc_log_status,
	.vidioc_queryctrl	 = vidioc_queryctrl,
	.vidioc_g_chip_ident	 = saa7164_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG
Loading