Hi Reza, On 2026-10-16T06:30:48, Reza Kurniawan <[email protected]> wrote: > video: use bpp conversion helpers consistently > > Many places open-code the conversion between log2 bits-per-pixel and > the actual number of bits or bytes per pixel, using expressions such as > "1 << bpix", "(1 << bpix) / 8" and "((1 << bpix) >> 3)". Meanwhile, > <video.h> already provides VNBITS() and VNBYTES() helpers for exactly > these conversions. Replace the open-coded expressions with the helpers. > > Using the helpers makes the intent of the expression clear, removes > duplicated bit manipulation, and reduces the reliance on the specially > crafted VIDEO_BPP* enum values, since callers no longer need to know > that those values are log2 quantities which is also important for > future extensions. > > Note that VNBYTES() is only correct for 8bpp and above, since it returns > a whole number of bytes per pixel and cannot represent sub-byte pixel > sizes. Every site converted to VNBYTES() here uses 16bpp or 32bpp, so > the result is identical to the original expression. > > No functional change is made. > [...] > > arch/sandbox/cpu/sdl.c | 4 ++-- > boot/fdt_simplefb.c | 2 +- > cmd/bdinfo.c | 2 +- > drivers/video/atmel_hlcdfb.c | 2 +- > drivers/video/atmel_lcdfb.c | 4 ++-- > drivers/video/imx/mxc_ipuv3_fb.c | 2 +- > drivers/video/meson/meson_vpu.c | 4 ++-- > drivers/video/mvebu_lcd.c | 2 +- > drivers/video/rockchip/rk_vop.c | 4 ++-- > drivers/video/sunxi/sunxi_de2.c | 8 ++++---- > drivers/video/tegra/dc.c | 4 ++-- > drivers/video/tegra/tegra124/display.c | 4 ++-- > drivers/video/ti/tilcdc.c | 4 ++-- > drivers/video/tidss/tidss_drv.c | 4 ++-- > test/cmd/bdinfo.c | 2 +- > 15 files changed, 26 insertions(+), 26 deletions(-)
Thanks for the respin. Reviewed-by: Simon Glass <[email protected]>
