[PATCH v2 08/15] media: tegra-video: vi: Report stepwise frame sizes instead of querying subdev
From: Svyatoslav Ryhel
Date: Sun Nov 29 2026 - 13:08:03 EST
Update tegra_channel_enum_framesizes() to return frame sizes supported by
VI instead of forwarding enum_frame_size to the remote source subdevice.
Signed-off-by: Svyatoslav Ryhel <clamor95@xxxxxxxxx>
---
.../media/platform/nvidia/tegra-video/vi.c | 22 +++++--------------
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/drivers/media/platform/nvidia/tegra-video/vi.c b/drivers/media/platform/nvidia/tegra-video/vi.c
index 15f05ca19c752..b41158760f007 100644
--- a/drivers/media/platform/nvidia/tegra-video/vi.c
+++ b/drivers/media/platform/nvidia/tegra-video/vi.c
@@ -319,29 +319,19 @@ 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;
+
+ if (sizes->index != 0)
+ return -EINVAL;
fmtinfo = tegra_get_format_by_fourcc(chan, sizes->pixel_format);
if (!fmtinfo)
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;
+ memcpy(&sizes->stepwise, vi->soc->framesize, sizeof(sizes->stepwise));
return 0;
}
--
2.53.0