mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
media: rzg2l-cru: Add vidioc_enum_framesizes()
Add a callback to implement the VIDIOC_ENUM_FRAMESIZES ioctl for the CRU driver. Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20250625-rzg2l-cru-v6-2-a9099ed26c14@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
parent
78584431e2
commit
d225bdb6ed
|
|
@ -1029,6 +1029,31 @@ static int rzg2l_cru_enum_fmt_vid_cap(struct file *file, void *priv,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int rzg2l_cru_enum_framesizes(struct file *file, void *fh,
|
||||
struct v4l2_frmsizeenum *fsize)
|
||||
{
|
||||
struct rzg2l_cru_dev *cru = video_drvdata(file);
|
||||
const struct rzg2l_cru_info *info = cru->info;
|
||||
const struct rzg2l_cru_ip_format *fmt;
|
||||
|
||||
if (fsize->index)
|
||||
return -EINVAL;
|
||||
|
||||
fmt = rzg2l_cru_ip_format_to_fmt(fsize->pixel_format);
|
||||
if (!fmt)
|
||||
return -EINVAL;
|
||||
|
||||
fsize->type = V4L2_FRMIVAL_TYPE_CONTINUOUS;
|
||||
fsize->stepwise.min_width = RZG2L_CRU_MIN_INPUT_WIDTH;
|
||||
fsize->stepwise.max_width = info->max_width;
|
||||
fsize->stepwise.step_width = 1;
|
||||
fsize->stepwise.min_height = RZG2L_CRU_MIN_INPUT_HEIGHT;
|
||||
fsize->stepwise.max_height = info->max_height;
|
||||
fsize->stepwise.step_height = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct v4l2_ioctl_ops rzg2l_cru_ioctl_ops = {
|
||||
.vidioc_querycap = rzg2l_cru_querycap,
|
||||
.vidioc_try_fmt_vid_cap = rzg2l_cru_try_fmt_vid_cap,
|
||||
|
|
@ -1045,6 +1070,7 @@ static const struct v4l2_ioctl_ops rzg2l_cru_ioctl_ops = {
|
|||
.vidioc_prepare_buf = vb2_ioctl_prepare_buf,
|
||||
.vidioc_streamon = vb2_ioctl_streamon,
|
||||
.vidioc_streamoff = vb2_ioctl_streamoff,
|
||||
.vidioc_enum_framesizes = rzg2l_cru_enum_framesizes,
|
||||
};
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user