mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wangao Wang <wangao.wang@oss.qualcomm.com>
To: Bryan O'Donoghue <bod@kernel.org>,
	vikash.garodia@oss.qualcomm.com,
	dikshita.agarwal@oss.qualcomm.com, abhinav.kumar@linux.dev,
	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,
	Wangao Wang <wangao.wang@oss.qualcomm.com>
Subject: Re: [PATCH v1 2/4] media: qcom: iris: Add rotation support for encoder
Date: Fri, 17 Oct 2025 13:54:41 +0800	[thread overview]
Message-ID: <c18043c0-253a-4681-8ade-659b8652a90e@oss.qualcomm.com> (raw)
In-Reply-To: <437c380e-885e-4458-9913-788ece5a4ecc@kernel.org>

On 10/16/2025 12:08 AM, Bryan O'Donoghue wrote:
>> 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->enc_bitstream_width, codec_align) << 
>> 16 |
>> -            ALIGN(inst->enc_bitstream_height, codec_align);
>> +        if (is_rotation_90_or_270(inst))
>> +            resolution = ALIGN(inst->enc_bitstream_height, 
>> codec_align) << 16 |
>> +                ALIGN(inst->enc_bitstream_width, codec_align);
>> +        else
>> +            resolution = ALIGN(inst->enc_bitstream_width, 
>> codec_align) << 16 |
>> +                ALIGN(inst->enc_bitstream_height, codec_align);
> 
> That complex assignement can be expressed as a macro, static inline or 
> just a regular method instead of copy/paste the same code with one 
> variable changed.
> 
You're right, this code is reused in several places. I will address it 
in v2.>>   inline bool is_scaling_enabled(struct iris_inst *inst)
>>   {
>> -    return inst->crop.left != inst->compose.left ||
>> -        inst->crop.top != inst->compose.top ||
>> -        inst->crop.width != inst->compose.width ||
>> -        inst->crop.height != inst->compose.height;
>> +    return inst->fmt_dst->fmt.pix_mp.width != inst->fmt_src- 
>> >fmt.pix_mp.width ||
>> +        inst->fmt_dst->fmt.pix_mp.height != inst->fmt_src- 
>> >fmt.pix_mp.height;
> 
> These long chains of indirection make the code not very readable
> 
> Please take pointers to &fmt_dts->fmt and &fmt_src->fmt and reduce this 
> clause.
> 
Sure, will update in v2.

-- 
Best Regards,
Wangao


  reply	other threads:[~2025-10-17  5:54 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
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 [this message]
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=c18043c0-253a-4681-8ade-659b8652a90e@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=quic_qiweil@quicinc.com \
    --cc=quic_renjiang@quicinc.com \
    --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®