Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

media: rockchip: hdmirx: add VIDIOC_G_PARM #139

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions drivers/media/platform/rockchip/hdmirx/rk_hdmirx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,23 @@ static int hdmirx_s_input(struct file *file, void *priv, unsigned int i)
return i == 0 ? 0 : -EINVAL;
}

static int hdmirx_g_parm(struct file *file, void *priv,
struct v4l2_streamparm *parm)
{
struct hdmirx_stream *stream = video_drvdata(file);
struct rk_hdmirx_dev *hdmirx_dev = stream->hdmirx_dev;
struct v4l2_fract fps;

if (parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
return -EINVAL;

fps = v4l2_calc_timeperframe(&hdmirx_dev->timings);
parm->parm.capture.timeperframe.numerator = fps.numerator;
parm->parm.capture.timeperframe.denominator = fps.denominator;

return 0;
}

static int fcc_xysubs(u32 fcc, u32 *xsubs, u32 *ysubs)
{
/* Note: cbcr plane bpp is 16 bit */
Expand Down Expand Up @@ -2295,6 +2312,7 @@ static const struct v4l2_ioctl_ops hdmirx_v4l2_ioctl_ops = {
.vidioc_s_input = hdmirx_s_input,
.vidioc_g_edid = hdmirx_get_edid,
.vidioc_s_edid = hdmirx_set_edid,
.vidioc_g_parm = hdmirx_g_parm,

.vidioc_reqbufs = vb2_ioctl_reqbufs,
.vidioc_querybuf = vb2_ioctl_querybuf,
Expand Down