drm/imx: consolidate bus format variable names
authorPhilipp Zabel <p.zabel@pengutronix.de>
Mon, 2 Feb 2015 16:25:59 +0000 (17:25 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 31 Mar 2015 09:59:34 +0000 (11:59 +0200)
This patch consolidates the different interface_pix_fmt, pixel_fmt, pix_fmt,
and pixfmt variables to a common name "bus_format" wherever they describe the
pixel format on the bus between display controller and encoder hardware.
At the same time, it renames imx_drm_panel_format to imx_drm_set_bus_format.

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-drm-core.c
drivers/gpu/drm/imx/imx-drm.h
drivers/gpu/drm/imx/imx-ldb.c
drivers/gpu/drm/imx/imx-tve.c
drivers/gpu/drm/imx/ipuv3-crtc.c
drivers/gpu/drm/imx/parallel-display.c
drivers/gpu/ipu-v3/ipu-dc.c
include/video/imx-ipu-v3.h

index 61ef987ec37b74b7c205fb196d1c34c9403bfe32..1834ac8998cc2c698b826755c4871aa5fcb4c970 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, MEDIA_BUS_FMT_RGB888_1X24);
+       imx_drm_set_bus_format(encoder, MEDIA_BUS_FMT_RGB888_1X24);
 }
 
 static struct drm_encoder_helper_funcs dw_hdmi_imx_encoder_helper_funcs = {
index a002f53aab0e3a3654a722f218be7854ffb70cd4..c6f2c4723b1bb4f73c57893e84631cbf348ac9eb 100644 (file)
@@ -103,8 +103,8 @@ static struct imx_drm_crtc *imx_drm_find_crtc(struct drm_crtc *crtc)
        return NULL;
 }
 
-int imx_drm_panel_format_pins(struct drm_encoder *encoder,
-               u32 interface_pix_fmt, int hsync_pin, int vsync_pin)
+int imx_drm_set_bus_format_pins(struct drm_encoder *encoder, u32 bus_format,
+               int hsync_pin, int vsync_pin)
 {
        struct imx_drm_crtc_helper_funcs *helper;
        struct imx_drm_crtc *imx_crtc;
@@ -116,16 +116,16 @@ int imx_drm_panel_format_pins(struct drm_encoder *encoder,
        helper = &imx_crtc->imx_drm_helper_funcs;
        if (helper->set_interface_pix_fmt)
                return helper->set_interface_pix_fmt(encoder->crtc,
-                               interface_pix_fmt, hsync_pin, vsync_pin);
+                                       bus_format, hsync_pin, vsync_pin);
        return 0;
 }
-EXPORT_SYMBOL_GPL(imx_drm_panel_format_pins);
+EXPORT_SYMBOL_GPL(imx_drm_set_bus_format_pins);
 
-int imx_drm_panel_format(struct drm_encoder *encoder, u32 interface_pix_fmt)
+int imx_drm_set_bus_format(struct drm_encoder *encoder, u32 bus_format)
 {
-       return imx_drm_panel_format_pins(encoder, interface_pix_fmt, 2, 3);
+       return imx_drm_set_bus_format_pins(encoder, bus_format, 2, 3);
 }
-EXPORT_SYMBOL_GPL(imx_drm_panel_format);
+EXPORT_SYMBOL_GPL(imx_drm_set_bus_format);
 
 int imx_drm_crtc_vblank_get(struct imx_drm_crtc *imx_drm_crtc)
 {
index 3c559ccd6af0042a73564041477cb0950674fe7f..28e776d8d9d270259f0df5b270897cdb8aec0e24 100644 (file)
@@ -18,7 +18,7 @@ struct imx_drm_crtc_helper_funcs {
        int (*enable_vblank)(struct drm_crtc *crtc);
        void (*disable_vblank)(struct drm_crtc *crtc);
        int (*set_interface_pix_fmt)(struct drm_crtc *crtc,
-                       u32 pix_fmt, int hsync_pin, int vsync_pin);
+                       u32 bus_format, int hsync_pin, int vsync_pin);
        const struct drm_crtc_helper_funcs *crtc_helper_funcs;
        const struct drm_crtc_funcs *crtc_funcs;
 };
