From: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
To: Wangao Wang <wangao.wang@oss.qualcomm.com>,
Vikash Garodia <vikash.garodia@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,
Neil Armstrong <neil.armstrong@linaro.org>,
quic_qiweil@quicinc.com, quic_renjiang@quicinc.com
Subject: Re: [PATCH v4 2/6] media: qcom: iris: Improve crop_offset handling for encoder
Date: Fri, 7 Nov 2025 15:55:49 +0530 [thread overview]
Message-ID: <1728c571-1e25-59e2-beae-124d9976fb3f@oss.qualcomm.com> (raw)
In-Reply-To: <20251106-iris_encoder_enhancements-v4-2-5d6cff963f1b@oss.qualcomm.com>
On 11/6/2025 9:00 AM, Wangao Wang wrote:
> The setting of HFI_PROP_CROP_OFFSETS for the OUTPUT port is correct,
> but on the CAPTURE port it is used to inform the firmware about the
> ROI, so crop_offset needs to be handled accordingly.
>
> Signed-off-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
Does CROP use case work with just this patch and first one?
Since you are enabling different features in your series, pls make sure
features are working with individual patches.
Thanks,
Dikshita
> ---
> .../media/platform/qcom/iris/iris_hfi_gen2_command.c | 18 ++++++++++++++----
> drivers/media/platform/qcom/iris/iris_venc.c | 4 ++--
> 2 files changed, 16 insertions(+), 6 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 aaa79dfe2db281bb77be7274233f093b0086b5d4..69034e1ea8eb64440646776a40dcc657453916db 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
> @@ -215,8 +215,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);
> @@ -230,10 +233,17 @@ static int iris_hfi_gen2_set_crop_offsets(struct iris_inst *inst, u32 plane)
> top_offset = inst->compose.top;
> }
> } else {
> - bottom_offset = (inst->fmt_dst->fmt.pix_mp.height - inst->enc_raw_height);
> - right_offset = (inst->fmt_dst->fmt.pix_mp.width - inst->enc_raw_width);
> - left_offset = inst->crop.left;
> - top_offset = inst->crop.top;
> + if (V4L2_TYPE_IS_OUTPUT(plane)) {
> + bottom_offset = (inst->enc_raw_height - inst->crop.height);
> + right_offset = (inst->enc_raw_width - inst->crop.width);
> + left_offset = inst->crop.left;
> + top_offset = inst->crop.top;
> + } else {
> + bottom_offset = (inst->fmt_dst->fmt.pix_mp.height - inst->enc_raw_height);
> + right_offset = (inst->fmt_dst->fmt.pix_mp.width - inst->enc_raw_width);
> + left_offset = 0;
> + top_offset = 0;
> + }
> }
>
> payload[0] = FIELD_PREP(GENMASK(31, 16), left_offset) | top_offset;
> diff --git a/drivers/media/platform/qcom/iris/iris_venc.c b/drivers/media/platform/qcom/iris/iris_venc.c
> index 50a3eb975a2523abf1c2df128a66a762a1ed35c6..7ad747d2272f029e69a56572a188a032f898a3fb 100644
> --- a/drivers/media/platform/qcom/iris/iris_venc.c
> +++ b/drivers/media/platform/qcom/iris/iris_venc.c
> @@ -62,8 +62,8 @@ int iris_venc_inst_init(struct iris_inst *inst)
>
> inst->crop.left = 0;
> inst->crop.top = 0;
> - inst->crop.width = f->fmt.pix_mp.width;
> - inst->crop.height = f->fmt.pix_mp.height;
> + inst->crop.width = DEFAULT_WIDTH;
> + inst->crop.height = DEFAULT_HEIGHT;
>
> inst->operating_rate = DEFAULT_FPS;
> inst->frame_rate = DEFAULT_FPS;
>
next prev parent reply other threads:[~2025-11-07 10:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 3:30 [PATCH v4 0/6] media: qcom: iris: encoder feature enhancements Wangao Wang
2025-11-06 3:30 ` [PATCH v4 1/6] media: qcom: iris: Improve format alignment for encoder Wangao Wang
2025-11-07 8:42 ` Dikshita Agarwal
2025-11-10 2:34 ` Wangao Wang
2025-11-06 3:30 ` [PATCH v4 2/6] media: qcom: iris: Improve crop_offset handling " Wangao Wang
2025-11-07 10:25 ` Dikshita Agarwal [this message]
2025-11-10 2:37 ` Wangao Wang
2025-11-06 3:30 ` [PATCH v4 3/6] media: qcom: iris: Add scale support " Wangao Wang
2025-11-06 3:30 ` [PATCH v4 4/6] media: qcom: iris: Add rotation " Wangao Wang
2025-11-07 8:45 ` Dikshita Agarwal
2025-11-06 3:30 ` [PATCH v4 5/6] media: qcom: iris: Add flip " Wangao Wang
2025-11-07 8:46 ` Dikshita Agarwal
2025-11-06 3:30 ` [PATCH v4 6/6] media: qcom: iris: Add intra refresh " Wangao Wang
2025-11-07 9:05 ` Dikshita Agarwal
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=1728c571-1e25-59e2-beae-124d9976fb3f@oss.qualcomm.com \
--to=dikshita.agarwal@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=bod@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_qiweil@quicinc.com \
--cc=quic_renjiang@quicinc.com \
--cc=vikash.garodia@oss.qualcomm.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®