Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a32bf44

Browse files
amazingfateHeyMeco
authored andcommitted
media: rockchip: hdmirx: add VIDIOC_G_PARM
1 parent d1513af commit a32bf44

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/media/platform/rockchip/hdmirx/rk_hdmirx.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,23 @@ static int hdmirx_s_input(struct file *file, void *priv, unsigned int i)
17791779
return i == 0 ? 0 : -EINVAL;
17801780
}
17811781

1782+
static int hdmirx_g_parm(struct file *file, void *priv,
1783+
struct v4l2_streamparm *parm)
1784+
{
1785+
struct hdmirx_stream *stream = video_drvdata(file);
1786+
struct rk_hdmirx_dev *hdmirx_dev = stream->hdmirx_dev;
1787+
struct v4l2_fract fps;
1788+
1789+
if (parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
1790+
return -EINVAL;
1791+
1792+
fps = v4l2_calc_timeperframe(&hdmirx_dev->timings);
1793+
parm->parm.capture.timeperframe.numerator = fps.numerator;
1794+
parm->parm.capture.timeperframe.denominator = fps.denominator;
1795+
1796+
return 0;
1797+
}
1798+
17821799
static int fcc_xysubs(u32 fcc, u32 *xsubs, u32 *ysubs)
17831800
{
17841801
/* Note: cbcr plane bpp is 16 bit */
@@ -2603,6 +2620,7 @@ static const struct v4l2_ioctl_ops hdmirx_v4l2_ioctl_ops = {
26032620
.vidioc_s_input = hdmirx_s_input,
26042621
.vidioc_g_edid = hdmirx_get_edid,
26052622
.vidioc_s_edid = hdmirx_set_edid,
2623+
.vidioc_g_parm = hdmirx_g_parm,
26062624

26072625
.vidioc_reqbufs = vb2_ioctl_reqbufs,
26082626
.vidioc_querybuf = vb2_ioctl_querybuf,

0 commit comments

Comments
 (0)