@@ -40,10 +40,10 @@ void imx_drm_mode_config_init(struct drm_device *drm);
 
 struct drm_gem_cma_object *imx_drm_fb_get_obj(struct drm_framebuffer *fb);
 
-int imx_drm_panel_format_pins(struct drm_encoder *encoder,
-               u32 interface_pix_fmt, int hsync_pin, int vsync_pin);
-int imx_drm_panel_format(struct drm_encoder *encoder,
-               u32 interface_pix_fmt);
+int imx_drm_set_bus_format_pins(struct drm_encoder *encoder,
+               u32 bus_format, int hsync_pin, int vsync_pin);
+int imx_drm_set_bus_format(struct drm_encoder *encoder,
+               u32 bus_format);
 
 int imx_drm_encoder_get_mux_id(struct device_node *node,
                struct drm_encoder *encoder);
index f9ec17a434584b0d209022508e5dbc16e7c2308c..cd062b11a1029d26092b99ae8e53b8ab7e396c16 100644 (file)
@@ -163,24 +163,24 @@ static void imx_ldb_encoder_prepare(struct drm_encoder *encoder)
 {
        struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
        struct imx_ldb *ldb = imx_ldb_ch->ldb;
-       u32 pixel_fmt;
+       u32 bus_format;
 
        switch (imx_ldb_ch->chno) {
        case 0:
-               pixel_fmt = (ldb->ldb_ctrl & LDB_DATA_WIDTH_CH0_24) ?
+               bus_format = (ldb->ldb_ctrl & LDB_DATA_WIDTH_CH0_24) ?
                        MEDIA_BUS_FMT_RGB888_1X24 : MEDIA_BUS_FMT_RGB666_1X18;
                break;
        case 1:
-               pixel_fmt = (ldb->ldb_ctrl & LDB_DATA_WIDTH_CH1_24) ?
+               bus_format = (ldb->ldb_ctrl & LDB_DATA_WIDTH_CH1_24) ?
                        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 = MEDIA_BUS_FMT_RGB888_1X24;
+               bus_format = MEDIA_BUS_FMT_RGB888_1X24;
        }
 
-       imx_drm_panel_format(encoder, pixel_fmt);
+       imx_drm_set_bus_format(encoder, bus_format);
 }
 
 static void imx_ldb_encoder_commit(struct drm_encoder *encoder)
index bcdcb1b8f0ba64287ede4beedb1199364e511d84..214eceefc981e4018b9aeb262ad2ebbc4b4abfa0 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, MEDIA_BUS_FMT_YUV8_1X24,
-                               tve->hsync_pin, tve->vsync_pin);
+               imx_drm_set_bus_format_pins(encoder, MEDIA_BUS_FMT_YUV8_1X24,
+                                           tve->hsync_pin, tve->vsync_pin);
                break;
        case TVE_MODE_TVOUT:
-               imx_drm_panel_format(encoder, MEDIA_BUS_FMT_YUV8_1X24);
+               imx_drm_set_bus_format(encoder, MEDIA_BUS_FMT_YUV8_1X24);
                break;
        }
 }
index 4a393f60922044cab638f0931b3c218a666b75f6..7bc8301faffffff69194f20ca9d64b8e398f6478 100644 (file)
@@ -45,7 +45,7 @@ struct ipu_crtc {
        struct drm_pending_vblank_event *page_flip_event;
        struct drm_framebuffer  *newfb;
        int                     irq;
-       u32                     interface_pix_fmt;
+       u32                     bus_format;
        int                     di_hsync_pin;
        int                     di_vsync_pin;
 };
@@ -145,7 +145,6 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
        struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc);
        struct ipu_di_signal_cfg sig_cfg = {};
        unsigned long encoder_types = 0;
