All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wangao Wang <wangao.wang@oss.qualcomm.com>
To: Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
	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>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Wangao Wang <wangao.wang@oss.qualcomm.com>,
	Neil Armstrong <neil.armstrong@linaro.org>
Subject: [PATCH v7 6/6] media: qcom: iris: Simplify COMV size calculation
Date: Tue, 12 May 2026 16:55:15 +0800	[thread overview]
Message-ID: <20260512-batch2_features-v7-6-4954e3b4df84@oss.qualcomm.com> (raw)
In-Reply-To: <20260512-batch2_features-v7-0-4954e3b4df84@oss.qualcomm.com>

Unify AVC/HEVC handling by computing codec and lcu_size upfront.

Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
Signed-off-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
---
 drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
index c2cd4adc082394a9ab6f32a37fe4e57678019d89..f55db869fee4d64273763fd3f98d286f58e2e7b1 100644
--- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
+++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
@@ -1014,16 +1014,13 @@ static u32 iris_vpu_enc_comv_size(struct iris_inst *inst)
 	u32 height = iris_vpu_enc_get_bitstream_height(inst);
 	u32 width = iris_vpu_enc_get_bitstream_width(inst);
 	u32 num_recon = hfi_buffer_get_recon_count(inst);
-	u32 lcu_size = 16;
+	u32 codec, lcu_size;
 
-	if (inst->codec == V4L2_PIX_FMT_HEVC) {
-		lcu_size = 32;
-		return hfi_buffer_comv_enc(width, height, lcu_size,
-					   num_recon + 1, HFI_CODEC_ENCODE_HEVC);
-	}
+	codec = (inst->codec == V4L2_PIX_FMT_HEVC) ?
+		HFI_CODEC_ENCODE_HEVC : HFI_CODEC_ENCODE_AVC;
+	lcu_size = (inst->codec == V4L2_PIX_FMT_HEVC) ? 32 : 16;
 
-	return hfi_buffer_comv_enc(width, height, lcu_size,
-				   num_recon + 1, HFI_CODEC_ENCODE_AVC);
+	return hfi_buffer_comv_enc(width, height, lcu_size, num_recon + 1, codec);
 }
 
 static inline

-- 
2.43.0


  parent reply	other threads:[~2026-05-12  8:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AeTY6px6rgEkRtdav105VvaVqOXn4ANY-7FkwVUXdoipWmEG0iNRHi3qX4YK3yYKjWgEOIBc4iCohfNbuDxa5w==@protonmail.internalid>
2026-05-12  8:55 ` [PATCH v7 0/6] media: qcom: iris: encoder feature enhancements batch2 Wangao Wang
2026-05-12  8:55   ` [PATCH v7 1/6] media: qcom: iris: Add intra refresh support for gen1 encoder Wangao Wang
2026-05-13 10:49     ` Dmitry Baryshkov
2026-05-12  8:55   ` [PATCH v7 2/6] media: qcom: iris: Add Long-Term Reference support for encoder Wangao Wang
2026-05-13 10:56     ` Dmitry Baryshkov
2026-05-14  2:43       ` Wangao Wang
2026-05-12  8:55   ` [PATCH v7 3/6] media: qcom: iris: Add B frames " Wangao Wang
2026-05-13 11:00     ` Dmitry Baryshkov
2026-05-14  3:01       ` Wangao Wang
2026-05-12  8:55   ` [PATCH v7 4/6] media: qcom: iris: Add hierarchical coding " Wangao Wang
2026-05-13 11:07     ` Dmitry Baryshkov
2026-05-14  3:05       ` Wangao Wang
2026-05-12  8:55   ` [PATCH v7 5/6] media: qcom: iris: Optimize iris_hfi_gen1_packet_session_set_property Wangao Wang
2026-05-13 11:10     ` Dmitry Baryshkov
2026-05-12  8:55   ` Wangao Wang [this message]
2026-05-13 11:11     ` [PATCH v7 6/6] media: qcom: iris: Simplify COMV size calculation Dmitry Baryshkov
2026-05-12  9:00   ` [PATCH v7 0/6] media: qcom: iris: encoder feature enhancements batch2 Bryan O'Donoghue
2026-05-13  7:28     ` 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=20260512-batch2_features-v7-6-4954e3b4df84@oss.qualcomm.com \
    --to=wangao.wang@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=neil.armstrong@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.