From: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Bryan O'Donoghue <bod@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Saravana Kannan <saravanak@kernel.org>,
Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Stefan Schmidt <stefan.schmidt@linaro.org>,
Hans Verkuil <hverkuil@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Vishnu Reddy <busanna.reddy@oss.qualcomm.com>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux.dev,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Subject: Re: [PATCH v2 6/7] media: iris: add iris4 specific H265 line buffer calculation
Date: Wed, 4 Mar 2026 00:18:58 +0530 [thread overview]
Message-ID: <ce80e60e-90ca-415d-83af-4fe2e86ffd91@oss.qualcomm.com> (raw)
In-Reply-To: <cbwz5wtd55enswdi2zvvy3d66nsxlemyzdypheibvljnewmkax@kybx63aveepn>
On 2/28/2026 1:58 AM, Dmitry Baryshkov wrote:
> On Fri, Feb 27, 2026 at 07:41:22PM +0530, Vikash Garodia wrote:
>> The H265 decoder line buffer size calculation for iris4 (VPU4) was
>> previously reusing the iris3 formula. While this works for most
>> resolutions, certain configurations require a larger buffer size on
>> iris4, causing firmware errors during decode. This resolves firmware
>> failures seen with specific test vectors on kaanapali (iris4), and fixes
>> the following failing fluster tests
>> - PICSIZE_C_Bossen_1
>> - WPP_E_ericsson_MAIN_2
>
> This reminds me of the commit fixing SC7280 support. Should SC7280 or
> all VPU2.0 platforms also use separate formula?
>
for vpu2, there is already a separate formula
>>
>> Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
>> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
>> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
>> ---
>> drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 51 +++++++++++++++++++++-
>> 1 file changed, 50 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
>> index 9270422c16019ba658ee8813940cb9110ad030a1..a4d599c49ce9052b609b9cedf65f669ba78b5407 100644
>> --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
>> +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
>> @@ -1755,6 +1755,55 @@ static u32 hfi_vpu4x_buffer_line_vp9d(u32 frame_width, u32 frame_height, u32 _yu
>> return lb_size + dpb_obp_size;
>> }
>>
>> +static u32 hfi_vpu4x_buffer_line_h265d(u32 frame_width, u32 frame_height, bool is_opb,
>> + u32 num_vpp_pipes)
>> +{
>> + u32 num_lcu_per_pipe, fe_left_lb, se_left_lb, vsp_left_lb, top_lb, qp_size,
>> + dpb_obp = 0, lcu_size = 16;
>> +
>> + num_lcu_per_pipe = (DIV_ROUND_UP(frame_height, lcu_size) / num_vpp_pipes) +
>> + (DIV_ROUND_UP(frame_height, lcu_size) % num_vpp_pipes);
>> +
>> + fe_left_lb = ALIGN((DMA_ALIGNMENT * num_lcu_per_pipe), DMA_ALIGNMENT) *
>> + FE_LFT_CTRL_LINE_NUMBERS;
>> + fe_left_lb += ALIGN((DMA_ALIGNMENT * 2 * num_lcu_per_pipe), DMA_ALIGNMENT) *
>> + FE_LFT_DB_DATA_LINE_NUMBERS;
>> + fe_left_lb += ALIGN((DMA_ALIGNMENT * num_lcu_per_pipe), DMA_ALIGNMENT);
>> + fe_left_lb += ALIGN((DMA_ALIGNMENT * 2 * num_lcu_per_pipe), DMA_ALIGNMENT);
>> + fe_left_lb += ALIGN((DMA_ALIGNMENT * 8 * num_lcu_per_pipe), DMA_ALIGNMENT) *
>> + FE_LFT_LR_DATA_LINE_NUMBERS;
>> +
>> + if (is_opb)
>> + dpb_obp = size_dpb_opb(frame_height, lcu_size) * num_vpp_pipes;
>> +
>> + se_left_lb = max_t(u32, (ALIGN(frame_height, BUFFER_ALIGNMENT_16_BYTES) >> 3) *
>> + MAX_SE_NBR_CTRL_LCU16_LINE_BUFFER_SIZE,
>> + max_t(u32, (ALIGN(frame_height, BUFFER_ALIGNMENT_32_BYTES) >> 3) *
>> + MAX_SE_NBR_CTRL_LCU32_LINE_BUFFER_SIZE,
>> + (ALIGN(frame_height, BUFFER_ALIGNMENT_64_BYTES) >> 3) *
>> + MAX_SE_NBR_CTRL_LCU64_LINE_BUFFER_SIZE));
>> +
>> + vsp_left_lb = ALIGN(DIV_ROUND_UP(frame_height, BUFFER_ALIGNMENT_64_BYTES) *
>> + H265_NUM_TILE_ROW, DMA_ALIGNMENT);
>> +
>> + top_lb = ALIGN((DMA_ALIGNMENT * DIV_ROUND_UP(frame_width, lcu_size)), DMA_ALIGNMENT) *
>> + FE_TOP_CTRL_LINE_NUMBERS;
>> + top_lb += ALIGN(DMA_ALIGNMENT * 2 * DIV_ROUND_UP(frame_width, lcu_size), DMA_ALIGNMENT) *
>> + FE_TOP_DATA_LUMA_LINE_NUMBERS;
>> + top_lb += ALIGN(DMA_ALIGNMENT * 2 * (DIV_ROUND_UP(frame_width, lcu_size) + 1),
>> + DMA_ALIGNMENT) * FE_TOP_DATA_CHROMA_LINE_NUMBERS;
>> + top_lb += ALIGN(ALIGN(frame_width, BUFFER_ALIGNMENT_64_BYTES) * 2, DMA_ALIGNMENT);
>> + top_lb += ALIGN(ALIGN(frame_width, BUFFER_ALIGNMENT_64_BYTES) * 6, DMA_ALIGNMENT);
>> + top_lb += size_h265d_lb_vsp_top(frame_width, frame_height);
>> +
>> + qp_size = size_h265d_qp(frame_width, frame_height);
>> +
>> + return ((ALIGN(dpb_obp, DMA_ALIGNMENT) + ALIGN(se_left_lb, DMA_ALIGNMENT) +
>> + ALIGN(vsp_left_lb, DMA_ALIGNMENT)) * num_vpp_pipes) +
>> + ALIGN(fe_left_lb, DMA_ALIGNMENT) + ALIGN(top_lb, DMA_ALIGNMENT) +
>> + ALIGN(qp_size, DMA_ALIGNMENT);
>> +}
>> +
>> static u32 iris_vpu4x_dec_line_size(struct iris_inst *inst)
>> {
>> u32 num_vpp_pipes = inst->core->iris_platform_data->num_vpp_pipe;
>> @@ -1770,7 +1819,7 @@ static u32 iris_vpu4x_dec_line_size(struct iris_inst *inst)
>> if (inst->codec == V4L2_PIX_FMT_H264)
>> return hfi_buffer_line_h264d(width, height, is_opb, num_vpp_pipes);
>> else if (inst->codec == V4L2_PIX_FMT_HEVC)
>> - return hfi_buffer_line_h265d(width, height, is_opb, num_vpp_pipes);
>> + return hfi_vpu4x_buffer_line_h265d(width, height, is_opb, num_vpp_pipes);
>> else if (inst->codec == V4L2_PIX_FMT_VP9)
>> return hfi_vpu4x_buffer_line_vp9d(width, height, out_min_count, is_opb,
>> num_vpp_pipes);
>>
>> --
>> 2.34.1
>>
>
next prev parent reply other threads:[~2026-03-03 18:49 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 14:11 [PATCH v2 0/7] media: iris: add support for kaanapali platform Vikash Garodia
2026-02-27 14:11 ` [PATCH v2 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding Vikash Garodia
2026-02-27 15:42 ` Rob Herring (Arm)
2026-02-27 15:50 ` Krzysztof Kozlowski
2026-02-27 15:55 ` Krzysztof Kozlowski
2026-03-03 18:10 ` Vikash Garodia
2026-03-04 15:07 ` Krzysztof Kozlowski
2026-03-05 12:23 ` Vikash Garodia
2026-02-27 19:52 ` Dmitry Baryshkov
2026-03-03 18:13 ` Vikash Garodia
2026-03-03 23:53 ` Dmitry Baryshkov
2026-03-04 15:02 ` Vikash Garodia
2026-03-05 3:33 ` Dmitry Baryshkov
2026-02-27 14:11 ` [PATCH v2 2/7] media: iris: switch to hardware mode after firmware boot Vikash Garodia
2026-02-27 16:49 ` Konrad Dybcio
2026-03-03 18:15 ` Vikash Garodia
2026-03-04 8:57 ` Konrad Dybcio
2026-02-27 14:11 ` [PATCH v2 3/7] media: iris: add iris vpu bus support and register it with iommu_buses Vikash Garodia
2026-02-27 15:49 ` Krzysztof Kozlowski
2026-03-03 18:26 ` Vikash Garodia
2026-02-27 20:14 ` Dmitry Baryshkov
2026-02-27 14:11 ` [PATCH v2 4/7] media: iris: add context bank devices using iommu-map Vikash Garodia
2026-02-27 20:20 ` Dmitry Baryshkov
2026-03-03 18:46 ` Vikash Garodia
2026-03-03 22:25 ` Dmitry Baryshkov
2026-03-05 12:49 ` Vikash Garodia
2026-03-05 14:21 ` Dmitry Baryshkov
2026-03-05 17:26 ` Vikash Garodia
2026-03-05 18:32 ` Dmitry Baryshkov
2026-03-05 21:34 ` Vikash Garodia
2026-03-13 19:26 ` Dmitry Baryshkov
2026-02-27 14:11 ` [PATCH v2 5/7] media: iris: add helper to select context bank device Vikash Garodia
2026-02-27 20:27 ` Dmitry Baryshkov
2026-03-03 19:16 ` Vikash Garodia
2026-03-03 22:27 ` Dmitry Baryshkov
2026-03-04 15:29 ` Vikash Garodia
2026-03-05 3:40 ` Dmitry Baryshkov
2026-02-27 14:11 ` [PATCH v2 6/7] media: iris: add iris4 specific H265 line buffer calculation Vikash Garodia
2026-02-27 20:28 ` Dmitry Baryshkov
2026-03-03 18:48 ` Vikash Garodia [this message]
2026-03-03 22:28 ` Dmitry Baryshkov
2026-03-04 15:40 ` Vikash Garodia
2026-03-05 3:41 ` Dmitry Baryshkov
2026-02-27 14:11 ` [PATCH v2 7/7] media: iris: add platform data for kaanapali Vikash Garodia
2026-02-27 15:48 ` Krzysztof Kozlowski
2026-02-28 7:31 ` Dmitry Baryshkov
2026-02-27 15:42 ` [PATCH v2 0/7] media: iris: add support for kaanapali platform Bryan O'Donoghue
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=ce80e60e-90ca-415d-83af-4fe2e86ffd91@oss.qualcomm.com \
--to=vikash.garodia@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=busanna.reddy@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=hverkuil+cisco@kernel.org \
--cc=hverkuil@kernel.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=krzk+dt@kernel.org \
--cc=krzk@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=robin.murphy@arm.com \
--cc=saravanak@kernel.org \
--cc=stefan.schmidt@linaro.org \
--cc=will@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