Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] marvell-ccic: fix RGB444 format

The RGB444 format swapped the red and blue components, fix this.

Rather than making a new BGR444 format (as I proposed initially), Jon prefers
to just fix this and return the colors in the right order. I think that makes
sense in this case.

Since the RGB444 pixel format is deprecated due to the ambiguous specification
of the alpha component we use the XRGB444 pixel format instead (specified as having
no alpha channel).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
ccf509f8 b3ab190f

+4 -5
+4 -5
drivers/media/platform/marvell-ccic/mcam-core.c
··· 138 138 .planar = true, 139 139 }, 140 140 { 141 - .desc = "RGB 444", 142 - .pixelformat = V4L2_PIX_FMT_RGB444, 141 + .desc = "XRGB 444", 142 + .pixelformat = V4L2_PIX_FMT_XRGB444, 143 143 .mbus_code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, 144 144 .bpp = 2, 145 145 .planar = false, ··· 777 777 mcam_reg_write_mask(cam, REG_CTRL0, 778 778 C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_SWAP24, C0_DF_MASK); 779 779 break; 780 - case V4L2_PIX_FMT_RGB444: 780 + case V4L2_PIX_FMT_XRGB444: 781 781 mcam_reg_write_mask(cam, REG_CTRL0, 782 - C0_DF_RGB | C0_RGBF_444 | C0_RGB4_XRGB, C0_DF_MASK); 783 - /* Alpha value? */ 782 + C0_DF_RGB | C0_RGBF_444 | C0_RGB4_XBGR, C0_DF_MASK); 784 783 break; 785 784 case V4L2_PIX_FMT_RGB565: 786 785 mcam_reg_write_mask(cam, REG_CTRL0,