Skip to content

Commit

Permalink
media: rockchip: hdmirx: add VIDIOC_S_PARM and VIDIOC_G_PARM
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingfate committed Jan 8, 2024
1 parent 89e4ac2 commit a14fba4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 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,26 @@ 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;
fps = v4l2_calc_timeperframe(&hdmirx_dev->timings);
parm->parm.capture.timeperframe.numerator = fps.numerator;
parm->parm.capture.timeperframe.denominator = fps.denominator;
parm->parm.capture.readbuffers = 2;

return 0;
}

static int hdmirx_s_parm(struct file *file, void *priv,
struct v4l2_streamparm *parm)
{
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 +2315,8 @@ 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_s_parm = hdmirx_s_parm,

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

0 comments on commit a14fba4

Please sign in to comment.