msm: wfd: Handle SET_FRAMERATE_MODE for Venus subdevice

Handle the SET_FRAMERATE_MODE subdev ioctl for the Venus subdevice.  Not
handling this causes VIDIOC_S_PARM to error out.

Change-Id: I13ecc92957ee526f1c6be5b8f3adb3ab15163dc0
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
This commit is contained in:
Deva Ramasubramanian 2012-12-03 12:23:58 -08:00 committed by Stephen Boyd
parent a8287a718d
commit 23996c0d01
2 changed files with 24 additions and 11 deletions

View file

@ -1141,6 +1141,15 @@ long venc_munmap(struct v4l2_subdev *sd, void *arg)
return 0;
}
static long venc_set_framerate_mode(struct v4l2_subdev *sd,
void *arg)
{
/* TODO: Unsupported for now, but return false success
* to preserve binary compatibility for userspace apps
* across targets */
return 0;
}
long venc_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
{
long rc = 0;
@ -1210,6 +1219,9 @@ long venc_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
case ENC_MUNMAP:
rc = venc_munmap(sd, arg);
break;
case SET_FRAMERATE_MODE:
rc = venc_set_framerate_mode(sd, arg);
break;
default:
WFD_MSG_ERR("Unknown ioctl %d to enc-subdev\n", cmd);
rc = -ENOTSUPP;

View file

@ -1096,7 +1096,6 @@ static int wfdioc_s_parm(struct file *filp, void *fh,
rc = -EINVAL;
goto set_parm_fail;
}
venc_mode = VENC_MODE_CFR;
frame_interval =
a->parm.capture.timeperframe.numerator * NSEC_PER_SEC /
a->parm.capture.timeperframe.denominator;
@ -1126,6 +1125,7 @@ static int wfdioc_s_parm(struct file *filp, void *fh,
max_frame_interval = (int64_t)frameskip.maxframeinterval;
vsg_mode = VSG_MODE_VFR;
venc_mode = VENC_MODE_VFR;
rc = v4l2_subdev_call(&wfd_dev->vsg_sdev, core,
ioctl, VSG_SET_MAX_FRAME_INTERVAL,
@ -1133,24 +1133,25 @@ static int wfdioc_s_parm(struct file *filp, void *fh,
if (rc)
goto set_parm_fail;
rc = v4l2_subdev_call(&wfd_dev->vsg_sdev, core,
ioctl, VSG_SET_MODE, &vsg_mode);
if (rc)
goto set_parm_fail;
} else {
vsg_mode = VSG_MODE_CFR;
rc = v4l2_subdev_call(&wfd_dev->vsg_sdev, core,
ioctl, VSG_SET_MODE, &vsg_mode);
venc_mode = VENC_MODE_CFR;
}
if (rc)
goto set_parm_fail;
rc = v4l2_subdev_call(&wfd_dev->vsg_sdev, core,
ioctl, VSG_SET_MODE, &vsg_mode);
if (rc) {
WFD_MSG_ERR("Setting FR mode for VSG failed\n");
goto set_parm_fail;
}
rc = v4l2_subdev_call(&wfd_dev->enc_sdev, core,
ioctl, SET_FRAMERATE_MODE,
&venc_mode);
if (rc) {
WFD_MSG_ERR("Setting FR mode for VENC failed\n");
goto set_parm_fail;
}
set_parm_fail:
return rc;