-       u32 out_pixel_fmt;
        int ret;
 
        dev_dbg(ipu_crtc->dev, "%s: mode->hdisplay: %d\n", __func__,
@@ -173,11 +172,9 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
        else
                sig_cfg.clkflags = 0;
 
-       out_pixel_fmt = ipu_crtc->interface_pix_fmt;
-
        sig_cfg.enable_pol = 1;
        sig_cfg.clk_pol = 0;
-       sig_cfg.pixel_fmt = out_pixel_fmt;
+       sig_cfg.bus_format = ipu_crtc->bus_format;
        sig_cfg.v_to_h_sync = 0;
        sig_cfg.hsync_pin = ipu_crtc->di_hsync_pin;
        sig_cfg.vsync_pin = ipu_crtc->di_vsync_pin;
@@ -186,7 +183,7 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
 
        ret = ipu_dc_init_sync(ipu_crtc->dc, ipu_crtc->di,
                               mode->flags & DRM_MODE_FLAG_INTERLACE,
-                              out_pixel_fmt, mode->hdisplay);
+                              ipu_crtc->bus_format, mode->hdisplay);
        if (ret) {
                dev_err(ipu_crtc->dev,
                                "initializing display controller failed with %d\n",
@@ -294,11 +291,11 @@ static void ipu_disable_vblank(struct drm_crtc *crtc)
 }
 
 static int ipu_set_interface_pix_fmt(struct drm_crtc *crtc,
-               u32 pixfmt, int hsync_pin, int vsync_pin)
+               u32 bus_format, int hsync_pin, int vsync_pin)
 {
        struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc);
 
-       ipu_crtc->interface_pix_fmt = pixfmt;
+       ipu_crtc->bus_format = bus_format;
        ipu_crtc->di_hsync_pin = hsync_pin;
        ipu_crtc->di_vsync_pin = vsync_pin;
 
index e645fe18c1a77cd6865b9c29d02242fb44b43563..74a9ce40ddc457f476611478d87f14ec2f67d8fd 100644 (file)
@@ -33,7 +33,7 @@ struct imx_parallel_display {
        struct device *dev;
        void *edid;
        int edid_len;
-       u32 interface_pix_fmt;
+       u32 bus_format;
        int mode_valid;
        struct drm_display_mode mode;
        struct drm_panel *panel;
@@ -118,7 +118,7 @@ static void imx_pd_encoder_prepare(struct drm_encoder *encoder)
 {
        struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
 
-       imx_drm_panel_format(encoder, imxpd->interface_pix_fmt);
+       imx_drm_set_bus_format(encoder, imxpd->bus_format);
 }
 
 static void imx_pd_encoder_commit(struct drm_encoder *encoder)
@@ -225,14 +225,13 @@ 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 = MEDIA_BUS_FMT_RGB888_1X24;
+                       imxpd->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
                else if (!strcmp(fmt, "rgb565"))
-                       imxpd->interface_pix_fmt = MEDIA_BUS_FMT_RGB565_1X16;
+                       imxpd->bus_format = MEDIA_BUS_FMT_RGB565_1X16;
                else if (!strcmp(fmt, "bgr666"))
-                       imxpd->interface_pix_fmt = MEDIA_BUS_FMT_RGB666_1X18;
+                       imxpd->bus_format = MEDIA_BUS_FMT_RGB666_1X18;
                else if (!strcmp(fmt, "lvds666"))
-                       imxpd->interface_pix_fmt =
-                                       MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
+                       imxpd->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
        }
 
        panel_node = of_parse_phandle(np, "fsl,panel", 0);
index 651c20cfe7e1a01cbf3cd4af2a835d1a31ea23e3..9ef2e1f54ca47c2611008d872ab8dda0e1c7df5a 100644 (file)
@@ -168,7 +168,7 @@ static int ipu_bus_format_to_map(u32 fmt)
 }
 
 int ipu_dc_init_sync(struct ipu_dc *dc, struct ipu_di *di, bool interlaced,
-               u32 pixel_fmt, u32 width)
+               u32 bus_format, u32 width)
 {
        struct ipu_dc_priv *priv = dc->priv;
        u32 reg = 0;
@@ -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_bus_format_to_map(pixel_fmt);
+       map = ipu_bus_format_to_map(bus_format);
        if (map < 0) {
                dev_dbg(priv->dev, "IPU_DISP: No MAP\n");
                return map;
index 73390c120cad03ec38030e68a4e5a1801d5fe668..85dedca3dcfb04e738764023b673a7ba3d47926d 100644 (file)
@@ -39,7 +39,7 @@ struct ipu_di_signal_cfg {
 
        struct videomode mode;
 
-       u32 pixel_fmt;
+       u32 bus_format;
        u32 v_to_h_sync;
 
 #define IPU_DI_CLKMODE_SYNC    (1 << 0)