mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vikash Garodia <quic_vgarodia@quicinc.com>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	Dikshita Agarwal <quic_dikshita@quicinc.com>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Stefan Schmidt <stefan.schmidt@linaro.org>,
	"Vedang Nagar" <quic_vnagar@quicinc.com>,
	Hans Verkuil <hverkuil@kernel.org>
Cc: <linux-media@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Renjiang Han <quic_renjiang@quicinc.com>,
	Wangao Wang <quic_wangaow@quicinc.com>
Subject: Re: [PATCH v3 00/26] Enable H.264/H.265 encoder support and fixes in iris driver common code
Date: Thu, 21 Aug 2025 15:54:42 +0530	[thread overview]
Message-ID: <a2d2e93f-30d9-cecb-174e-81249a90d09c@quicinc.com> (raw)
In-Reply-To: <086d3bce-b8fa-40fd-8efd-9e457bb01650@linaro.org>


On 8/21/2025 2:14 PM, Neil Armstrong wrote:
> Hi,
> 
> On 21/08/2025 09:56, Vikash Garodia wrote:
>>
>> On 8/21/2025 12:51 PM, Dikshita Agarwal wrote:
>>>> The change occurs around Aug 14 2024, So I checked the downstream driver
>>>> and I found that fixes the encoding:
>>>> ===========================><=================================================
>>>> --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
>>>> +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
>>>> @@ -863,9 +863,18 @@ static inline
>>>>   u32 size_vpss_line_buf(u32 num_vpp_pipes_enc, u32 frame_height_coded,
>>>>                         u32 frame_width_coded)
>>>>   {
>>>> -       return ALIGN(((((((8192) >> 2) << 5) * (num_vpp_pipes_enc)) + 64) +
>>>> -                     (((((max_t(u32, (frame_width_coded),
>>>> -                                (frame_height_coded)) + 3) >> 2) << 5) +
>>>> 256) * 16)), 256);
>>>> +       u32 vpss_4tap_top = 0, vpss_4tap_left = 0, vpss_div2_top = 0,
>>>> vpss_div2_left = 0, vpss_top_lb = 0, vpss_left_lb = 0, size_left = 0,
>>>> size_top = 0;
>>>> +
>>>> +       vpss_4tap_top = ((((max_t(u32, frame_width_coded,
>>>> frame_height_coded) * 2) + 3) >> 2) << 4) + 256;
>>>> +       vpss_4tap_left = (((8192 + 3) >> 2) << 5) + 64;
>>>> +       vpss_div2_top = (((max_t(u32,frame_width_coded, frame_height_coded)
>>>> + 3) >> 2) << 4) + 256;
>>>> +       vpss_div2_left = ((((max_t(u32, frame_width_coded,
>>>> frame_height_coded)* 2) + 3) >> 2) << 5) + 64;
>>>> +       vpss_top_lb = (frame_width_coded + 1) << 3;
>>>> +       vpss_left_lb = (frame_height_coded << 3) * num_vpp_pipes_enc;
>>>> +       size_left = (vpss_4tap_left + vpss_div2_left) * 2 * num_vpp_pipes_enc;
>>>> +       size_top = (vpss_4tap_top + vpss_div2_top) * 2;
>>>> +
>>>> +       return ALIGN(size_left + size_top + vpss_top_lb + vpss_left_lb,
>>>> DMA_ALIGNMENT);
>>>>   }
>>> Seems this calculation is different for iris3 and iris33, hence you see
>>> this issue on SM8650.
>>>
>>> Updating this calculation in common code will increase the buffer size with
>>> from ~400KB to ~2.2 MBs (for 640x480) and even more for higher resolution.
>>>
>>> @vikash, pls comment if we should update in common code or have this
>>> implemented specific for iris33 separately using some ops.
>>
>> increasing 1.8 MBs for VGA and assuming it grows further for higher resolution,
>> i would recommend to separate it out for line buffer alone.
>>
>> Neil,
>> We are doing something similar as a preparation for enabling an upcoming SOC,
>> maybe let me share the pseudo code offline with you. When you add encode support
>> for SM8650, you can raise that change to extend the line buffer calculation for
>> iris33.
> 
> I don't understand your point, encoding is already enabled with this patchset and
> works fine with _old_ firmwares, it just completely fail to encode anything with
> the firmware sent on linux-firmware yesterday.

IIUC, the patch looks to increase the size of line buffer, and it worked with
the firmware could be due to increased size meeting the firmware need. I was
trying to say that if there is an increase in size (in MBs), it is not a good
idea to increase in common which increases for all enabled SOCs.
> 
> But yes I can provide a fixup patch for vpu33 on top of this serie to be merged
> in the same
> time based on your pseudo code.

