Skip to content

media: nxp: imx8-isi: Fix scaler rounding and downscaling limits

Guoniu Zhou imx linux-arm-kernel linux-media lkml stable 4 versions – In review

Get series with b4
b4 am [email protected] change-id 20260122-isi-74f87fbb9a6f

Versions newest first

  1. v3 Latest2 patches 2 repliesIn review
  2. v2 posting 2/21 patch 2 repliesSuperseded
  3. v2 posting 1/21 patch 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch1 replySuperseded

Changes in v3 from the cover letter

- New patch 2/2 to fix scale factor rounding
- Replace CLAMP_DOWNSCALE_16 macro with inline function
- Adjust downscale threshold from 0x4000 to 0x2000
- Clarify downscaling limit in comment
- Link to v2: https://lore.kernel.org/all/[email protected]/

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2media: nxp: imx8-isi: Fix potential out-of-bounds issuesdrivers/media/platform/nxp/imx8-isi/imx8-isi-core.h drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c +1 more+33 -91 reply
2/2media: nxp: imx8-isi: Fix scale factor calculation for hardware roundingdrivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c+10 -11 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchFrank LiLaurent Pinchart
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] media: nxp: imx8-isi: Fix scaler rounding and downscaling limits

Patch 1/2 enforces the 16x downscaling limit to prevent out-of-bounds access.

Patch 2/2 ensures the scale factor accounts for ISI's rounding-up behavior to avoid producing one extra output line.

---
Changes in v3:
- New patch 2/2 to fix scale factor rounding
- Replace CLAMP_DOWNSCALE_16 macro with inline function
- Adjust downscale threshold from 0x4000 to 0x2000
- Clarify downscaling limit in comment
- Link to v2: https://lore.kernel.org/all/[email protected]/

Changes in v2:
- Fix possible side-effects caused by 'max_val' in CLAMP_DOWNSCALE_16 macro.
- Add space line between two paragraph in comment.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Guoniu Zhou (2):
media: nxp: imx8-isi: Fix potential out-of-bounds issues
media: nxp: imx8-isi: Fix scale factor calculation for hardware rounding

 drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h | 16 ++++++++++++++++
 drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c   | 13 +++++++++++--
 drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c  | 11 ++++++++---
 drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c | 13 ++++++++-----
 4 files changed, 43 insertions(+), 10 deletions(-)

---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20260122-isi-74f87fbb9a6f

Best regards,

Signature · 1 line
Guoniu Zhou <[email protected]>