media: v4l2-common: Add support for fractional bpp
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 3 May 2023 08:34:28 +0000 (09:34 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 15:14:17 +0000 (16:14 +0100)
commit86c256be5848b2515702832ce93f748d9ffbebea
treed130ada545995d32304e2ebc706864086c97113c
parent2ef3372355f63fc1a29310ce9064fb76fe0806ed
media: v4l2-common: Add support for fractional bpp

Fraction bytes-per-pixel exist for some packed format. You will find
notably on Rockhip platform that 10bit data is stored fully packed,
meaning that there is 1.25 pixels per bytes. This can be represented
with the fraction 5/4 and can be used to scale the width into a
bytesperline.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/v4l2-core/v4l2-common.c
include/media/v4l2-common.h