staging: drm/imx: Add 24-bit BGR support to DC
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 10 Oct 2013 14:18:40 +0000 (16:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2013 22:30:33 +0000 (15:30 -0700)
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/imx-drm/ipu-v3/ipu-dc.c

index 21bf1c8..1a6e06d 100644 (file)
@@ -91,6 +91,7 @@ enum ipu_dc_map {
        IPU_DC_MAP_RGB565,
        IPU_DC_MAP_GBR24, /* TVEv2 */
        IPU_DC_MAP_BGR666,
+       IPU_DC_MAP_BGR24,
 };
 
 struct ipu_dc {
@@ -152,6 +153,8 @@ static int ipu_pixfmt_to_map(u32 fmt)
                return IPU_DC_MAP_GBR24;
        case V4L2_PIX_FMT_BGR666:
                return IPU_DC_MAP_BGR666;
+       case V4L2_PIX_FMT_BGR24:
+               return IPU_DC_MAP_BGR24;
        default:
                return -EINVAL;
        }
@@ -395,6 +398,12 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev,
        ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 1, 11, 0xfc); /* green */
        ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 2, 17, 0xfc); /* red */
 
+       /* bgr24 */
+       ipu_dc_map_clear(priv, IPU_DC_MAP_BGR24);
+       ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 2, 7, 0xff); /* red */
+       ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 1, 15, 0xff); /* green */
+       ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 0, 23, 0xff); /* blue */
+
        return 0;
 }