linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Jianle Wang <victure86@gmail.com>
Cc: linux-media@vger.kernel.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: how can I get compat_ioctl support for v4l2_subdev_fops
Date: Wed, 15 Jan 2014 08:39:15 +0100	[thread overview]
Message-ID: <52D63B23.5000505@xs4all.nl> (raw)
In-Reply-To: <CACDDY7429te6a7cUQ0Z=sX6TELjn48FQHiuW=YtBsyOkzrCqZA@mail.gmail.com>

Hi Jianle,

On 01/15/2014 07:28 AM, Jianle Wang wrote:
> Hi all, :
> I use the media-ctl from http://git.ideasonboard.org/media-ctl.git
> It is compiled into a 32 bit application. Run on a 64 bit CPU. The
> version of kernel is 3.10.
> 
> When call ioctl(, VIDIOC_SUBDEV_S_SELECTION,), meet the below warning:
> [   97.186338] c0 707 (drv_test) compat_ioctl32: unknown ioctl 'V',
> dir=3, #62 (0xc040563e)
> [   97.203252] c0 707 (drv_test) WARNING: no compat_ioctl for v4l-subdev1
> 
> VIDIOC_SUBDEV_S_SELECTION is not supported for compat_iocl. And I list
> others subdev’s ioctl, which are also not included
> 
> in v4l2_compat_iocl32().
> How can I get these compat_ioctl?
> Have they been added in v4l2_compat_iocl32() or We have added a
> compat_ioctl32 in v4l2_subdev_fops?

It's a bug, I'm afraid. A lot of the SUBDEV ioctls are missing in v4l2_compat_ioctl32.
Try the patch below, that should fix it.

Regards,

	Hans

> 
> VIDIOC_SUBDEV_G_FMT
> VIDIOC_SUBDEV_S_FMT
> VIDIOC_SUBDEV_G_CROP
> VIDIOC_SUBDEV_S_CROP
> VIDIOC_SUBDEV_ENUM_MBUS_CODE
> VIDIOC_SUBDEV_ENUM_FRAME_SIZE
> VIDIOC_SUBDEV_G_FRAME_INTERVAL
> VIDIOC_SUBDEV_S_FRAME_INTERVAL
> VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
> VIDIOC_SUBDEV_G_SELECTION
> VIDIOC_SUBDEV_S_SELECTION
> default
> v4l2_subdev_call(sd, core, ioctl, cmd, arg);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index 8f7a6a4..15d3586 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -1007,6 +1007,7 @@ long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
 		return ret;
 
 	switch (cmd) {
+	/* V4L2 ioctls */
 	case VIDIOC_QUERYCAP:
 	case VIDIOC_RESERVED:
 	case VIDIOC_ENUM_FMT:
@@ -1087,8 +1088,21 @@ long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
 	case VIDIOC_QUERY_DV_TIMINGS:
 	case VIDIOC_DV_TIMINGS_CAP:
 	case VIDIOC_ENUM_FREQ_BANDS:
+
+	/* V4L2 subdev ioctls */
 	case VIDIOC_SUBDEV_G_EDID32:
 	case VIDIOC_SUBDEV_S_EDID32:
+	case VIDIOC_SUBDEV_G_FMT:
+	case VIDIOC_SUBDEV_S_FMT:
+	case VIDIOC_SUBDEV_G_FRAME_INTERVAL:
+	case VIDIOC_SUBDEV_S_FRAME_INTERVAL:
+	case VIDIOC_SUBDEV_ENUM_MBUS_CODE:
+	case VIDIOC_SUBDEV_ENUM_FRAME_SIZE:
+	case VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL:
+	case VIDIOC_SUBDEV_G_CROP:
+	case VIDIOC_SUBDEV_S_CROP:
+	case VIDIOC_SUBDEV_G_SELECTION:
+	case VIDIOC_SUBDEV_S_SELECTION:
 		ret = do_video_ioctl(file, cmd, arg);
 		break;
 


  reply	other threads:[~2014-01-15  7:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15  6:28 how can I get compat_ioctl support for v4l2_subdev_fops Jianle Wang
2014-01-15  7:39 ` Hans Verkuil [this message]
2014-01-15  8:02   ` Jianle Wang
2014-01-15  9:40     ` Hans Verkuil
2014-01-15 11:36       ` Jianle Wang
2014-01-15 11:43         ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52D63B23.5000505@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=victure86@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).