mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bod@kernel.org>
To: Wangao Wang <wangao.wang@oss.qualcomm.com>,
	Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
	Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Stanimir Varbanov <stanimir.k.varbanov@gmail.com>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Hans Verkuil <hverkuil+cisco@kernel.org>,
	Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] media: iris: fix VPU4x encoder line buffer size calculations
Date: Mon, 14 Sep 2026 20:49:28 +0100	[thread overview]
Message-ID: <28f71370-1cde-4b67-9201-b3d3c3f2cb85@kernel.org> (raw)
In-Reply-To: <20260914-add_iris_for_maili-v1-4-09df2b54c317@oss.qualcomm.com>

On 14/09/2026 14:00, Wangao Wang wrote:
> size_vpss_line_buf_vpu33() expects (num_pipes, height, width) but was
> called with width and height swapped, miscalculating VPSS line buffer
> size for non-square resolutions.
> 
> iris_vpu4x_enc_line_size was reading resolutions directly from
> inst->fmt_dst. Use iris_vpu_enc_get_bitstream_{width,height}() which
> account for the 90/270-degree rotation case.
> 
> Fixes: df816dce1b01 ("media: iris: Introduce buffer size calculations for vpu4")
> 
> Signed-off-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
> ---
>   drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
> index 55996fd0d14c385ee63d2577b3e6d71b51d9e541..c4922a25b4501a851e31fcc85bc13735803be366 100644
> --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
> +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
> @@ -2059,8 +2059,8 @@ static u32 hfi_vpu4x_buffer_line_enc(u32 frame_width, u32 frame_height,
>   	u32 dma_opb_lb_size = size_dma_opb_lb(num_vpp_pipes_enc, frame_width_coded,
>   					      frame_height_coded);
>   	u32 dse_lb_size = ALIGN((256 + (16 * (frame_width_coded >> 4))), DMA_ALIGNMENT);
> -	u32 size_vpss_lb_enc = size_vpss_line_buf_vpu33(num_vpp_pipes_enc, frame_width_coded,
> -							frame_height_coded);
> +	u32 size_vpss_lb_enc = size_vpss_line_buf_vpu33(num_vpp_pipes_enc, frame_height_coded,
> +							frame_width_coded);

Only this much belongs in this patch - the fix.

> 
>   	return se_lb_size + te_lb_size + fe_lb_size + md_lb_size + dma_opb_lb_size +
>   		dse_lb_size + size_vpss_lb_enc;
> @@ -2070,9 +2070,8 @@ static u32 iris_vpu4x_enc_line_size(struct iris_inst *inst)
>   {
>   	u32 num_vpp_pipes = inst->core->iris_platform_data->num_vpp_pipe;
>   	u32 lcu_size = inst->codec == V4L2_PIX_FMT_HEVC ? 32 : 16;
> -	struct v4l2_format *f = inst->fmt_dst;
> -	u32 height = f->fmt.pix_mp.height;
> -	u32 width = f->fmt.pix_mp.width;
> +	u32 height = iris_vpu_enc_get_bitstream_height(inst);
> +	u32 width = iris_vpu_enc_get_bitstream_width(inst);
> 
>   	return hfi_vpu4x_buffer_line_enc(width, height, 0, num_vpp_pipes,
>   					 lcu_size, inst->codec);
> 
> --
> 2.43.0
> 

This change should go into its own patch since the original here doesn't 
swap height and width, so if that is a fix, it should go into its own 
fixes patch.

Best practice is to stack your fixes at the start of your series so that 
you can be sure your fixes don't depend on whatever functionality you 
are enabling.

---
bod

  reply	other threads:[~2026-09-14 19:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 13:00 [PATCH 0/5] media: iris: add support for maili platform Wangao Wang
2026-09-14 13:00 ` [PATCH 1/5] dt-bindings: media: venus,common: Extend clocks and power domains Wangao Wang
2026-09-15  7:16   ` Krzysztof Kozlowski
2026-09-14 13:00 ` [PATCH 2/5] dt-bindings: media: qcom,maili-iris: Add maili video codec binding Wangao Wang
2026-09-15  7:33   ` Krzysztof Kozlowski
2026-09-14 13:00 ` [PATCH 3/5] media: iris: add AV1 decode buffer size support for vpu4x Wangao Wang
2026-09-14 19:42   ` Bryan O'Donoghue
2026-09-16  0:40     ` Deepa Guthyappa Madivalara
2026-09-14 13:00 ` [PATCH 4/5] media: iris: fix VPU4x encoder line buffer size calculations Wangao Wang
2026-09-14 19:49   ` Bryan O'Donoghue [this message]
2026-09-14 13:00 ` [PATCH 5/5] media: iris: add maili platform data Wangao Wang

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=28f71370-1cde-4b67-9201-b3d3c3f2cb85@kernel.org \
    --to=bod@kernel.org \
    --cc=abhinav.kumar@linux.dev \
    --cc=busanna.reddy@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=hverkuil+cisco@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=stanimir.k.varbanov@gmail.com \
    --cc=vikash.garodia@oss.qualcomm.com \
    --cc=wangao.wang@oss.qualcomm.com \
    /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®