media: vim2m: use different framesizes for bayer formats
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 28 Feb 2019 06:25:50 +0000 (01:25 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 1 Mar 2019 16:06:49 +0000 (11:06 -0500)
commitc8af44e1e791c5d6e38c464603ae8d9a7b0468b1
treed947363a3f1870a151aad10d6ab379c4306432d3
parent9c9c396ce6c7f32a411bfe2fbce848d2045769c5
media: vim2m: use different framesizes for bayer formats

The only real restriction at vim2m is that width should be
multiple of two, as the copy routine always copy two pixels
each time.

However, Bayer formats are defined as having a 2x2 matrix.
So, odd vertical numbers would cause color distortions at the
last line. So, it makes sense to use step 2 for vertical alignment
on Bayer.

With this patch, the reported formats for video capture will
be:

[0]: 'RGBP' (16-bit RGB 5-6-5)
Size: Stepwise 32x32 - 640x480 with step 2/1
[1]: 'RGBR' (16-bit RGB 5-6-5 BE)
Size: Stepwise 32x32 - 640x480 with step 2/1
[2]: 'RGB3' (24-bit RGB 8-8-8)
Size: Stepwise 32x32 - 640x480 with step 2/1
[3]: 'BGR3' (24-bit BGR 8-8-8)
Size: Stepwise 32x32 - 640x480 with step 2/1
[4]: 'YUYV' (YUYV 4:2:2)
Size: Stepwise 32x32 - 640x480 with step 2/1
[5]: 'BA81' (8-bit Bayer BGBG/GRGR)
Size: Stepwise 32x32 - 640x480 with step 2/2
[6]: 'GBRG' (8-bit Bayer GBGB/RGRG)
Size: Stepwise 32x32 - 640x480 with step 2/2
[7]: 'GRBG' (8-bit Bayer GRGR/BGBG)
Size: Stepwise 32x32 - 640x480 with step 2/2
[8]: 'RGGB' (8-bit Bayer RGRG/GBGB)
Size: Stepwise 32x32 - 640x480 with step 2/2

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/vim2m.c