[PATCH v1 07/13] media: tegra-video: vi: Report stepwise frame sizes instead of querying subdev
From: Svyatoslav Ryhel
Date: Wed Nov 25 2026 - 06:08:45 EST
Update tegra_channel_enum_framesizes() to return frame sizes supported by
VI instead of forwarding enum_frame_size to the remote source subdevice.
This also requires switching to V4L2_FRMSIZE_TYPE_STEPWISE with a step of
2, since Tegra VI requires sizes to be divisible by 2.
Signed-off-by: Svyatoslav Ryhel <clamor95@xxxxxxxxx>
---
.../media/platform/nvidia/tegra-video/vi.c | 23 ++++---------------
1 file changed, 4 insertions(+), 19 deletions(-)
diff --git a/drivers/media/platform/nvidia/tegra-video/vi.c b/drivers/media/platform/nvidia/tegra-video/vi.c
index b523750725254..ed3e1e91baf12 100644
--- a/drivers/media/platform/nvidia/tegra-video/vi.c
+++ b/drivers/media/platform/nvidia/tegra-video/vi.c
@@ -311,29 +311,14 @@ static int tegra_channel_querycap(struct file *file, void *fh,
static int tegra_channel_enum_framesizes(struct file *file, void *fh,
struct v4l2_frmsizeenum *sizes)
{
- int ret;
struct tegra_vi_channel *chan = video_drvdata(file);
- struct v4l2_subdev *subdev;
- const struct tegra_video_format *fmtinfo;
- struct v4l2_subdev_frame_size_enum fse = {
- .index = sizes->index,
- .which = V4L2_SUBDEV_FORMAT_ACTIVE,
- };
+ struct tegra_vi *vi = chan->vi;
- fmtinfo = tegra_get_format_by_fourcc(chan->vi, sizes->pixel_format);
- if (!fmtinfo)
+ if (sizes->index != 0)
return -EINVAL;
- fse.code = fmtinfo->code;
-
- subdev = tegra_channel_get_remote_source_subdev(chan);
- ret = v4l2_subdev_call(subdev, pad, enum_frame_size, NULL, &fse);
- if (ret)
- return ret;
-
- sizes->type = V4L2_FRMSIZE_TYPE_DISCRETE;
- sizes->discrete.width = fse.max_width;
- sizes->discrete.height = fse.max_height;
+ sizes->type = V4L2_FRMSIZE_TYPE_STEPWISE;
+ vi->ops->vi_fmt_align(NULL, &sizes->stepwise, 0);
return 0;
}
--
2.53.0