Message ID | 1255446614-16847-1-git-send-email-hvaibhav@ti.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-path: <linux-media-owner@vger.kernel.org> Envelope-to: mchehab@infradead.org Delivery-date: Tue, 13 Oct 2009 15:17:08 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra.chehab.org with IMAP (fetchmail-6.3.6) for <mchehab@localhost> (single-drop); Tue, 13 Oct 2009 16:49:39 -0300 (BRT) Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1Mxj7c-0004pF-3b; Tue, 13 Oct 2009 15:17:08 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754798AbZJMPKz (ORCPT <rfc822; kmpark@infradead.org> + 1 other); Tue, 13 Oct 2009 11:10:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757788AbZJMPKz (ORCPT <rfc822;linux-media-outgoing>); Tue, 13 Oct 2009 11:10:55 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:56450 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752850AbZJMPKy (ORCPT <rfc822;linux-media@vger.kernel.org>); Tue, 13 Oct 2009 11:10:54 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9DFAF1h011657 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <linux-media@vger.kernel.org>; Tue, 13 Oct 2009 10:10:17 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id n9DFAEo0028132; Tue, 13 Oct 2009 20:40:14 +0530 (IST) From: hvaibhav@ti.com To: linux-media@vger.kernel.org Cc: Vaibhav Hiremath <hvaibhav@ti.com> Subject: [PATCH 5/6] Davinci VPFE Capture: Add support for Control ioctls Date: Tue, 13 Oct 2009 20:40:14 +0530 Message-Id: <1255446614-16847-1-git-send-email-hvaibhav@ti.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <hvaibhav@ti.com> References: <hvaibhav@ti.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org |
Commit Message
Hiremath, Vaibhav
Oct. 13, 2009, 3:10 p.m. UTC
From: Vaibhav Hiremath <hvaibhav@ti.com> Added support for Control IOCTL, - s_ctrl - g_ctrl - queryctrl Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> --- drivers/media/video/davinci/vpfe_capture.c | 43 ++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-)
Comments
> -----Original Message----- > From: Hiremath, Vaibhav > Sent: Tuesday, October 13, 2009 8:40 PM > To: linux-media@vger.kernel.org > Cc: Hiremath, Vaibhav > Subject: [PATCH 5/6] Davinci VPFE Capture: Add support for Control > ioctls > > From: Vaibhav Hiremath <hvaibhav@ti.com> > > Added support for Control IOCTL, > - s_ctrl > - g_ctrl > - queryctrl > [Hiremath, Vaibhav] I am in the process of cleaning up of support for AM3517 Capture driver, which is almost same as DM6446 CCDC. Then I would want to finish up with OMAP3 Display driver part before moving to Media Controller support for MEM-to-MEM (like, Resizer). Just FYI, I will be going for vacation for 1 & 1/2 week starting from coming Friday. But I will make sure that I will submit patches for Display (OMAP3 & AM3517) and AM3517 Capture driver before that. Thanks, Vaibhav > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> > --- > drivers/media/video/davinci/vpfe_capture.c | 43 > ++++++++++++++++++++++++++++ > 1 files changed, 43 insertions(+), 0 deletions(-) > > diff --git a/drivers/media/video/davinci/vpfe_capture.c > b/drivers/media/video/davinci/vpfe_capture.c > index abe21e4..f77d99b 100644 > --- a/drivers/media/video/davinci/vpfe_capture.c > +++ b/drivers/media/video/davinci/vpfe_capture.c > @@ -1368,6 +1368,46 @@ static int vpfe_g_std(struct file *file, void > *priv, v4l2_std_id *std_id) > return 0; > } > > +static int vpfe_queryctrl(struct file *file, void *priv, > + struct v4l2_queryctrl *qctrl) > +{ > + struct vpfe_device *vpfe_dev = video_drvdata(file); > + struct vpfe_subdev_info *sdinfo; > + int ret = 0; > + > + sdinfo = vpfe_dev->current_subdev; > + > + ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > >grp_id, > + core, queryctrl, qctrl); > + > + if (ret) > + qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; > + > + return 0; > +} > + > +static int vpfe_g_ctrl(struct file *file, void *priv, struct > v4l2_control *ctrl) > +{ > + struct vpfe_device *vpfe_dev = video_drvdata(file); > + struct vpfe_subdev_info *sdinfo; > + > + sdinfo = vpfe_dev->current_subdev; > + > + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > >grp_id, > + core, g_ctrl, ctrl); > +} > + > +static int vpfe_s_ctrl(struct file *file, void *priv, struct > v4l2_control *ctrl) > +{ > + struct vpfe_device *vpfe_dev = video_drvdata(file); > + struct vpfe_subdev_info *sdinfo; > + > + sdinfo = vpfe_dev->current_subdev; > + > + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > >grp_id, > + core, s_ctrl, ctrl); > +} > + > /* > * Videobuf operations > */ > @@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops > vpfe_ioctl_ops = { > .vidioc_querystd = vpfe_querystd, > .vidioc_s_std = vpfe_s_std, > .vidioc_g_std = vpfe_g_std, > + .vidioc_queryctrl = vpfe_queryctrl, > + .vidioc_g_ctrl = vpfe_g_ctrl, > + .vidioc_s_ctrl = vpfe_s_ctrl, > .vidioc_reqbufs = vpfe_reqbufs, > .vidioc_querybuf = vpfe_querybuf, > .vidioc_qbuf = vpfe_qbuf, > -- > 1.6.2.4 -- 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
Murali Karicheri Software Design Engineer Texas Instruments Inc. Germantown, MD 20874 phone: 301-407-9583 email: m-karicheri2@ti.com >-----Original Message----- >From: linux-media-owner@vger.kernel.org [mailto:linux-media- >owner@vger.kernel.org] On Behalf Of Hiremath, Vaibhav >Sent: Tuesday, October 13, 2009 11:28 AM >To: Hiremath, Vaibhav; linux-media@vger.kernel.org >Subject: RE: [PATCH 5/6] Davinci VPFE Capture: Add support for Control >ioctls > >> -----Original Message----- >> From: Hiremath, Vaibhav >> Sent: Tuesday, October 13, 2009 8:40 PM >> To: linux-media@vger.kernel.org >> Cc: Hiremath, Vaibhav >> Subject: [PATCH 5/6] Davinci VPFE Capture: Add support for Control >> ioctls >> >> From: Vaibhav Hiremath <hvaibhav@ti.com> >> >> Added support for Control IOCTL, >> - s_ctrl >> - g_ctrl >> - queryctrl >> >[Hiremath, Vaibhav] I am in the process of cleaning up of support for >AM3517 Capture driver, which is almost same as DM6446 CCDC. Then I would >want to finish up with OMAP3 Display driver part before moving to Media >Controller support for MEM-to-MEM (like, Resizer). > >Just FYI, I will be going for vacation for 1 & 1/2 week starting from >coming Friday. But I will make sure that I will submit patches for Display >(OMAP3 & AM3517) and AM3517 Capture driver before that. > >Thanks, >Vaibhav >> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> >> --- >> drivers/media/video/davinci/vpfe_capture.c | 43 >> ++++++++++++++++++++++++++++ >> 1 files changed, 43 insertions(+), 0 deletions(-) >> >> diff --git a/drivers/media/video/davinci/vpfe_capture.c >> b/drivers/media/video/davinci/vpfe_capture.c >> index abe21e4..f77d99b 100644 >> --- a/drivers/media/video/davinci/vpfe_capture.c >> +++ b/drivers/media/video/davinci/vpfe_capture.c >> @@ -1368,6 +1368,46 @@ static int vpfe_g_std(struct file *file, void >> *priv, v4l2_std_id *std_id) >> return 0; >> } >> >> +static int vpfe_queryctrl(struct file *file, void *priv, >> + struct v4l2_queryctrl *qctrl) >> +{ >> + struct vpfe_device *vpfe_dev = video_drvdata(file); >> + struct vpfe_subdev_info *sdinfo; >> + int ret = 0; >> + >> + sdinfo = vpfe_dev->current_subdev; >> + >> + ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- >> >grp_id, >> + core, queryctrl, qctrl); >> + >> + if (ret) >> + qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; What is this for ? Why don't we return error to user instead. I see there is a function v4l2_ctrl_check() in the v4l2 core which translates this to -EINVAL. So better to return an -EINVAL to user instead IMO. I am ok with rest of the changes. >> + >> + return 0; >> +} >> + >> +static int vpfe_g_ctrl(struct file *file, void *priv, struct >> v4l2_control *ctrl) >> +{ >> + struct vpfe_device *vpfe_dev = video_drvdata(file); >> + struct vpfe_subdev_info *sdinfo; >> + >> + sdinfo = vpfe_dev->current_subdev; >> + >> + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- >> >grp_id, >> + core, g_ctrl, ctrl); >> +} >> + >> +static int vpfe_s_ctrl(struct file *file, void *priv, struct >> v4l2_control *ctrl) >> +{ >> + struct vpfe_device *vpfe_dev = video_drvdata(file); >> + struct vpfe_subdev_info *sdinfo; >> + >> + sdinfo = vpfe_dev->current_subdev; >> + >> + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- >> >grp_id, >> + core, s_ctrl, ctrl); >> +} >> + >> /* >> * Videobuf operations >> */ >> @@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops >> vpfe_ioctl_ops = { >> .vidioc_querystd = vpfe_querystd, >> .vidioc_s_std = vpfe_s_std, >> .vidioc_g_std = vpfe_g_std, >> + .vidioc_queryctrl = vpfe_queryctrl, >> + .vidioc_g_ctrl = vpfe_g_ctrl, >> + .vidioc_s_ctrl = vpfe_s_ctrl, >> .vidioc_reqbufs = vpfe_reqbufs, >> .vidioc_querybuf = vpfe_querybuf, >> .vidioc_qbuf = vpfe_qbuf, >> -- >> 1.6.2.4 > >-- >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 -- 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
> -----Original Message----- > From: Karicheri, Muralidharan > Sent: Friday, October 16, 2009 7:53 PM > To: Hiremath, Vaibhav; linux-media@vger.kernel.org > Subject: RE: [PATCH 5/6] Davinci VPFE Capture: Add support for > Control ioctls > > > > Murali Karicheri > Software Design Engineer > Texas Instruments Inc. > Germantown, MD 20874 > phone: 301-407-9583 > email: m-karicheri2@ti.com > > >-----Original Message----- > >From: linux-media-owner@vger.kernel.org [mailto:linux-media- > >owner@vger.kernel.org] On Behalf Of Hiremath, Vaibhav > >Sent: Tuesday, October 13, 2009 11:28 AM > >To: Hiremath, Vaibhav; linux-media@vger.kernel.org > >Subject: RE: [PATCH 5/6] Davinci VPFE Capture: Add support for > Control > >ioctls > > > >> -----Original Message----- > >> From: Hiremath, Vaibhav > >> Sent: Tuesday, October 13, 2009 8:40 PM > >> To: linux-media@vger.kernel.org > >> Cc: Hiremath, Vaibhav > >> Subject: [PATCH 5/6] Davinci VPFE Capture: Add support for > Control > >> ioctls > >> > >> From: Vaibhav Hiremath <hvaibhav@ti.com> > >> > >> Added support for Control IOCTL, > >> - s_ctrl > >> - g_ctrl > >> - queryctrl > >> <snip> > >> +static int vpfe_queryctrl(struct file *file, void *priv, > >> + struct v4l2_queryctrl *qctrl) > >> +{ > >> + struct vpfe_device *vpfe_dev = video_drvdata(file); > >> + struct vpfe_subdev_info *sdinfo; > >> + int ret = 0; > >> + > >> + sdinfo = vpfe_dev->current_subdev; > >> + > >> + ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > >> >grp_id, > >> + core, queryctrl, qctrl); > >> + > >> + if (ret) > >> + qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; > What is this for ? [Hiremath, Vaibhav] This is an error indication from driver to application other than supported id. Ideally as per V4L2 spec driver returns error -EINVAL for invalid id. The usage of this flag is to skip a predefined or private control which is not possible with -EINVAL return. > Why don't we return error to user instead. I see > there is a function v4l2_ctrl_check() in the v4l2 core which > translates this to -EINVAL. So better to return an -EINVAL to user > instead IMO. I am ok with rest of the changes. [Hiremath, Vaibhav] Yes definitely the patch has typo mistake, it should have been "return ret" instead of 0. Application will iterate infinitely with this, which is wrong. Thanks for pointing me to this error. I will repost the patch with this fix. Thanks, Vaibhav > >> + > >> + return 0; > >> +} > >> + > >> +static int vpfe_g_ctrl(struct file *file, void *priv, struct > >> v4l2_control *ctrl) > >> +{ > >> + struct vpfe_device *vpfe_dev = video_drvdata(file); > >> + struct vpfe_subdev_info *sdinfo; > >> + > >> + sdinfo = vpfe_dev->current_subdev; > >> + > >> + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > >> >grp_id, > >> + core, g_ctrl, ctrl); > >> +} > >> + > >> +static int vpfe_s_ctrl(struct file *file, void *priv, struct > >> v4l2_control *ctrl) > >> +{ > >> + struct vpfe_device *vpfe_dev = video_drvdata(file); > >> + struct vpfe_subdev_info *sdinfo; > >> + > >> + sdinfo = vpfe_dev->current_subdev; > >> + > >> + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > >> >grp_id, > >> + core, s_ctrl, ctrl); > >> +} > >> + > >> /* > >> * Videobuf operations > >> */ > >> @@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops > >> vpfe_ioctl_ops = { > >> .vidioc_querystd = vpfe_querystd, > >> .vidioc_s_std = vpfe_s_std, > >> .vidioc_g_std = vpfe_g_std, > >> + .vidioc_queryctrl = vpfe_queryctrl, > >> + .vidioc_g_ctrl = vpfe_g_ctrl, > >> + .vidioc_s_ctrl = vpfe_s_ctrl, > >> .vidioc_reqbufs = vpfe_reqbufs, > >> .vidioc_querybuf = vpfe_querybuf, > >> .vidioc_qbuf = vpfe_qbuf, > >> -- > >> 1.6.2.4 > > > >-- > >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 -- 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
diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c index abe21e4..f77d99b 100644 --- a/drivers/media/video/davinci/vpfe_capture.c +++ b/drivers/media/video/davinci/vpfe_capture.c @@ -1368,6 +1368,46 @@ static int vpfe_g_std(struct file *file, void *priv, v4l2_std_id *std_id) return 0; } +static int vpfe_queryctrl(struct file *file, void *priv, + struct v4l2_queryctrl *qctrl) +{ + struct vpfe_device *vpfe_dev = video_drvdata(file); + struct vpfe_subdev_info *sdinfo; + int ret = 0; + + sdinfo = vpfe_dev->current_subdev; + + ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, + core, queryctrl, qctrl); + + if (ret) + qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; + + return 0; +} + +static int vpfe_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl) +{ + struct vpfe_device *vpfe_dev = video_drvdata(file); + struct vpfe_subdev_info *sdinfo; + + sdinfo = vpfe_dev->current_subdev; + + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, + core, g_ctrl, ctrl); +} + +static int vpfe_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl) +{ + struct vpfe_device *vpfe_dev = video_drvdata(file); + struct vpfe_subdev_info *sdinfo; + + sdinfo = vpfe_dev->current_subdev; + + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, + core, s_ctrl, ctrl); +} + /* * Videobuf operations */ @@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops vpfe_ioctl_ops = { .vidioc_querystd = vpfe_querystd, .vidioc_s_std = vpfe_s_std, .vidioc_g_std = vpfe_g_std, + .vidioc_queryctrl = vpfe_queryctrl, + .vidioc_g_ctrl = vpfe_g_ctrl, + .vidioc_s_ctrl = vpfe_s_ctrl, .vidioc_reqbufs = vpfe_reqbufs, .vidioc_querybuf = vpfe_querybuf, .vidioc_qbuf = vpfe_qbuf,