From: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
To: bod@kernel.org
Cc: Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] media: iris: optimize COMV buffer allocation for VPU3x and VPU4x
Date: Sat, 30 May 2026 14:54:34 +0530 [thread overview]
Message-ID: <4d2823d3-567e-4c6e-0950-3f0df80ff184@oss.qualcomm.com> (raw)
In-Reply-To: <178010072997.281459.14229826511412321235.b4-reply@b4>
On 5/30/2026 5:55 AM, bod@kernel.org wrote:
> On 2026-05-14 00:28 +0530, Vishnu Reddy wrote:
>> The existing iris_vpu_dec_comv_size() used VIDEO_MAX_FRAME (32) as
>> num_comv count unconditionally when calculating the co-located motion
>> vector (COMV) buffer size. This resulted in an oversized COMV buffer
>> allocation throughout decode session, wasting memory regardless of
>> actual number of buffers required.
>>
>> For VPU3x and VPU4x platforms, introduce iris_vpu3x_4x_dec_comv_size() to
>> replace iris_vpu_dec_comv_size(). These derive num_comv dynamically, it
>> uses inst->fw_min_count once the firmware has reported its buffer
>> requirements, and fallback to output count during initialization before
>> firmware has communicated its requirements. This aligns the COMV buffer
>> size to the actual count needed rather than always allocating with fixed
>> VIDEO_MAX_FRAME value.
>>
>> Additionally, during iris_vdec_inst_init(), fw_min_count was initialized
>> to MIN_BUFFERS instead of 0. This masked the fallback logic and caused the
>> COMV size calculation to use MIN_BUFFERS even before firmware had reported
>> its actual requirements. Fix this by initializing fw_min_count to 0.
>>
>> During testing of 1080p AVC, it reduces the COMV buffer size from 32.89MB
>> to 6.16MB per decode session, significantly reducing memory consumption.
>>
>> Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
>> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
>> ---
>> Changes in v4:
>> - Rebase on linux-media/users/bodonoghue next+fixes
>> - Resolve merge conflicts due to merged patch "media: qcom: iris: don't
>> use function indirection in gen2-specific code"
>> - Link to v3: https://lore.kernel.org/all/20260506-optimize_comv_buffer-v3-1-c1b4a44e4300@oss.qualcomm.com/
>>
>> Changes in v3:
>> - Update num_comv from instance data instead of using caps num_comv
>> in set_num_comv function to avoid wrong value update during concurrency.
>> - Link to v2: https://lore.kernel.org/r/20260504-optimize_comv_buffer-v2-1-69379a59e17d@oss.qualcomm.com
>>
>> Changes in v2:
>> - Update commit description (Bryan)
>> - Update hfi comv buffer count value to use actual num_comv count which
>> used for buffer calculation to avoid any overhead or fixed values (Vikash)
>> - Link to v1: https://lore.kernel.org/r/20260421-optimize_comv_buffer-v1-1-7c9a24da3ad3@oss.qualcomm.com
> Please rebase.
Hi Bryan,
I checked that the patch is already present in linux-media/users/bodonoghue →
venus-iris-next.
It also applies cleanly on the following branches:
linux-next → master
media tree → next
linux-media/users/bodonoghue → next
linux-media/users/bodonoghue → next+fixes
linux-media/users/bodonoghue → next-smoketest
Could you please let me know on which branch the patch is not applying
cleanly and where exactly you'd like me to rebase?
Thanks,
Vishnu Reddy.
> <<< deckard@inspiron14p-linux~/Development/linux-worktrees/b4/bod-media-committers-next-plaform-qcom
>>>> b4 shazam 20260514-optimize_comv_buffer-v4-1-7da70b586aec@oss.qualcomm.com ‹git:next-smoketest ✘› 01:14.01 Sat May 30 2026 >>>
> Looking up https://lore.kernel.org/all/20260514-optimize_comv_buffer-v4-1-7da70b586aec@oss.qualcomm.com/
> Grabbing thread from lore.kernel.org/all/20260514-optimize_comv_buffer-v4-1-7da70b586aec@oss.qualcomm.com/t.mbox.gz
> Checking for newer revisions
> Grabbing search results from lore.kernel.org
> Nothing matching that query.
> Analyzing 1 messages in the thread
> Looking for additional code-review trailers on lore.kernel.org
> Analyzing 0 code-review messages
> Checking attestation on all messages, may take a moment...
> ---
> ✗ [PATCH v4] media: iris: optimize COMV buffer allocation for VPU3x and VPU4x
> ---
> ✗ No key: ed25519/busanna.reddy@oss.qualcomm.com
> ---
> NOTE: install dkimpy for DKIM signature verification
> ---
> Total patches: 1
> ---
> Applying: media: iris: optimize COMV buffer allocation for VPU3x and VPU4x
> Patch failed at 0001 media: iris: optimize COMV buffer allocation for VPU3x and VPU4x
> error: patch failed: drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c:10
> error: drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c: patch does not apply
> error: patch failed: drivers/media/platform/qcom/iris/iris_platform_common.h:87
> error: drivers/media/platform/qcom/iris/iris_platform_common.h: patch does not apply
> error: patch failed: drivers/media/platform/qcom/iris/iris_platform_qcs8300.h:15
> error: drivers/media/platform/qcom/iris/iris_platform_qcs8300.h: patch does not apply
> error: patch failed: drivers/media/platform/qcom/iris/iris_platform_sm8550.h:23
> error: drivers/media/platform/qcom/iris/iris_platform_sm8550.h: patch does not apply
> error: patch failed: drivers/media/platform/qcom/iris/iris_vdec.c:24
> error: drivers/media/platform/qcom/iris/iris_vdec.c: patch does not apply
> error: patch failed: drivers/media/platform/qcom/iris/iris_vpu_buffer.c:2025
> error: drivers/media/platform/qcom/iris/iris_vpu_buffer.c: patch does not apply
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> hint: When you have resolved this problem, run "git am --continue".
> hint: If you prefer to skip this patch, run "git am --skip" instead.
> hint: To restore the original branch and stop patching, run "git am --abort".
> hint: Disable this message with "git config set advice.mergeConflict false"
>
> ---
> bod
>
next prev parent reply other threads:[~2026-05-30 9:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 18:58 Vishnu Reddy
2026-05-30 0:25 ` bod
2026-05-30 9:24 ` Vishnu Reddy [this message]
2026-05-30 16:21 ` 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=4d2823d3-567e-4c6e-0950-3f0df80ff184@oss.qualcomm.com \
--to=busanna.reddy@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=bod@kernel.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=vikash.garodia@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®