[PATCH v1 16/19] staging: media: tegra-video: tegra20: adjust luma buffer stride

Svyatoslav Ryhel posted 19 patches 1 month, 2 weeks ago
There is a newer version of this series
[PATCH v1 16/19] staging: media: tegra-video: tegra20: adjust luma buffer stride
Posted by Svyatoslav Ryhel 1 month, 2 weeks ago
Luma buffer stride is calculated by multiplying height in pixels of image
by bytes per line. Adjust that value accordingly.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
 drivers/staging/media/tegra-video/tegra20.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/tegra-video/tegra20.c b/drivers/staging/media/tegra-video/tegra20.c
index b466fe7f4504..a06afe91d2de 100644
--- a/drivers/staging/media/tegra-video/tegra20.c
+++ b/drivers/staging/media/tegra-video/tegra20.c
@@ -496,7 +496,7 @@ static void tegra20_camera_capture_setup(struct tegra_vi_channel *chan)
 	u32 data_type = chan->fmtinfo->img_dt;
 	int width  = chan->format.width;
 	int height = chan->format.height;
-	int stride_l = chan->format.bytesperline;
+	int stride_l = chan->format.bytesperline * height;
 	int stride_c = (output_fourcc == V4L2_PIX_FMT_YUV420 ||
 			output_fourcc == V4L2_PIX_FMT_YVU420) ? 1 : 0;
 	int output_channel = (data_type == TEGRA_IMAGE_DT_RAW8 ||
-- 
2.48.1
Re: [PATCH v1 16/19] staging: media: tegra-video: tegra20: adjust luma buffer stride
Posted by Mikko Perttunen 1 month ago
On Tuesday, August 19, 2025 9:16 PM Svyatoslav Ryhel wrote:
> Luma buffer stride is calculated by multiplying height in pixels of image
> by bytes per line. Adjust that value accordingly.
> 
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
>  drivers/staging/media/tegra-video/tegra20.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/tegra-video/tegra20.c
> b/drivers/staging/media/tegra-video/tegra20.c index
> b466fe7f4504..a06afe91d2de 100644
> --- a/drivers/staging/media/tegra-video/tegra20.c
> +++ b/drivers/staging/media/tegra-video/tegra20.c
> @@ -496,7 +496,7 @@ static void tegra20_camera_capture_setup(struct
> tegra_vi_channel *chan) u32 data_type = chan->fmtinfo->img_dt;
>  	int width  = chan->format.width;
>  	int height = chan->format.height;
> -	int stride_l = chan->format.bytesperline;
> +	int stride_l = chan->format.bytesperline * height;
>  	int stride_c = (output_fourcc == V4L2_PIX_FMT_YUV420 ||
>  			output_fourcc == V4L2_PIX_FMT_YVU420) ? 1 : 0;
>  	int output_channel = (data_type == TEGRA_IMAGE_DT_RAW8 ||

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>