From: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
To: Wangao Wang <wangao.wang@oss.qualcomm.com>,
dikshita.agarwal@oss.qualcomm.com, abhinav.kumar@linux.dev,
bod@kernel.org, mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, quic_qiweil@quicinc.com,
quic_renjiang@quicinc.com
Subject: Re: [PATCH v1 1/4] media: qcom: iris: Add support for scale and improve format alignment
Date: Tue, 28 Oct 2025 16:09:44 +0530 [thread overview]
Message-ID: <2898f1bc-c014-b196-705a-cd797be92dce@oss.qualcomm.com> (raw)
In-Reply-To: <20251015092708.3703-2-wangao.wang@oss.qualcomm.com>
On 10/15/2025 2:57 PM, Wangao Wang wrote:
> Add output width and height settings in iris_venc_s_fmt_output to
> enable scaling functionality.
>
> Add members enc_raw_width, enc_raw_height, enc_bitstream_width and
> enc_bitstream_height to the struct iris_inst to support codec
> alignment requirements.
>
> HFI_PROP_CROP_OFFSETS is used to inform the firmware of the region
> of interest, rather than indicating that the codec supports crop.
> Therefore, the crop handling has been corrected accordingly.
>
> Signed-off-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
> ---
> .../qcom/iris/iris_hfi_gen2_command.c | 18 ++++++++----
> .../media/platform/qcom/iris/iris_instance.h | 8 ++++++
> drivers/media/platform/qcom/iris/iris_venc.c | 28 ++++++++++++++++---
> 3 files changed, 44 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
> index 4ce71a142508..c2258dfb2a8a 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
> @@ -168,9 +168,12 @@ static int iris_hfi_gen2_session_set_property(struct iris_inst *inst, u32 packet
>
> static int iris_hfi_gen2_set_raw_resolution(struct iris_inst *inst, u32 plane)
> {
> - u32 resolution = inst->fmt_src->fmt.pix_mp.width << 16 |
> - inst->fmt_src->fmt.pix_mp.height;
> u32 port = iris_hfi_gen2_get_port(inst, plane);
> + u32 resolution, codec_align;
> +
> + codec_align = inst->codec == V4L2_PIX_FMT_HEVC ? 32 : 16;
> + resolution = ALIGN(inst->enc_raw_width, codec_align) << 16 |
> + ALIGN(inst->enc_raw_height, codec_align);
HFI_PROP_RAW_RESOLUTION interface expects actual YUV resolution. It is not
suppose to be aligned while configuring it to firmware.
>
> return iris_hfi_gen2_session_set_property(inst,
> HFI_PROP_RAW_RESOLUTION,
> @@ -195,8 +198,8 @@ static int iris_hfi_gen2_set_bitstream_resolution(struct iris_inst *inst, u32 pl
> payload_type = HFI_PAYLOAD_U32;
> } else {
> codec_align = inst->codec == V4L2_PIX_FMT_HEVC ? 32 : 16;
> - resolution = ALIGN(inst->fmt_dst->fmt.pix_mp.width, codec_align) << 16 |
> - ALIGN(inst->fmt_dst->fmt.pix_mp.height, codec_align);
> + resolution = ALIGN(inst->enc_bitstream_width, codec_align) << 16 |
> + ALIGN(inst->enc_bitstream_height, codec_align);
Do we really need *bitstream variable here ? What is the concern in using the
instance capture fmt height and width ?
> inst_hfi_gen2->dst_subcr_params.bitstream_resolution = resolution;
> payload_type = HFI_PAYLOAD_32_PACKED;
> }
> @@ -216,8 +219,11 @@ static int iris_hfi_gen2_set_crop_offsets(struct iris_inst *inst, u32 plane)
> u32 port = iris_hfi_gen2_get_port(inst, plane);
> u32 bottom_offset, right_offset;
> u32 left_offset, top_offset;
> + u32 codec_align;
> u32 payload[2];
>
> + codec_align = inst->codec == V4L2_PIX_FMT_HEVC ? 32 : 16;
> +
> if (inst->domain == DECODER) {
> if (V4L2_TYPE_IS_OUTPUT(plane)) {
> bottom_offset = (inst->fmt_src->fmt.pix_mp.height - inst->crop.height);
> @@ -231,8 +237,8 @@ static int iris_hfi_gen2_set_crop_offsets(struct iris_inst *inst, u32 plane)
> top_offset = inst->compose.top;
> }
> } else {
> - bottom_offset = (inst->fmt_src->fmt.pix_mp.height - inst->crop.height);
> - right_offset = (inst->fmt_src->fmt.pix_mp.width - inst->crop.width);
> + bottom_offset = (ALIGN(inst->enc_raw_height, codec_align) - inst->enc_raw_height);
> + right_offset = (ALIGN(inst->enc_raw_width, codec_align) - inst->enc_raw_width);
I would suggest as below:
S_FMT (output) -> Keep the driver fmt same as what client sets in s_fmt.
So crop setting here could be "inst->fmt_src->fmt.pix_mp.height - inst->crop.height"
without the need of additional variable ?
Could you fix s_fmt and other places and run through compliance/ffmpeg to see it
works well ?
Regards,
Vikash
next prev parent reply other threads:[~2025-10-28 10:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 9:27 [PATCH v1 0/4] media: qcom: iris: encoder feature enhancements Wangao Wang
2025-10-15 9:27 ` [PATCH v1 1/4] media: qcom: iris: Add support for scale and improve format alignment Wangao Wang
2025-10-15 16:00 ` Bryan O'Donoghue
2025-10-17 5:43 ` Wangao Wang
2025-10-28 10:39 ` Vikash Garodia [this message]
2025-10-31 7:12 ` Dikshita Agarwal
2025-10-15 9:27 ` [PATCH v1 2/4] media: qcom: iris: Add rotation support for encoder Wangao Wang
2025-10-15 16:08 ` Bryan O'Donoghue
2025-10-17 5:54 ` Wangao Wang
2025-10-31 7:14 ` Dikshita Agarwal
2025-10-15 9:27 ` [PATCH v1 3/4] media: qcom: iris: Add flip " Wangao Wang
2025-10-15 9:27 ` [PATCH v1 4/4] media: qcom: iris: Add intra refresh " Wangao Wang
2025-10-17 9:55 ` [PATCH v1 0/4] media: qcom: iris: encoder feature enhancements Neil Armstrong
2025-10-27 7:40 ` 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=2898f1bc-c014-b196-705a-cd797be92dce@oss.qualcomm.com \
--to=vikash.garodia@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=quic_qiweil@quicinc.com \
--cc=quic_renjiang@quicinc.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®