mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Svyatoslav Ryhel <clamor95@gmail.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Thierry Reding <thierry.reding@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Sowjanya Komatineni <skomatineni@nvidia.com>,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Svyatoslav Ryhel <clamor95@gmail.com>,
	Hans Verkuil <hverkuil+cisco@kernel.org>,
	Mikko Perttunen <mperttunen@nvidia.com>
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev
Subject: [PATCH v2 06/15] media: tegra-video: Expose SoC stepwise frame size limits
Date: Sun, 29 Nov 2026 20:07:13 +0200	[thread overview]
Message-ID: <20261129180722.142186-7-clamor95@gmail.com> (raw)
In-Reply-To: <20261129180722.142186-1-clamor95@gmail.com>

Add a const struct v4l2_frmsize_stepwise *framesize field to
struct tegra_vi_soc to define Tegra20 and Tegra210 frame size limits. This
will be needed for CSI/VIP and VI frame-related operations.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
 drivers/media/platform/nvidia/tegra-video/tegra20.c  | 10 ++++++++++
 drivers/media/platform/nvidia/tegra-video/tegra210.c | 10 ++++++++++
 drivers/media/platform/nvidia/tegra-video/vi.h       |  2 ++
 3 files changed, 22 insertions(+)

diff --git a/drivers/media/platform/nvidia/tegra-video/tegra20.c b/drivers/media/platform/nvidia/tegra-video/tegra20.c
index cdadff98eae75..e2f808a0e51b2 100644
--- a/drivers/media/platform/nvidia/tegra-video/tegra20.c
+++ b/drivers/media/platform/nvidia/tegra-video/tegra20.c
@@ -809,6 +809,15 @@ static const struct tegra_vi_ops tegra20_vi_ops = {
 	.vi_stop_streaming = tegra20_vi_stop_streaming,
 };
 
+static const struct v4l2_frmsize_stepwise tegra20_video_framesize = {
+	.min_width = TEGRA20_MIN_WIDTH,
+	.max_width = TEGRA20_MAX_WIDTH,
+	.step_width = 2,
+	.min_height = TEGRA20_MIN_HEIGHT,
+	.max_height = TEGRA20_MAX_HEIGHT,
+	.step_height = 2,
+};
+
 #define TEGRA20_VIDEO_FMT(DATA_TYPE, BIT_WIDTH, MBUS_CODE, BPP, FOURCC)	\
 {									\
 	.img_dt		= TEGRA_IMAGE_DT_##DATA_TYPE,			\
@@ -850,6 +859,7 @@ const struct tegra_vi_soc tegra20_vi_soc = {
 	.nformats = ARRAY_SIZE(tegra20_video_formats),
 	.default_video_format = &tegra20_video_formats[0],
 	.ops = &tegra20_vi_ops,
+	.framesize = &tegra20_video_framesize,
 	.hw_revision = 1,
 	.vi_max_channels = 2, /* TEGRA_VI_OUT_1 and TEGRA_VI_OUT_2 */
 	.vi_max_clk_hz = 450000000,
diff --git a/drivers/media/platform/nvidia/tegra-video/tegra210.c b/drivers/media/platform/nvidia/tegra-video/tegra210.c
index 82d054c9c34c5..6501229bb74bc 100644
--- a/drivers/media/platform/nvidia/tegra-video/tegra210.c
+++ b/drivers/media/platform/nvidia/tegra-video/tegra210.c
@@ -705,6 +705,15 @@ static void tegra210_vi_stop_streaming(struct vb2_queue *vq)
 	video_device_pipeline_stop(&chan->video);
 }
 
+static const struct v4l2_frmsize_stepwise tegra210_video_framesize = {
+	.min_width = TEGRA210_MIN_WIDTH,
+	.max_width = TEGRA210_MAX_WIDTH,
+	.step_width = 2,
+	.min_height = TEGRA210_MIN_HEIGHT,
+	.max_height = TEGRA210_MAX_HEIGHT,
+	.step_height = 2,
+};
+
 /*
  * Tegra210 VI Pixel memory format enum.
  * These format enum value gets programmed into corresponding Tegra VI
@@ -815,6 +824,7 @@ const struct tegra_vi_soc tegra210_vi_soc = {
 	.video_formats = tegra210_video_formats,
 	.nformats = ARRAY_SIZE(tegra210_video_formats),
 	.ops = &tegra210_vi_ops,
+	.framesize = &tegra210_video_framesize,
 	.hw_revision = 3,
 	.vi_max_channels = 6,
 #if IS_ENABLED(CONFIG_VIDEO_TEGRA_TPG)
diff --git a/drivers/media/platform/nvidia/tegra-video/vi.h b/drivers/media/platform/nvidia/tegra-video/vi.h
index 46328e488aa38..8788a88b9528f 100644
--- a/drivers/media/platform/nvidia/tegra-video/vi.h
+++ b/drivers/media/platform/nvidia/tegra-video/vi.h
@@ -71,6 +71,7 @@ struct tegra_vi_ops {
  * @nformats: total video formats
  * @default_video_format: default video format (pointer to a @video_formats item)
  * @ops: vi operations
+ * @framesize: frame size limitations
  * @hw_revision: VI hw_revision
  * @vi_max_channels: supported max streaming channels
  * @vi_max_clk_hz: VI clock max frequency
@@ -81,6 +82,7 @@ struct tegra_vi_soc {
 	const unsigned int nformats;
 	const struct tegra_video_format *default_video_format;
 	const struct tegra_vi_ops *ops;
+	const struct v4l2_frmsize_stepwise *framesize;
 	u32 hw_revision;
 	unsigned int vi_max_channels;
 	unsigned int vi_max_clk_hz;
-- 
2.53.0


  parent reply	other threads:[~2026-11-29 18:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 18:07 [PATCH v2 00/15] tegra-video: Convert to media-centric pipe Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 01/15] staging: media: tegra-video: Move driver to media/platform/nvidia Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 02/15] media: tegra-video: vi: Drop controls consolidation into VI device Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 03/15] media: tegra-video: vi: Expose all sub-devices in the pipeline Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 04/15] media: tegra-video: vi: Drop subdevice passthrough and input ioctls Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 05/15] media: tegra-video: vi: Build bitmap of formats compatible with CSI/VIP instead of source Svyatoslav Ryhel
2026-11-29 18:07 ` Svyatoslav Ryhel [this message]
2026-11-29 18:07 ` [PATCH v2 07/15] media: tegra-video: vi: Match fourcc against channel format bitmap Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 08/15] media: tegra-video: vi: Report stepwise frame sizes instead of querying subdev Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 09/15] media: tegra-video: vi: Configure capture format locally without subdev calls Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 10/15] media: tegra-video: vi: Implement link_validate for video entity Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 11/15] media: tegra-video: video: Resolve video device via media graph on notifications Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 12/15] media: tegra-video: Remove remote source subdev helper Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 13/15] media: tegra-video: csi: Scope pad and state ops to TPG mode Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 14/15] media: tegra-video: csi: Add pad and media operations for own CSI channels Svyatoslav Ryhel
2026-11-29 18:07 ` [PATCH v2 15/15] media: tegra-video: vip: Add pad and media operations for VIP Svyatoslav Ryhel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261129180722.142186-7-clamor95@gmail.com \
    --to=clamor95@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil+cisco@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-tegra@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=mchehab@kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=skomatineni@nvidia.com \
    --cc=thierry.reding@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®