linux/drivers/media/platform
Rikard Falkeborn c8470b7de8 media: venus: helpers: Fix ALIGN() of non power of two
[ Upstream commit 927e78ac8b ]

ALIGN() expects its second argument to be a power of 2, otherwise
incorrect results are produced for some inputs. The output can be
both larger or smaller than what is expected.

For example, ALIGN(304, 192) equals 320 instead of 384, and
ALIGN(65, 192) equals 256 instead of 192.

However, nestling two ALIGN() as is done in this case seem to only
produce results equal to or bigger than the expected result if ALIGN()
had handled non powers of two, and that in turn results in framesizes
that are either the correct size or too large.

Fortunately, since 192 * 4 / 3 equals 256, it turns out that one ALIGN()
is sufficient.

Fixes: ab1eda449c ("media: venus: vdec: handle 10bit bitstreams")
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-19 16:21:54 +02:00
..
allegro-dvt
amlogic
amphion media: amphion: initiate a drain of the capture queue in dynamic resolution change 2023-07-19 16:21:50 +02:00
aspeed
atmel
cadence
chips-media
intel
marvell
mediatek media: mediatek: vcodec: using decoder status instead of core work count 2023-07-19 16:21:51 +02:00
nvidia
nxp media: imx-jpeg: Apply clk_bulk api instead of operating specific clk 2023-03-10 09:33:43 +01:00
qcom media: venus: helpers: Fix ALIGN() of non power of two 2023-07-19 16:21:54 +02:00
renesas media: rcar-vin: Select correct interrupt mode for V4L2_FIELD_ALTERNATE 2023-06-09 10:34:08 +02:00
rockchip
samsung media: Prefer designated initializers over memset for subdev pad ops 2023-05-24 17:32:36 +01:00
st media: bdisp: Add missing check for create_workqueue 2023-05-11 23:03:10 +09:00
sunxi
ti media: Prefer designated initializers over memset for subdev pad ops 2023-05-24 17:32:36 +01:00
verisilicon media: hantro: Fix JPEG encoder ENUM_FRMSIZE on RK3399 2023-03-10 09:33:43 +01:00
via
xilinx
Kconfig
m2m-deinterlace.c
Makefile
video-mux.c