Shared with you on a way to abstract the line buffer calculation for iris33 soc.
> 
> Neil
> 
>>
>> Regards,
>> Vikash
> 

  reply	other threads:[~2025-08-21 10:25 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20  9:07 Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 01/26] media: iris: Fix buffer count reporting in internal buffer check Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 02/26] media: iris: Report unreleased PERSIST buffers on session close Dikshita Agarwal
2025-08-21  8:03   ` Bryan O'Donoghue
2025-08-20  9:07 ` [PATCH v3 03/26] media: iris: Fix memory leak by freeing untracked persist buffer Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 04/26] media: iris: Fix port streaming handling Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 05/26] media: iris: Allow substate transition to load resources during output streaming Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 06/26] media: iris: Always destroy internal buffers on firmware release response Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 07/26] media: iris: Update vbuf flags before v4l2_m2m_buf_done Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 08/26] media: iris: Simplify session stop logic by relying on vb2 checks Dikshita Agarwal
2025-08-25  5:47   ` Vikash Garodia
2025-08-20  9:07 ` [PATCH v3 09/26] media: iris: Allow stop on firmware only if start was issued Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 10/26] media: iris: Send dummy buffer address for all codecs during drain Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 11/26] media: iris: Fix missing LAST flag handling " Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 12/26] media: iris: Fix format check for CAPTURE plane in try_fmt Dikshita Agarwal
2025-08-25  5:49   ` Vikash Garodia
2025-08-20  9:07 ` [PATCH v3 13/26] media: iris: Add support for video encoder device Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 14/26] media: iris: Initialize and deinitialize encoder instance structure Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 15/26] media: iris: Add support for ENUM_FMT, S/G/TRY_FMT encoder Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 16/26] media: iris: Add support for ENUM_FRAMESIZES/FRAMEINTERVALS for encoder Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 17/26] media: iris: Add support for VIDIOC_QUERYCAP for encoder video device Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 18/26] media: iris: Add encoder support for V4L2 event subscription Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 19/26] media: iris: Add support for G/S_SELECTION for encoder video device Dikshita Agarwal
2025-08-20  9:07 ` [PATCH v3 20/26] media: iris: Add support for G/S_PARM " Dikshita Agarwal
2025-08-25  5:56   ` Vikash Garodia
2025-08-20  9:07 ` [PATCH v3 21/26] media: iris: Add platform-specific capabilities " Dikshita Agarwal
2025-08-20  9:08 ` [PATCH v3 22/26] media: iris: Add V4L2 streaming support " Dikshita Agarwal
2025-08-25  6:06   ` Vikash Garodia
2025-08-20  9:08 ` [PATCH v3 23/26] media: iris: Set platform capabilities to firmware " Dikshita Agarwal
2025-08-25  6:09   ` Vikash Garodia
2025-08-20  9:08 ` [PATCH v3 24/26] media: iris: Allocate and queue internal buffers " Dikshita Agarwal
2025-08-25  6:15   ` Vikash Garodia
2025-08-20  9:08 ` [PATCH v3 25/26] media: iris: Add support for buffer management ioctls for encoder device Dikshita Agarwal
2025-08-25  6:20   ` Vikash Garodia
2025-08-20  9:08 ` [PATCH v3 26/26] media: iris: Add support for drain sequence in encoder video device Dikshita Agarwal
2025-08-25  6:22   ` Vikash Garodia
2025-08-20 14:59 ` [PATCH v3 00/26] Enable H.264/H.265 encoder support and fixes in iris driver common code Neil Armstrong
2025-08-21  7:21   ` Dikshita Agarwal
2025-08-21  7:56     ` Vikash Garodia
2025-08-21  8:44       ` Neil Armstrong
2025-08-21 10:24         ` Vikash Garodia [this message]
2025-08-21 12:58     ` Neil Armstrong
2025-08-22  7:02       ` Dikshita Agarwal
2025-08-22  8:17         ` Neil Armstrong
2025-08-22 10:09           ` Vikash Garodia
2025-08-22 11:08             ` Neil Armstrong
2025-08-25  4:15               ` Dikshita Agarwal
2025-08-25  5:43               ` Vikash Garodia
2025-08-22 11:29 ` Neil Armstrong
2025-08-25  6:29   ` Vikash Garodia

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=a2d2e93f-30d9-cecb-174e-81249a90d09c@quicinc.com \
    --to=quic_vgarodia@quicinc.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=bryan.odonoghue@linaro.org \
    --cc=hverkuil@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=neil.armstrong@linaro.org \
    --cc=quic_dikshita@quicinc.com \
    --cc=quic_renjiang@quicinc.com \
    --cc=quic_vnagar@quicinc.com \
    --cc=quic_wangaow@quicinc.com \
    --cc=stefan.schmidt@linaro.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®