]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: qcom: camss: Use proper BPL alignment helper and non-power-of-two rounding
authorLoic Poulain <loic.poulain@oss.qualcomm.com>
Fri, 13 Mar 2026 19:51:51 +0000 (20:51 +0100)
committerBryan O'Donoghue <bod@kernel.org>
Fri, 8 May 2026 23:22:59 +0000 (00:22 +0100)
commitac437a96b7e4ecf92c59f296f8eb678dda018fc8
treedda49523562ab23749c05a0fe55ca421c353592f
parent91978c39ee90f0549a2a74e2e56a3e09c5ce6877
media: qcom: camss: Use proper BPL alignment helper and non-power-of-two rounding

Bytes-per-line (BPL) alignment in CAMSS currently uses ALIGN(), which
only works correctly for power-of-two values. Some RAW Bayer packing
formats (e.g. RAW10/12/14) require non-power-of-two alignment such as
3, 5, or 7-byte multiples, so ALIGN() produces incorrect results.

Introduce the use of roundup() with the per-format alignment returned by
camss_format_get_bpl_alignment() when no hardware alignment is enforced
(video->bpl_alignment).

Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
drivers/media/platform/qcom/camss/camss-video.c