v4l2: add new V4L2_PIX_FMT_RGB666 pixel format.
Subsystems (6)
PATCH v10 1/10 v4l2: add new V4L2_PIX_FMT_RGB666 pixel format.
That new macro is needed by the imx_drm staging driver
for supporting the QVGA display of the eukrea-cpuimx51 board.
---
ChangeLog v9->v10:
- Rebased on top of:
"211e7f2 [media] DocBook media: drop the old incorrect packed RGB table"
- Added Philipp Zabel's Ack.
ChangeLog v8->v9:
- Removed the Cc. They are now set in git-send-email directly.
ChangeLog v7->v8:
- Added Mauro Carvalho Chehab back to the list of Cc
ChangeLog v6->v7:
- Shrinked even more the Cc list.
ChangeLog v5->v6:
- Remove people not concerned by this patch from the Cc list.
ChangeLog v3->v4:
- Added Laurent Pinchart's Ack.
ChangeLog v2->v3:
- Added some interested people in the Cc list.
- Added Mauro Carvalho Chehab's Ack.
- Added documentation.
--- .../DocBook/media/v4l/pixfmt-packed-rgb.xml | 39 ++++++++++++++++++++ include/uapi/linux/videodev2.h | 1 + 2 files changed, 40 insertions(+)
Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml +39 -0
@@ -279,6 +279,45 @@ colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para> <entry></entry> <entry></entry> </row> + <row id="V4L2-PIX-FMT-RGB666"> + <entry><constant>V4L2_PIX_FMT_RGB666</constant></entry> + <entry>'RGBH'</entry> + <entry></entry> + <entry>r<subscript>5</subscript></entry> + <entry>r<subscript>4</subscript></entry> + <entry>r<subscript>3</subscript></entry> + <entry>r<subscript>2</subscript></entry> + <entry>r<subscript>1</subscript></entry> + <entry>r<subscript>0</subscript></entry> + <entry>g<subscript>5</subscript></entry> + <entry>g<subscript>4</subscript></entry> + <entry></entry> + <entry>g<subscript>3</subscript></entry> + <entry>g<subscript>2</subscript></entry> + <entry>g<subscript>1</subscript></entry> + <entry>g<subscript>0</subscript></entry> + <entry>b<subscript>5</subscript></entry> + <entry>b<subscript>4</subscript></entry> + <entry>b<subscript>3</subscript></entry> + <entry>b<subscript>2</subscript></entry> + <entry></entry> + <entry>b<subscript>1</subscript></entry> + <entry>b<subscript>0</subscript></entry> + <entry></entry> + <entry></entry> + <entry></entry> + <entry></entry> + <entry></entry> + <entry></entry> + <entry></entry> + <entry></entry> + <entry></entry> + <entry></entry> + <entry></entry> + <entry></entry> + <entry></entry> + <entry></entry> + </row> <row id="V4L2-PIX-FMT-BGR24"> <entry><constant>V4L2_PIX_FMT_BGR24</constant></entry> <entry>'BGR3'</entry>
include/uapi/linux/videodev2.h +1 -0
@@ -299,6 +299,7 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q')/* 16 RGB-5-5-5 BE */ #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R')/* 16 RGB-5-6-5 BE */ #define V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H')/* 18 BGR-6-6-6 */ +#define V4L2_PIX_FMT_RGB666 v4l2_fourcc('R', 'G', 'B', 'H')/* 18 RGB-6-6-6 */ #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3')/* 24 BGR-8-8-8 */ #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3')/* 24 RGB-8-8-8 */ #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4')/* 32 BGR-8-8-8-8 */
Signature · 1 line
1.7.9.5
PATCH v10 2/10 imx-drm: Add RGB666 support for parallel display.
---
ChangeLog v8->v9:
- Rebased.
- Added Philipp Zabel's ack.
- Shortened the patch title.
ChangeLog v8->v9:
- Removed the Cc. They are now set in git-send-email directly.
- Rebased.
ChangeLog v7->v8:
- Shrinked even more the Cc list.
ChangeLog v6->v7:
- Shrinked even more the Cc list.
ChangeLog v5->v6:
- Remove people not concerned by this patch from the Cc list.
ChangeLog v3->v5:
- Use the correct RGB order.
ChangeLog v2->v3:
- Added some interested people in the Cc list.
- Removed the commit message long desciption that was just a copy of the short description.
- Rebased the patch.
- Fixed a copy-paste error in the ipu_dc_map_clear parameter.
--- .../bindings/staging/imx-drm/fsl-imx-drm.txt | 3 ++- drivers/staging/imx-drm/ipu-v3/ipu-dc.c | 9 +++++++++ drivers/staging/imx-drm/parallel-display.c | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +2 -1
@@ -60,7 +60,8 @@ Required properties: - compatible: Should be "fsl,imx-parallel-display" Optional properties: - interface_pix_fmt: How this display is connected to the - display interface. Currently supported types: "rgb24", "rgb565", "bgr666" + display interface. Currently supported types: "rgb24", "rgb565", "bgr666", + "rgb666" - edid: verbatim EDID data block describing attached display. - ddc: phandle describing the i2c bus handling the display data channel
drivers/staging/imx-drm/ipu-v3/ipu-dc.c +9 -0
@@ -92,6 +92,7 @@ enum ipu_dc_map {IPU_DC_MAP_GBR24 ,/* TVEv2 */ IPU_DC_MAP_BGR666 ,IPU_DC_MAP_BGR24 , + IPU_DC_MAP_RGB666, }; struct ipu_dc {
@@ -155,6 +156,8 @@ static int ipu_pixfmt_to_map(u32 fmt)return IPU_DC_MAP_BGR666 ;case V4L2_PIX_FMT_BGR24 :return IPU_DC_MAP_BGR24 ; +case V4L2_PIX_FMT_RGB666 : +return IPU_DC_MAP_RGB666 ;default :return -EINVAL ; }
@@ -404,6 +407,12 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev,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 */ +/* rgb666 */ +ipu_dc_map_clear (priv,IPU_DC_MAP_RGB666 ); +ipu_dc_map_config (priv,IPU_DC_MAP_RGB666 ,0 ,5 ,0xfc );/* blue */ +ipu_dc_map_config (priv,IPU_DC_MAP_RGB666 ,1 ,11 ,0xfc );/* green */ +ipu_dc_map_config (priv,IPU_DC_MAP_RGB666 ,2 ,17 ,0xfc );/* red */ +return 0 ; }
drivers/staging/imx-drm/parallel-display.c +2 -0
@@ -219,6 +219,8 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data) imxpd->interface_pix_fmt =V4L2_PIX_FMT_RGB565 ; else if (!strcmp(fmt, "bgr666")) imxpd->interface_pix_fmt =V4L2_PIX_FMT_BGR666 ; + else if (!strcmp(fmt, "rgb666")) + imxpd->interface_pix_fmt =V4L2_PIX_FMT_RGB666 ; } panel_node =of_parse_phandle (np,"fsl,panel" ,0 );
Signature · 1 line
1.7.9.5
PATCH v10 3/10 imx-drm: Correct BGR666 and the board's dts that use them.
In reply to Denis CarikliThe current BGR666 is not consistent with the other color mapings like BGR24. BGR666 should be in the same byte order than BGR24.
---
ChangeLog v9->v10:
- Rebased.
- Added Philipp Zabel's Ack.
- Included Lothar Wa?mann's suggestion about imx-ldb.c.
- Shortened the patch title
ChangeLog v8->v9:
- Removed the Cc. They are now set in git-send-email directly.
ChangeLog v7->v8:
- Shrinked even more the Cc list.
ChangeLog v6->v7:
- Shrinked even more the Cc list.
ChangeLog v5->v6:
- Remove people not concerned by this patch from the Cc list.
- Added a better explanation of the change.
ChangeLog v5:
- New patch.
--- arch/arm/boot/dts/imx51-apf51dev.dts | 2 +- arch/arm/boot/dts/imx53-m53evk.dts | 2 +- drivers/staging/imx-drm/imx-ldb.c | 4 ++-- drivers/staging/imx-drm/ipu-v3/ipu-dc.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-)
arch/arm/boot/dts/imx51-apf51dev.dts +1 -1
@@ -18,7 +18,7 @@ display at di1 { compatible = "fsl,imx-parallel-display"; - interface-pix-fmt = "bgr666"; + interface-pix-fmt = "rgb666"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ipu_disp1>;
arch/arm/boot/dts/imx53-m53evk.dts +1 -1
@@ -23,7 +23,7 @@ soc { display1: display at di1 { compatible = "fsl,imx-parallel-display"; - interface-pix-fmt = "bgr666"; + interface-pix-fmt = "rgb666"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ipu_disp1>;
drivers/staging/imx-drm/imx-ldb.c +2 -2
@@ -185,11 +185,11 @@ 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 ; +V4L2_PIX_FMT_RGB24 :V4L2_PIX_FMT_RGB666 ;break ;case 1 : pixel_fmt = (ldb->ldb_ctrl &LDB_DATA_WIDTH_CH1_24 ) ? -V4L2_PIX_FMT_RGB24 :V4L2_PIX_FMT_BGR666 ; +V4L2_PIX_FMT_RGB24 :V4L2_PIX_FMT_RGB666 ;break ;default : dev_err(ldb->dev, "unable to config di%d panel format\n",
drivers/staging/imx-drm/ipu-v3/ipu-dc.c +2 -2
@@ -397,9 +397,9 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev,/* bgr666 */ ipu_dc_map_clear (priv,IPU_DC_MAP_BGR666 ); -ipu_dc_map_config (priv,IPU_DC_MAP_BGR666 ,0 ,5 ,0xfc );/* blue */ +ipu_dc_map_config (priv,IPU_DC_MAP_BGR666 ,0 ,17 ,0xfc );/* blue */ 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 */ +ipu_dc_map_config (priv,IPU_DC_MAP_BGR666 ,2 ,5 ,0xfc );/* red */ /* bgr24 */ ipu_dc_map_clear (priv,IPU_DC_MAP_BGR24 );
Signature · 1 line
1.7.9.5
PATCH v10 4/10 imx-drm: Match ipu_di_signal_cfg's clk_pol with its description.
In reply to Denis CarikliAccording to the datasheet, setting the di0_polarity_disp_clk field in the GENERAL di register sets the output clock polarity to active high.
---
ChangeLog v9->v10:
- New patch that is now needed by the
"staging: imx-drm: Use de-active and pixelclk-active" patch.
--- drivers/staging/imx-drm/ipu-v3/ipu-di.c | 2 +- drivers/staging/imx-drm/ipuv3-crtc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/imx-drm/ipu-v3/ipu-di.c +1 -1
@@ -595,7 +595,7 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig) } } -if (!sig->clk_pol) +if (sig->clk_pol) di_gen |=DI_GEN_POLARITY_DISP_CLK ;ipu_di_write (di, di_gen,DI_GENERAL );
drivers/staging/imx-drm/ipuv3-crtc.c +1 -1
@@ -158,7 +158,7 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc, sig_cfg.Vsync_pol =1 ; sig_cfg.enable_pol =1 ; - sig_cfg.clk_pol =1 ; + sig_cfg.clk_pol =0 ; sig_cfg.width = mode->hdisplay; sig_cfg.height = mode->vdisplay; sig_cfg.pixel_fmt = out_pixel_fmt;
Signature · 1 line
1.7.9.5
PATCH v10 5/10 imx-drm: use defines for clock polarity settings
In reply to Denis Carikli---
ChangeLog v9->v10:
- New patch which was splitted out from:
"staging: imx-drm: Use de-active and pixelclk-active display-timings.".
- Fixes many issues in "staging: imx-drm: Use de-active and pixelclk-active display-timings.":
- More clear meaning of the polarity settings.
- The SET_CLK_POL and SET_DE_POL masks are not
needed anymore.
--- drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h | 8 +++++++- drivers/staging/imx-drm/ipu-v3/ipu-di.c | 4 ++-- drivers/staging/imx-drm/ipuv3-crtc.c | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-)
drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h +7 -1
@@ -27,6 +27,12 @@ enum ipuv3_type {#define IPU_PIX_FMT_GBR24 v4l2_fourcc('G', 'B', 'R', '3') +#define CLK_POL_ACTIVE_LOW 0 +#define CLK_POL_ACTIVE_HIGH 1 + +#define ENABLE_POL_NEGEDGE 0 +#define ENABLE_POL_POSEDGE 1 +/* * Bitfield of Display Interface signal polarities. */
@@ -37,7 +43,7 @@ struct ipu_di_signal_cfg { unsigned clksel_en:1; unsigned clkidle_en:1; unsigned data_pol:1; /* true = inverted */ - unsigned clk_pol:1; /* true = rising edge */ + unsigned clk_pol:1; unsigned enable_pol:1; unsigned Hsync_pol:1; /* true = active high */ unsigned Vsync_pol:1;
drivers/staging/imx-drm/ipu-v3/ipu-di.c +2 -2
@@ -595,7 +595,7 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig) } } -if (sig->clk_pol) +if (sig->clk_pol ==CLK_POL_ACTIVE_HIGH ) di_gen |=DI_GEN_POLARITY_DISP_CLK ;ipu_di_write (di, di_gen,DI_GENERAL );
@@ -606,7 +606,7 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig) reg =ipu_di_read (di,DI_POL ); reg &= ~(DI_POL_DRDY_DATA_POLARITY |DI_POL_DRDY_POLARITY_15 ); -if (sig->enable_pol) +if (sig->enable_pol ==ENABLE_POL_POSEDGE ) reg |=DI_POL_DRDY_POLARITY_15 ;if (sig->data_pol) reg |=DI_POL_DRDY_DATA_POLARITY ;
drivers/staging/imx-drm/ipuv3-crtc.c +2 -2
@@ -157,8 +157,8 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,if (mode->flags &DRM_MODE_FLAG_PVSYNC ) sig_cfg.Vsync_pol =1 ; - sig_cfg.enable_pol =1 ; - sig_cfg.clk_pol =0 ; + sig_cfg.enable_pol =ENABLE_POL_POSEDGE ; + sig_cfg.clk_pol =CLK_POL_ACTIVE_LOW ; sig_cfg.width = mode->hdisplay; sig_cfg.height = mode->vdisplay; sig_cfg.pixel_fmt = out_pixel_fmt;
Signature · 1 line
1.7.9.5
PATCH v10 6/10 ARM: dts: imx5*, imx6*: correct display-timings nodes.
In reply to Denis CarikliThe imx-drm driver can't use the de-active and pixelclk-active display-timings properties yet.
Instead the data-enable and the pixel data clock polarity are hardcoded in the imx-drm driver.
So theses properties are now set to keep the same behaviour when imx-drm will start using them.
---
ChangeLog v9->v10:
- New patch that was splitted out of:
"staging imx-drm: Use de-active and pixelclk-active display-timings."
--- arch/arm/boot/dts/imx51-babbage.dts | 2 ++ arch/arm/boot/dts/imx53-m53evk.dts | 2 ++ arch/arm/boot/dts/imx53-tx53-x03x.dts | 2 +- arch/arm/boot/dts/imx6qdl-gw53xx.dtsi | 2 ++ arch/arm/boot/dts/imx6qdl-gw54xx.dtsi | 2 ++ arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi | 2 ++ arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 2 ++ arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 2 ++ arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 2 ++ 9 files changed, 17 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx51-babbage.dts +2 -0
@@ -38,6 +38,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; };
arch/arm/boot/dts/imx53-m53evk.dts +2 -0
@@ -40,6 +40,8 @@ vfront-porch = <9>; vsync-len = <3>; vsync-active = <1>; + de-active = <1>; + pixelclk-active = <0>; }; }; };
arch/arm/boot/dts/imx53-tx53-x03x.dts +1 -1
@@ -93,7 +93,7 @@ hsync-active = <0>; vsync-active = <0>; de-active = <1>; - pixelclk-active = <1>; + pixelclk-active = <0>; }; ET0500 {
arch/arm/boot/dts/imx6qdl-gw53xx.dtsi +2 -0
@@ -494,6 +494,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; };
arch/arm/boot/dts/imx6qdl-gw54xx.dtsi +2 -0
@@ -516,6 +516,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; };
arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi +2 -0
@@ -349,6 +349,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; };
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +2 -0
@@ -405,6 +405,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; };
arch/arm/boot/dts/imx6qdl-sabrelite.dtsi +2 -0
@@ -349,6 +349,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; };
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +2 -0
@@ -463,6 +463,8 @@ vfront-porch = <7>; hsync-len = <60>; vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; }; }; };
Signature · 1 line
1.7.9.5
PATCH v10 7/10 imx-drm: Prepare imx-drm for extra display-timings retrival.
In reply to Denis CarikliThe hardware behaviour was kept.
---
ChangeLog v9->v10:
- New patch that was splitted out of "staging: imx-drm: Use de-active and pixelclk-active display-timings."
- The IMXDRM_MODE_FLAG_ are now using the BIT macros.
- The SET_CLK_POL and SET_DE_POL masks were removed. The code was updated accordingly.
--- drivers/staging/imx-drm/imx-drm-core.c | 10 ++++++++++ drivers/staging/imx-drm/imx-drm.h | 6 ++++++ drivers/staging/imx-drm/imx-hdmi.c | 3 +++ drivers/staging/imx-drm/imx-ldb.c | 3 +++ drivers/staging/imx-drm/imx-tve.c | 3 +++ drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h | 6 ++++-- drivers/staging/imx-drm/ipu-v3/ipu-di.c | 7 ++++++- drivers/staging/imx-drm/ipuv3-crtc.c | 12 ++++++++++-- drivers/staging/imx-drm/parallel-display.c | 2 ++ 9 files changed, 47 insertions(+), 5 deletions(-)
drivers/staging/imx-drm/imx-drm-core.c +10 -0
@@ -492,6 +492,16 @@ int imx_drm_encoder_parse_of(struct drm_device *drm, }EXPORT_SYMBOL_GPL (imx_drm_encoder_parse_of); +void imx_drm_set_default_timing_flags (struct drm_display_mode *mode) +{ + mode->private_flags &= ~IMXDRM_MODE_FLAG_DE_LOW ; + mode->private_flags &= ~IMXDRM_MODE_FLAG_PIXDATA_POSEDGE ; + + mode->private_flags |=IMXDRM_MODE_FLAG_DE_HIGH ; + mode->private_flags |=IMXDRM_MODE_FLAG_PIXDATA_NEGEDGE ; +} +EXPORT_SYMBOL_GPL (imx_drm_set_default_timing_flags); +/* * @node: device tree node containing encoder input ports * @encoder: drm_encoder
drivers/staging/imx-drm/imx-drm.h +6 -0
@@ -1,6 +1,11 @@#ifndef _IMX_DRM_H_#define _IMX_DRM_H_ +#define IMXDRM_MODE_FLAG_DE_HIGH BIT(0) +#define IMXDRM_MODE_FLAG_DE_LOW BIT(1) +#define IMXDRM_MODE_FLAG_PIXDATA_POSEDGE BIT(2) +#define IMXDRM_MODE_FLAG_PIXDATA_NEGEDGE BIT(3) +struct device_node ;struct drm_crtc ;struct drm_connector ;
@@ -49,6 +54,7 @@ int imx_drm_encoder_get_mux_id(struct device_node *node, struct drm_encoder *encoder);int imx_drm_encoder_parse_of (struct drm_device *drm,struct drm_encoder *encoder,struct device_node *np); +void imx_drm_set_default_timing_flags (struct drm_display_mode *mode);int imx_drm_connector_mode_valid (struct drm_connector *connector,struct drm_display_mode *mode);
drivers/staging/imx-drm/imx-hdmi.c +3 -0
@@ -1431,6 +1431,9 @@ static bool imx_hdmi_encoder_mode_fixup(struct drm_encoder *encoder,const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { +drm_mode_copy (adjusted_mode ,mode ); +imx_drm_set_default_timing_flags (ajusted_mode); +return true; }
drivers/staging/imx-drm/imx-ldb.c +3 -0
@@ -108,6 +108,9 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector) mode =drm_mode_create (connector->dev);if (!mode)return -EINVAL ; + +imx_drm_set_default_timing_flags (&imx_ldb_ch->mode); +drm_mode_copy (mode, &imx_ldb_ch->mode); mode->type |=DRM_MODE_TYPE_DRIVER |DRM_MODE_TYPE_PREFERRED ;drm_mode_probed_add (connector, mode);
drivers/staging/imx-drm/imx-tve.c +3 -0
@@ -294,6 +294,9 @@ static bool imx_tve_encoder_mode_fixup(struct drm_encoder *encoder,const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { +drm_mode_copy (adjusted_mode ,mode ); +imx_drm_set_default_timing_flags (adjusted_mode); +return true; }
drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h +4 -2
@@ -29,9 +29,11 @@ enum ipuv3_type {#define CLK_POL_ACTIVE_LOW 0#define CLK_POL_ACTIVE_HIGH 1 +#define CLK_POL_PRESERVE 2#define ENABLE_POL_NEGEDGE 0#define ENABLE_POL_POSEDGE 1 +#define ENABLE_POL_PRESERVE 2/* * Bitfield of Display Interface signal polarities.
@@ -43,10 +45,10 @@ struct ipu_di_signal_cfg { unsigned clksel_en:1; unsigned clkidle_en:1; unsigned data_pol:1; /* true = inverted */ - unsigned clk_pol:1; - unsigned enable_pol:1; unsigned Hsync_pol:1; /* true = active high */ unsigned Vsync_pol:1; +u8 clk_pol; +u8 enable_pol;u16 width;u16 height;
drivers/staging/imx-drm/ipu-v3/ipu-di.c +6 -1
@@ -597,6 +597,8 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig)if (sig->clk_pol ==CLK_POL_ACTIVE_HIGH ) di_gen |=DI_GEN_POLARITY_DISP_CLK ; +else if (sig->clk_pol ==CLK_POL_ACTIVE_LOW ) + di_gen &= ~DI_GEN_POLARITY_DISP_CLK ;ipu_di_write (di, di_gen,DI_GENERAL );
@@ -604,10 +606,13 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig) DI_SYNC_AS_GEN); reg =ipu_di_read (di,DI_POL ); - reg &= ~(DI_POL_DRDY_DATA_POLARITY |DI_POL_DRDY_POLARITY_15 ); + reg &= ~(DI_POL_DRDY_DATA_POLARITY );if (sig->enable_pol ==ENABLE_POL_POSEDGE ) reg |=DI_POL_DRDY_POLARITY_15 ; +else if (sig->enable_pol ==ENABLE_POL_NEGEDGE ) + reg &= ~DI_POL_DRDY_POLARITY_15 ; +if (sig->data_pol) reg |=DI_POL_DRDY_DATA_POLARITY ;
drivers/staging/imx-drm/ipuv3-crtc.c +10 -2
@@ -157,8 +157,16 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,if (mode->flags &DRM_MODE_FLAG_PVSYNC ) sig_cfg.Vsync_pol =1 ; - sig_cfg.enable_pol =ENABLE_POL_POSEDGE ; - sig_cfg.clk_pol =CLK_POL_ACTIVE_LOW ; +if (mode->private_flags &IMXDRM_MODE_FLAG_DE_HIGH ) + sig_cfg.enable_pol =ENABLE_POL_POSEDGE ; +else if (mode->private_flags &IMXDRM_MODE_FLAG_DE_LOW ) + sig_cfg.enable_pol =ENABLE_POL_NEGEDGE ; + +if (mode->private_flags &IMXDRM_MODE_FLAG_PIXDATA_POSEDGE ) + sig_cfg.clk_pol =CLK_POL_ACTIVE_HIGH ; +else if (mode->private_flags &IMXDRM_MODE_FLAG_PIXDATA_NEGEDGE ) + sig_cfg.clk_pol =CLK_POL_ACTIVE_LOW ; + sig_cfg.width = mode->hdisplay; sig_cfg.height = mode->vdisplay; sig_cfg.pixel_fmt = out_pixel_fmt;
drivers/staging/imx-drm/parallel-display.c +2 -0
@@ -73,6 +73,7 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector)if (!mode)return -EINVAL ;drm_mode_copy (mode, &imxpd->mode); +imx_drm_set_default_timing_flags (mode); mode->type |=DRM_MODE_TYPE_DRIVER |DRM_MODE_TYPE_PREFERRED ,drm_mode_probed_add (connector, mode); num_modes++;
@@ -84,6 +85,7 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector)return -EINVAL ;of_get_drm_display_mode (np, &imxpd->mode,OF_USE_NATIVE_MODE );drm_mode_copy (mode, &imxpd->mode); +imx_drm_set_default_timing_flags (mode); mode->type |=DRM_MODE_TYPE_DRIVER |DRM_MODE_TYPE_PREFERRED ,drm_mode_probed_add (connector, mode); num_modes++;
Signature · 1 line
1.7.9.5
PATCH v10 8/10 imx-drm: imx-drm-core: provide a common display timings retrival function.
In reply to Denis Carikliimx_drm_of_get_extra_timing_flags will be used to retrive the native-mode and de-active display-timings node properties in the device tree.
---
ChangeLog v9->v10:
- New patch that was splitted out of "staging: imx-drm: Use de-active and pixelclk-active
- When a IMXDRM_MODE_FLAG_ flag is set, its opposite flag is also unset.
--- drivers/staging/imx-drm/imx-drm-core.c | 57 ++++++++++++++++++++++++++++++++ drivers/staging/imx-drm/imx-drm.h | 2 ++ 2 files changed, 59 insertions(+)
drivers/staging/imx-drm/imx-drm-core.c +57 -0
@@ -24,6 +24,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_fb_cma_helper.h> +#include <video/of_display_timing.h> #include "imx-drm.h"
@@ -492,6 +493,62 @@ int imx_drm_encoder_parse_of(struct drm_device *drm, }EXPORT_SYMBOL_GPL (imx_drm_encoder_parse_of); +int imx_drm_of_get_extra_timing_flags (struct drm_connector *connector, +struct drm_display_mode *mode, +struct device_node *display_np) +{ +struct drm_display_mode *new_mode =drm_mode_create (connector->dev); +struct device_node *timings_np; +struct device_node *mode_np; +u32 val; + +if (!new_mode) +return -EINVAL ; + +of_get_drm_display_mode (display_np, mode,OF_USE_NATIVE_MODE ); + + timings_np =of_get_child_by_name (display_np,"display-timings" ); +if (timings_np) { +/* get the display mode node */ + mode_np =of_parse_phandle (timings_np, +"native-mode" ,0 ); +if (!mode_np) + mode_np =of_get_next_child (timings_np,NULL ); + +if (!of_property_read_u32 (mode_np,"de-active" , &val)) { +if (val) { + mode->private_flags |= +IMXDRM_MODE_FLAG_DE_HIGH ; + mode->private_flags &= + ~IMXDRM_MODE_FLAG_DE_LOW ; + }else { + mode->private_flags &= + ~IMXDRM_MODE_FLAG_DE_HIGH ; + mode->private_flags |= +IMXDRM_MODE_FLAG_DE_LOW ; + } + } + +if (!of_property_read_u32 (mode_np,"pixelclk-active" , + &val)) { +if (val) { + mode->private_flags |= +IMXDRM_MODE_FLAG_PIXDATA_POSEDGE ; + mode->private_flags &= + ~IMXDRM_MODE_FLAG_PIXDATA_NEGEDGE ; + }else { + mode->private_flags &= + ~IMXDRM_MODE_FLAG_PIXDATA_POSEDGE ; + mode->private_flags |= +IMXDRM_MODE_FLAG_PIXDATA_NEGEDGE ; + } + } + } + +return 0 ; +} +EXPORT_SYMBOL_GPL (imx_drm_of_get_extra_timing_flags); +void imx_drm_set_default_timing_flags (struct drm_display_mode *mode) { mode->private_flags &= ~IMXDRM_MODE_FLAG_DE_LOW ;
drivers/staging/imx-drm/imx-drm.h +2 -0
@@ -54,6 +54,8 @@ int imx_drm_encoder_get_mux_id(struct device_node *node, struct drm_encoder *encoder);int imx_drm_encoder_parse_of (struct drm_device *drm,struct drm_encoder *encoder,struct device_node *np); +int imx_drm_of_get_extra_timing_flags (struct drm_connector *connector, +struct drm_display_mode *mode,struct device_node *display_np);void imx_drm_set_default_timing_flags (struct drm_display_mode *mode); int imx_drm_connector_mode_valid(struct drm_connector *connector,
Signature · 1 line
1.7.9.5
PATCH v10 9/10 imx-drm: parallel-display: retrive extra display-timings.
In reply to Denis CarikliIf de-active and/or pixelclk-active properties were set in the display-timings DT node, they were not used.
Instead the data-enable and the pixel data clock polarity were hardcoded.
---
ChangeLog v9->v10:
- New patch from what's left of:
"staging: imx-drm: Use de-active and pixelclk-active
- New patch title.
--- drivers/staging/imx-drm/parallel-display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/imx-drm/parallel-display.c +2 -1
@@ -85,7 +85,8 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector)return -EINVAL ;of_get_drm_display_mode (np, &imxpd->mode,OF_USE_NATIVE_MODE );drm_mode_copy (mode, &imxpd->mode); -imx_drm_set_default_timing_flags (mode); +imx_drm_of_get_extra_timing_flags (&imxpd->connector, mode, + imxpd->dev->of_node); mode->type |=DRM_MODE_TYPE_DRIVER |DRM_MODE_TYPE_PREFERRED ,drm_mode_probed_add (connector, mode); num_modes++;
Signature · 1 line
1.7.9.5
PATCH v10 10/10 ARM: dts: mbimx51sd: Add display support.
In reply to Denis CarikliThe CMO-QVGA, DVI-SVGA and DVI-VGA are added.
---
ChangeLog v9->v10:
- Rebased
- Now enables the cmo-qvga regulator at boot.
ChangeLog v8->v9:
- Removed the Cc. They are now set in git-send-email directly.
- updated pixelclk-active after the following patch:
"imx-drm: Match ipu_di_signal_cfg's clk_pol with its description."
ChangeLog v7->v8:
- Rebased the patch: added the now required imx-drm node.
- Adapted the svga clock-frequency value in order to still be able to display an image after the following commit:
"imx-drm: ipu-v3: more inteligent DI clock selection"
ChangeLog v6->v7:
- Shrinked even more the Cc list.
- Since the pingrp headers were removed, the references to it where replaced by the actual pins.
- Added the targets to arch/arm/boot/dts/Makefile
ChangeLog v5->v6:
- Reordered the Cc list.
ChangeLog v3->v5:
- Updated to new GPIO defines.
- Updated to new licenses checkpatch requirements.
- one whitespace cleanup.
ChangeLog v2->v3:
- Splitted out from the patch that added support for the cpuimx51/mbimxsd51 boards.
- This patch now only adds display support.
- Added some interested people in the Cc list, and removed some people that might be annoyed by the receiving of that patch which is unrelated to their subsystem.
- rebased and reworked the dts displays addition.
- Also rebased and reworked the fsl,pins usage.
--- arch/arm/boot/dts/Makefile | 3 ++ .../imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts | 56 ++++++++++++++++++++ .../imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts | 42 +++++++++++++++ .../imx51-eukrea-mbimxsd51-baseboard-dvi-vga.dts | 42 +++++++++++++++ .../boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts | 49 +++++++++++++++++ 5 files changed, 192 insertions(+) create mode 100644 arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts create mode 100644 arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts create mode 100644 arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-vga.dts
arch/arm/boot/dts/Makefile +3 -0
@@ -178,6 +178,9 @@ dtb-$(CONFIG_ARCH_MXC) += \ imx51-apf51dev.dtb \ imx51-babbage.dtb \ imx51-eukrea-mbimxsd51-baseboard.dtb \ + imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dtb \ + imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dtb \ + imx51-eukrea-mbimxsd51-baseboard-dvi-vga.dtb \ imx53-ard.dtb \ imx53-m53evk.dtb \ imx53-mba53.dtb \
arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts new file +56 -0
56 lines not on this page · raw message
arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts new file +42 -0
42 lines not on this page · raw message
arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-vga.dts new file +42 -0
42 lines not on this page · raw message
arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts +49 -0
67 lines not on this page · raw message
Signature · 1 line
1.7.9.5