]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
drm/imx: switch to use media bus formats
authorPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 2 Dec 2014 16:51:36 +0000 (17:51 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 31 Mar 2015 09:59:34 +0000 (11:59 +0200)
imx-drm internally misused the V4L2_PIX_FMT constants, which are supposed to
describe the pixel format of frame buffers in memory, to describe the pixel
format on the bus between the display controller and the encoder hardware.
Now that MEDIA_BUS_FMT constants are available to drm drivers, use those
instead.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Emil Renner Berthing <kernel@esmil.dk>
drivers/gpu/drm/imx/dw_hdmi-imx.c
drivers/gpu/drm/imx/imx-ldb.c
drivers/gpu/drm/imx/imx-tve.c
drivers/gpu/drm/imx/parallel-display.c
drivers/gpu/ipu-v3/ipu-dc.c

index 87fe8ed92ebeb8bf996fb95b79731dbebdbed2dd..61ef987ec37b74b7c205fb196d1c34c9403bfe32 100644 (file)
@@ -123,7 +123,7 @@ static void dw_hdmi_imx_encoder_commit(struct drm_encoder *encoder)
 
 static void dw_hdmi_imx_encoder_prepare(struct drm_encoder *encoder)
 {
-       imx_drm_panel_format(encoder, V4L2_PIX_FMT_RGB24);
+       imx_drm_panel_format(encoder, MEDIA_BUS_FMT_RGB888_1X24);
 }
 
 static struct drm_encoder_helper_funcs dw_hdmi_imx_encoder_helper_funcs = {
index 2d6dc94e1e64e973f61a1294c24bba6d2d788ae2..f9ec17a434584b0d209022508e5dbc16e7c2308c 100644 (file)
@@ -168,16 +168,16 @@ static void imx_ldb_encoder_prepare(struct drm_encoder *encoder)
        switch (imx_ldb_ch->chno) {
        case 0:
                pixel_fmt = (ldb->ldb_ctrl & LDB_DATA_WIDTH_CH0_24) ?
-                       V4L2_PIX_FMT_RGB24 : V4L2_PIX_FMT_BGR666;
+                       MEDIA_BUS_FMT_RGB888_1X24 : MEDIA_BUS_FMT_RGB666_1X18;
                break;
        case 1:
                pixel_fmt = (ldb->ldb_ctrl & LDB_DATA_WIDTH_CH1_24) ?
-                       V4L2_PIX_FMT_RGB24 : V4L2_PIX_FMT_BGR666;
+                       MEDIA_BUS_FMT_RGB888_1X24 : MEDIA_BUS_FMT_RGB666_1X18;
                break;
        default:
                dev_err(ldb->dev, "unable to config di%d panel format\n",
                        imx_ldb_ch->chno);
-               pixel_fmt = V4L2_PIX_FMT_RGB24;
+               pixel_fmt = MEDIA_BUS_FMT_RGB888_1X24;
        }
 
        imx_drm_panel_format(encoder, pixel_fmt);
index 4216e479a9bed34e2f51b0dced03af1b1c3349d8..bcdcb1b8f0ba64287ede4beedb1199364e511d84 100644 (file)
@@ -301,11 +301,11 @@ static void imx_tve_encoder_prepare(struct drm_encoder *encoder)
 
        switch (tve->mode) {
        case TVE_MODE_VGA:
-               imx_drm_panel_format_pins(encoder, IPU_PIX_FMT_GBR24,
+               imx_drm_panel_format_pins(encoder, MEDIA_BUS_FMT_YUV8_1X24,
                                tve->hsync_pin, tve->vsync_pin);
                break;
        case TVE_MODE_TVOUT:
-               imx_drm_panel_format(encoder, V4L2_PIX_FMT_YUV444);
+               imx_drm_panel_format(encoder, MEDIA_BUS_FMT_YUV8_1X24);
                break;
        }
 }
index 900dda6a8e71b5501293b8d4be06ddb8288dee27..e645fe18c1a77cd6865b9c29d02242fb44b43563 100644 (file)
@@ -225,14 +225,14 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
        ret = of_property_read_string(np, "interface-pix-fmt", &fmt);
        if (!ret) {
                if (!strcmp(fmt, "rgb24"))
-                       imxpd->interface_pix_fmt = V4L2_PIX_FMT_RGB24;
+                       imxpd->interface_pix_fmt = MEDIA_BUS_FMT_RGB888_1X24;
                else if (!strcmp(fmt, "rgb565"))
-                       imxpd->interface_pix_fmt = V4L2_PIX_FMT_RGB565;
+                       imxpd->interface_pix_fmt = MEDIA_BUS_FMT_RGB565_1X16;
                else if (!strcmp(fmt, "bgr666"))
-                       imxpd->interface_pix_fmt = V4L2_PIX_FMT_BGR666;
+                       imxpd->interface_pix_fmt = MEDIA_BUS_FMT_RGB666_1X18;
                else if (!strcmp(fmt, "lvds666"))
                        imxpd->interface_pix_fmt =
-                                       v4l2_fourcc('L', 'V', 'D', '6');
+                                       MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
        }
 
        panel_node = of_parse_phandle(np, "fsl,panel", 0);
index 4864f830079779a5e332f7872c8745795aea5766..651c20cfe7e1a01cbf3cd4af2a835d1a31ea23e3 100644 (file)
@@ -147,20 +147,20 @@ static void dc_write_tmpl(struct ipu_dc *dc, int word, u32 opcode, u32 operand,
        writel(reg2, priv->dc_tmpl_reg + word * 8 + 4);
 }
 
-static int ipu_pixfmt_to_map(u32 fmt)
+static int ipu_bus_format_to_map(u32 fmt)
 {
        switch (fmt) {
-       case V4L2_PIX_FMT_RGB24:
+       case MEDIA_BUS_FMT_RGB888_1X24:
                return IPU_DC_MAP_RGB24;
-       case V4L2_PIX_FMT_RGB565:
+       case MEDIA_BUS_FMT_RGB565_1X16:
                return IPU_DC_MAP_RGB565;
-       case IPU_PIX_FMT_GBR24:
+       case MEDIA_BUS_FMT_GBR888_1X24:
                return IPU_DC_MAP_GBR24;
-       case V4L2_PIX_FMT_BGR666:
+       case MEDIA_BUS_FMT_RGB666_1X18:
                return IPU_DC_MAP_BGR666;
-       case v4l2_fourcc('L', 'V', 'D', '6'):
+       case MEDIA_BUS_FMT_RGB666_1X24_CPADHI:
                return IPU_DC_MAP_LVDS666;
-       case V4L2_PIX_FMT_BGR24:
+       case MEDIA_BUS_FMT_BGR888_1X24:
                return IPU_DC_MAP_BGR24;
        default:
                return -EINVAL;
@@ -176,7 +176,7 @@ int ipu_dc_init_sync(struct ipu_dc *dc, struct ipu_di *di, bool interlaced,
 
        dc->di = ipu_di_get_num(di);
 
-       map = ipu_pixfmt_to_map(pixel_fmt);
+       map = ipu_bus_format_to_map(pixel_fmt);
        if (map < 0) {
                dev_dbg(priv->dev, "IPU_DISP: No MAP\n");
                return map;