public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] marvell-ccic: fix RGB444 format
@ 2015-04-24  9:52 Hans Verkuil
  2015-04-24 22:35 ` Jonathan Corbet
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Verkuil @ 2015-04-24  9:52 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: Jonathan Corbet

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>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
---
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
index 3c12065..cc92ba5 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -138,8 +138,8 @@ static struct mcam_format_struct {
 		.planar		= true,
 	},
 	{
-		.desc		= "RGB 444",
-		.pixelformat	= V4L2_PIX_FMT_RGB444,
+		.desc		= "XRGB 444",
+		.pixelformat	= V4L2_PIX_FMT_XRGB444,
 		.mbus_code	= MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,
 		.bpp		= 2,
 		.planar		= false,
@@ -777,10 +777,9 @@ static void mcam_ctlr_image(struct mcam_camera *cam)
 		mcam_reg_write_mask(cam, REG_CTRL0,
 			C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_SWAP24, C0_DF_MASK);
 		break;
-	case V4L2_PIX_FMT_RGB444:
+	case V4L2_PIX_FMT_XRGB444:
 		mcam_reg_write_mask(cam, REG_CTRL0,
-			C0_DF_RGB | C0_RGBF_444 | C0_RGB4_XRGB, C0_DF_MASK);
-		/* Alpha value? */
+			C0_DF_RGB | C0_RGBF_444 | C0_RGB4_XBGR, C0_DF_MASK);
 		break;
 	case V4L2_PIX_FMT_RGB565:
 		mcam_reg_write_mask(cam, REG_CTRL0,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-24 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-24  9:52 [PATCH] marvell-ccic: fix RGB444 format Hans Verkuil
2015-04-24 22:35 ` Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox