mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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:
parent
a8287a718d
commit
23996c0d01
2 changed files with 24 additions and 11 deletions
|
@ -1141,6 +1141,15 @@ long venc_munmap(struct v4l2_subdev *sd, void *arg)
|
||||||
return 0;
|
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 venc_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||||
{
|
{
|
||||||
long rc = 0;
|
long rc = 0;
|
||||||
|
@ -1210,6 +1219,9 @@ long venc_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||||
case ENC_MUNMAP:
|
case ENC_MUNMAP:
|
||||||
rc = venc_munmap(sd, arg);
|
rc = venc_munmap(sd, arg);
|
||||||
break;
|
break;
|
||||||
|
case SET_FRAMERATE_MODE:
|
||||||
|
rc = venc_set_framerate_mode(sd, arg);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
WFD_MSG_ERR("Unknown ioctl %d to enc-subdev\n", cmd);
|
WFD_MSG_ERR("Unknown ioctl %d to enc-subdev\n", cmd);
|
||||||
rc = -ENOTSUPP;
|
rc = -ENOTSUPP;
|
||||||
|
|
|
@ -1096,7 +1096,6 @@ static int wfdioc_s_parm(struct file *filp, void *fh,
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
goto set_parm_fail;
|
goto set_parm_fail;
|
||||||
}
|
}
|
||||||
venc_mode = VENC_MODE_CFR;
|
|
||||||
frame_interval =
|
frame_interval =
|
||||||
a->parm.capture.timeperframe.numerator * NSEC_PER_SEC /
|
a->parm.capture.timeperframe.numerator * NSEC_PER_SEC /
|
||||||
a->parm.capture.timeperframe.denominator;
|
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;
|
max_frame_interval = (int64_t)frameskip.maxframeinterval;
|
||||||
vsg_mode = VSG_MODE_VFR;
|
vsg_mode = VSG_MODE_VFR;
|
||||||
|
venc_mode = VENC_MODE_VFR;
|
||||||
|
|
||||||
rc = v4l2_subdev_call(&wfd_dev->vsg_sdev, core,
|
rc = v4l2_subdev_call(&wfd_dev->vsg_sdev, core,
|
||||||
ioctl, VSG_SET_MAX_FRAME_INTERVAL,
|
ioctl, VSG_SET_MAX_FRAME_INTERVAL,
|
||||||
|
@ -1133,24 +1133,25 @@ static int wfdioc_s_parm(struct file *filp, void *fh,
|
||||||
|
|
||||||
if (rc)
|
if (rc)
|
||||||
goto set_parm_fail;
|
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 {
|
} else {
|
||||||
vsg_mode = VSG_MODE_CFR;
|
vsg_mode = VSG_MODE_CFR;
|
||||||
rc = v4l2_subdev_call(&wfd_dev->vsg_sdev, core,
|
venc_mode = VENC_MODE_CFR;
|
||||||
ioctl, VSG_SET_MODE, &vsg_mode);
|
}
|
||||||
|
|
||||||
if (rc)
|
rc = v4l2_subdev_call(&wfd_dev->vsg_sdev, core,
|
||||||
goto set_parm_fail;
|
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,
|
rc = v4l2_subdev_call(&wfd_dev->enc_sdev, core,
|
||||||
ioctl, SET_FRAMERATE_MODE,
|
ioctl, SET_FRAMERATE_MODE,
|
||||||
&venc_mode);
|
&venc_mode);
|
||||||
|
if (rc) {
|
||||||
|
WFD_MSG_ERR("Setting FR mode for VENC failed\n");
|
||||||
|
goto set_parm_fail;
|
||||||
|
}
|
||||||
|
|
||||||
set_parm_fail:
|
set_parm_fail:
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Reference in a new issue