mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sachin Kumar Garg <sachin.garg@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, kernel test robot <lkp@intel.com>,
	Sachin Kumar Garg <sachin.garg@oss.qualcomm.com>
Subject: [PATCH] media: iris: fix 64-bit division in iris_set_slice_count()
Date: Fri, 02 Oct 2026 13:14:21 +0530	[thread overview]
Message-ID: <20261002-iris-fix-divdi3-v1-1-b2284d7fd77b@oss.qualcomm.com> (raw)

inst->fw_caps[BITRATE].value is an s64, so dividing it by the frame
rate is a 64-bit division. On 32-bit architectures the compiler turns
this into a call to the libgcc helper __divdi3, which the kernel does
not provide, so the module fails to link.

The bitrate always fits in a u32, so copy it into a u32 local before
dividing, as iris_set_peak_bitrate() already does.

Fixes: 9abcab03dbf8 ("media: iris: add support for multi_slice in iris encoder")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610020426.oUzBZ3mH-lkp@intel.com/

Signed-off-by: Sachin Kumar Garg <sachin.garg@oss.qualcomm.com>
---
The original commit is 5f21cd9a4ae4 in next-20261001 and is
9abcab03dbf8 in the current venus-iris-next branch.
---
 drivers/media/platform/qcom/iris/iris_ctrls.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/iris/iris_ctrls.c b/drivers/media/platform/qcom/iris/iris_ctrls.c
index 8c4c47944f22..06d99b18310b 100644
--- a/drivers/media/platform/qcom/iris/iris_ctrls.c
+++ b/drivers/media/platform/qcom/iris/iris_ctrls.c
@@ -1548,6 +1548,7 @@ int iris_set_slice_count(struct iris_inst *inst, enum platform_inst_fw_cap_type
 	u32 mbpf = NUM_MBS_PER_FRAME(output_height, output_width);
 	u32 max_width, max_height, min_width, min_height;
 	u32 slice_mode = inst->fw_caps[cap_id].value;
+	u32 bitrate = inst->fw_caps[BITRATE].value;
 	u32 max_avg_slicesize, hfi_value, hfi_id;
 	u32 rc_type = inst->hfi_rc_type;
 	u32 fps = inst->frame_rate;
@@ -1588,7 +1589,7 @@ int iris_set_slice_count(struct iris_inst *inst, enum platform_inst_fw_cap_type
 	} else if (slice_mode == V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES) {
 		hfi_value = inst->fw_caps[SLICE_MAX_BYTES].value;
 		if (rc_type != HFI_RC_OFF) {
-			max_avg_slicesize = DIV_ROUND_UP((inst->fw_caps[BITRATE].value / fps) / 8,
+			max_avg_slicesize = DIV_ROUND_UP((bitrate / fps) / 8,
 							 slice_caps->max_slices_per_frame);
 		} else {
 			/*

---
base-commit: 9abcab03dbf81439e18d09f1f3869bc39290ce4d
change-id: 20261002-iris-fix-divdi3-44b1974118d8

Best regards,
-- 
Sachin Kumar Garg <sachin.garg@oss.qualcomm.com>


             reply	other threads:[~2026-10-02  7:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AgJq_ESuBnuRTD-nBYJ68Y7_6aBNuPB2wIzsm4CsQ7fkkkz1ZwjSkUsF8qior3pVbYSS26UV9MGkVBy0Nfu0cA==@protonmail.internalid>
2026-10-02  7:44 ` Sachin Kumar Garg [this message]
2026-10-02  8:52   ` Bryan O'Donoghue
     [not found] <WGjCcYNrTTl1nX0egc4fFtnjES8VeY1nYXm4v7kHVBNOSkChhctiUs2iU0KupHeUVt5uzgS6b3Re1MNJNK9riQ==@protonmail.internalid>
2026-10-01  0:46 ` Sasha Levin
2026-10-01  0:49   ` 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=20261002-iris-fix-divdi3-v1-1-b2284d7fd77b@oss.qualcomm.com \
    --to=sachin.garg@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=lkp@intel.com \
    --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®