Commit ccf509f8 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarJonathan Corbet <corbet@lwn.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent b3ab190f
...@@ -138,8 +138,8 @@ static struct mcam_format_struct { ...@@ -138,8 +138,8 @@ static struct mcam_format_struct {
.planar = true, .planar = true,
}, },
{ {
.desc = "RGB 444", .desc = "XRGB 444",
.pixelformat = V4L2_PIX_FMT_RGB444, .pixelformat = V4L2_PIX_FMT_XRGB444,
.mbus_code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, .mbus_code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,
.bpp = 2, .bpp = 2,
.planar = false, .planar = false,
...@@ -777,10 +777,9 @@ static void mcam_ctlr_image(struct mcam_camera *cam) ...@@ -777,10 +777,9 @@ static void mcam_ctlr_image(struct mcam_camera *cam)
mcam_reg_write_mask(cam, REG_CTRL0, mcam_reg_write_mask(cam, REG_CTRL0,
C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_SWAP24, C0_DF_MASK); C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_SWAP24, C0_DF_MASK);
break; break;
case V4L2_PIX_FMT_RGB444: case V4L2_PIX_FMT_XRGB444:
mcam_reg_write_mask(cam, REG_CTRL0, mcam_reg_write_mask(cam, REG_CTRL0,
C0_DF_RGB | C0_RGBF_444 | C0_RGB4_XRGB, C0_DF_MASK); C0_DF_RGB | C0_RGBF_444 | C0_RGB4_XBGR, C0_DF_MASK);
/* Alpha value? */
break; break;
case V4L2_PIX_FMT_RGB565: case V4L2_PIX_FMT_RGB565:
mcam_reg_write_mask(cam, REG_CTRL0, mcam_reg_write_mask(cam, REG_CTRL0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment