Skip to contentSkip to conversation

v4l2: add new V4L2_PIX_FMT_RGB666 pixel format.

PATCH Superseded Denis Carikli 5 participants 17 messages Mar 6, 2014 – Mar 12, 2014

Subsystems (6)

v9 of 14 Superseded Latest is v14 →

lore
Share & tools
lore
#0 lore raw

PATCH v9 1/8 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 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        |   78 ++++++++++++++++++++
 include/uapi/linux/videodev2.h                     |    1 +
 2 files changed, 79 insertions(+)
Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml +78 -0
index 166c8d6..f6a3e84 100644
@@ -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>
@@ -781,6 +820,45 @@ defined in error. Drivers may interpret them as in <xref
 	    <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
index 6ae7bbe..3051d67 100644
@@ -294,6 +294,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
#1 lore raw

PATCH v9 2/8 staging: imx-drm: Add RGB666 support for parallel display.

---
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       |    2 +-
 drivers/staging/imx-drm/ipu-v3/ipu-dc.c            |    9 +++++++++
 drivers/staging/imx-drm/parallel-display.c         |    2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +1 -1
index b876d49..2d24425 100644
@@ -29,7 +29,7 @@ Required properties:
 - crtc: the crtc this display is connected to, see below
 Optional properties:
 - interface_pix_fmt: How this display is connected to the
-  crtc. Currently supported types: "rgb24", "rgb565", "bgr666"
+  crtc. 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
index d5de8bb..6f9abe8 100644
@@ -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
index c60b6c6..01b7ce5 100644
@@ -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
#2 lore raw

PATCH v9 3/8 staging: imx-drm: Correct BGR666 and the board's dts that use them.

In reply to Denis Carikli

The current BGR666 is not consistent with the other color mapings like BGR24. BGR666 should be in the same byte order than BGR24.

---
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/ipu-v3/ipu-dc.c |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/imx51-apf51dev.dts +1 -1
index c29cfa9..bff3201 100644
@@ -19,7 +19,7 @@
 	display at di1 {
 		compatible = "fsl,imx-parallel-display";
 		crtcs = <&ipu 0>;
-		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
index d939ba8..4250e74 100644
@@ -24,7 +24,7 @@
 		display1: display at di1 {
 			compatible = "fsl,imx-parallel-display";
 			crtcs = <&ipu 1>;
-			interface-pix-fmt = "bgr666";
+			interface-pix-fmt = "rgb666";
 			pinctrl-names = "default";
 			pinctrl-0 = <&pinctrl_ipu_disp1>;
 
drivers/staging/imx-drm/ipu-v3/ipu-dc.c +2 -2
index 6f9abe8..154d293 100644
@@ -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
#3 lore raw

PATCH v9 4/8 imx-drm: Match ipu_di_signal_cfg's clk_pol with its description.

According to the datasheet, setting the di0_polarity_disp_clk field in the GENERAL di register sets the output clock polarity to active high.

---
ChangeLog v8->v9:
- 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
index 82a9eba..849b3e1 100644
@@ -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
index e646017..f506075 100644
@@ -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
#4 lore raw

PATCH v9 5/8 staging: imx-drm: Use de-active and pixelclk-active display-timings.

If 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.

The dts were updated to keep the former behaviour.

---
ChangeLog v8->v9:
- Removed the Cc. They are now set in git-send-email directly.
- Rebased on top of the following patch:
"imx-drm: Match ipu_di_signal_cfg's clk_pol with its description."
- Updated the current dts that were using the ipuv3 accordingly, to keep the same hardware settings.
- In the display-timing.txt documentation, the pixelclk-active and de-active optional properties have an "ignored" state when the property is not set.
In this new version, the respective bits in the
display interface's general register are not touched if the dt properties are not set.

ChangeLog v7->v8:
- Changed one Cc

ChangeLog v6->v7:
- Shrinked even more the Cc list.
- Rebased the patch
- val is now initialized in imx_pd_connector_get_modes

ChangeLog v5->v6:
- Remove people not concerned by this patch from the Cc list.
- Removed wrong coments from the code.
- Corrected the code style of the "if (!!val)"

ChangeLog v3->v4:
- The old patch was named "staging: imx-drm: ipuv3-crtc: don't harcode some mode".
- Reworked the patch entierly: we now takes the mode flags from the device tree.

ChangeLog v2->v3:
- Added some interested people in the Cc list.
- Ajusted the flags to match the changes in "drm: Add the lacking DRM_MODE_FLAG_* for matching the DISPLAY_FLAGS_*"

---
 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 ++
 drivers/staging/imx-drm/imx-drm.h           |    5 ++++
 drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h |    4 ++++
 drivers/staging/imx-drm/ipu-v3/ipu-di.c     |   17 ++++++++++----
 drivers/staging/imx-drm/ipuv3-crtc.c        |   18 ++++++++++++--
 drivers/staging/imx-drm/parallel-display.c  |   34 +++++++++++++++++++++++++++
 14 files changed, 89 insertions(+), 7 deletions(-)
arch/arm/boot/dts/imx51-babbage.dts +2 -0
index ebe6c1d..fc6032e 100644
@@ -39,6 +39,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
index 4250e74..32a6667 100644
@@ -41,6 +41,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
index 0217dde3..4092a81 100644
@@ -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
index c8e5ae0..43f48f2 100644
@@ -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
index 2795dfc..59ecfd1 100644
@@ -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
index 99be301..e9419a2 100644
@@ -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
index 009abd6..230bbc6 100644
@@ -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
index 3bec128..ed4c72f 100644
@@ -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
index 04487cb..c89d64b 100644
@@ -450,6 +450,8 @@
 				vfront-porch = <7>;
 				hsync-len = <60>;
 				vsync-len = <10>;
+				de-active = <1>;
+				pixelclk-active = <0>;
 			};
 		};
 	};
drivers/staging/imx-drm/imx-drm.h +5 -0
index 035ab62..a479738 100644
@@ -1,6 +1,11 @@
 #ifndef _IMX_DRM_H_
 #define _IMX_DRM_H_
 
+#define IMXDRM_MODE_FLAG_DE_HIGH		(1 << 0)
+#define IMXDRM_MODE_FLAG_DE_LOW			(1 << 1)
+#define IMXDRM_MODE_FLAG_PIXDATA_POSEDGE	(1 << 2)
+#define IMXDRM_MODE_FLAG_PIXDATA_NEGEDGE	(1 << 3)
+
 struct device_node;
 struct drm_crtc;
 struct drm_connector;
drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h +4 -0
index c4d14ea..fc863e4 100644
@@ -27,6 +27,9 @@ enum ipuv3_type {
 
 #define IPU_PIX_FMT_GBR24	v4l2_fourcc('G', 'B', 'R', '3')
 
+#define SET_CLK_POL	(1 << 0)
+#define SET_DE_POL	(1 << 1)
+
 /*
  * Bitfield of Display Interface signal polarities.
  */
@@ -41,6 +44,7 @@ struct ipu_di_signal_cfg {
 	unsigned enable_pol:1;
 	unsigned Hsync_pol:1;	/* true = active high */
 	unsigned Vsync_pol:1;
+	unsigned set_mask:2;
 
 	u16 width;
 	u16 height;
drivers/staging/imx-drm/ipu-v3/ipu-di.c +13 -4
index 849b3e1..5d273c1 100644
@@ -595,8 +595,12 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig)
 		}
 	}
 
-	if (sig->clk_pol)
-		di_gen |= DI_GEN_POLARITY_DISP_CLK;
+	if (sig->set_mask & SET_CLK_POL) {
+		if (sig->clk_pol)
+			di_gen |= DI_GEN_POLARITY_DISP_CLK;
+		else
+			di_gen &= ~DI_GEN_POLARITY_DISP_CLK;
+	}
 
 	ipu_di_write(di, di_gen, DI_GENERAL);
 
@@ -606,8 +610,13 @@ 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)
-		reg |= DI_POL_DRDY_POLARITY_15;
+	if (sig->set_mask & SET_DE_POL) {
+		if (sig->enable_pol)
+			reg |= DI_POL_DRDY_POLARITY_15;
+		else
+			reg &= ~DI_POL_DRDY_POLARITY_15;
+	}
+
 	if (sig->data_pol)
 		reg |= DI_POL_DRDY_DATA_POLARITY;
 
drivers/staging/imx-drm/ipuv3-crtc.c +16 -2
index f506075..71f757f 100644
@@ -157,8 +157,22 @@ 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;
+	if (mode->private_flags & IMXDRM_MODE_FLAG_DE_HIGH) {
+		sig_cfg.enable_pol = 1;
+		sig_cfg.set_mask |= SET_DE_POL;
+	} else if (mode->private_flags & IMXDRM_MODE_FLAG_DE_LOW) {
+		sig_cfg.enable_pol = 0;
+		sig_cfg.set_mask |= SET_DE_POL;
+	}
+
+	if (mode->private_flags & IMXDRM_MODE_FLAG_PIXDATA_POSEDGE) {
+		sig_cfg.clk_pol = 1;
+		sig_cfg.set_mask |= SET_CLK_POL;
+	} else if (mode->private_flags & IMXDRM_MODE_FLAG_PIXDATA_NEGEDGE) {
+		sig_cfg.clk_pol = 0;
+		sig_cfg.set_mask |= SET_CLK_POL;
+	}
+
 	sig_cfg.width = mode->hdisplay;
 	sig_cfg.height = mode->vdisplay;
 	sig_cfg.pixel_fmt = out_pixel_fmt;
drivers/staging/imx-drm/parallel-display.c +34 -0
index 01b7ce5..084500b 100644
@@ -80,9 +80,43 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector)
 
 	if (np) {
 		struct drm_display_mode *mode = drm_mode_create(connector->dev);
+		struct device_node *timings_np;
+		struct device_node *mode_np;
+		u32 val;
+
 		if (!mode)
 			return -EINVAL;
 		of_get_drm_display_mode(np, &imxpd->mode, OF_USE_NATIVE_MODE);
+
+		timings_np = of_get_child_by_name(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) {
+					imxpd->mode.private_flags |=
+						IMXDRM_MODE_FLAG_DE_HIGH;
+				} else {
+					imxpd->mode.private_flags |=
+						IMXDRM_MODE_FLAG_DE_LOW;
+				}
+			}
+
+			if (!of_property_read_u32(mode_np, "pixelclk-active",
+						  &val)) {
+				if (val) {
+					imxpd->mode.private_flags |=
+						IMXDRM_MODE_FLAG_PIXDATA_POSEDGE;
+				} else {
+					imxpd->mode.private_flags |=
+						IMXDRM_MODE_FLAG_PIXDATA_NEGEDGE;
+				}
+			}
+		}
 		drm_mode_copy(mode, &imxpd->mode);
 		mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
 		drm_mode_probed_add(connector, mode);
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v9 5/8 staging: imx-drm: Use de-active and pixelclk-active display-timings.

Quoted 50 lines · Denis Carikli
drivers/staging/imx-drm/ipu-v3/ipu-di.c +13 -4
index 849b3e1..5d273c1 100644
@@ -595,8 +595,12 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig)
 		}
 	}
 
-	if (sig->clk_pol)
-		di_gen |= DI_GEN_POLARITY_DISP_CLK;
+	if (sig->set_mask & SET_CLK_POL) {
+		if (sig->clk_pol)
+			di_gen |= DI_GEN_POLARITY_DISP_CLK;
+		else
+			di_gen &= ~DI_GEN_POLARITY_DISP_CLK;
+	}
 
 	ipu_di_write(di, di_gen, DI_GENERAL);
 
@@ -606,8 +610,13 @@ 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)
-		reg |= DI_POL_DRDY_POLARITY_15;
+	if (sig->set_mask & SET_DE_POL) {
+		if (sig->enable_pol)
+			reg |= DI_POL_DRDY_POLARITY_15;
+		else
+			reg &= ~DI_POL_DRDY_POLARITY_15;
+	}
+
 	if (sig->data_pol)
 		reg |= DI_POL_DRDY_DATA_POLARITY;
 
drivers/staging/imx-drm/ipuv3-crtc.c +5 -2
index f506075..71f757f 100644
@@ -157,8 +157,22 @@ 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;
+	if (mode->private_flags & IMXDRM_MODE_FLAG_DE_HIGH) {
+		sig_cfg.enable_pol = 1;
+		sig_cfg.set_mask |= SET_DE_POL;
+	} else if (mode->private_flags & IMXDRM_MODE_FLAG_DE_LOW) {
+		sig_cfg.enable_pol = 0;

drivers/staging/imx-drm/ipuv3-crtc.c static int ipu_crtc_mode_set(struct drm_crtc *crtc, · line 174

Quoted 10 lines
drivers/staging/imx-drm/ipuv3-crtc.c +10 -0
+		sig_cfg.set_mask |= SET_DE_POL;
+	}
+
+	if (mode->private_flags & IMXDRM_MODE_FLAG_PIXDATA_POSEDGE) {
+		sig_cfg.clk_pol = 1;
+		sig_cfg.set_mask |= SET_CLK_POL;
+	} else if (mode->private_flags & IMXDRM_MODE_FLAG_PIXDATA_NEGEDGE) {
+		sig_cfg.clk_pol = 0;
+		sig_cfg.set_mask |= SET_CLK_POL;
+	}

So how does this work for other displays, for example, HDMI, where we need enable_pol=1 and clk_pol=0 ?

drivers/staging/imx-drm/ipuv3-crtc.c static int ipu_crtc_mode_set(struct drm_crtc *crtc, · line 175

Quoted 1 line
drivers/staging/imx-drm/ipuv3-crtc.c +0 -0
 From what I can see, we end up with sig_cfg.enable_pol=0, sig_cfg.clk_pol=0,

sig_cfg.set_mask=0.

What we end up with for enable_pol is this:

	reg = ipu_di_read(di, DI_POL);
	reg &= ~(DI_POL_DRDY_DATA_POLARITY | DI_POL_DRDY_POLARITY_15);

- if (sig->enable_pol)
- reg |= DI_POL_DRDY_POLARITY_15;
+ if (sig->set_mask & SET_DE_POL) {
+ if (sig->enable_pol)
+ reg |= DI_POL_DRDY_POLARITY_15;
+ else
+ reg &= ~DI_POL_DRDY_POLARITY_15;
+ }

which is no different from:

	reg = ipu_di_read(di, DI_POL);
	reg &= ~(DI_POL_DRDY_DATA_POLARITY | DI_POL_DRDY_POLARITY_15);

	if (sig->set_mask & SET_DE_POL && sig->enable_pol)
		reg |= DI_POL_DRDY_POLARITY_15;

because even with SET_DE_POL unset, we still end up clearing the bit.

Similar seems to happen with the clock polarity as well - in order for that bit to be set, buth the set_mask and the clk_pol but must be set.

Dovetailing in to my previous reply, if we want to do this, maybe we should convert clk_pol and enable_pol to be a tristate (can be an u8 or enum). Essentially, it has three values: preserve, active high, active low.

However, one of the things that really worries me here is the "preserve" action - what if it's not correctly set initially, and we don't have anything specifying either polarity, which will happen if the only encoder/connector you have is imx-hdmi.

Signature · 2 lines
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
#6 lore raw

PATCH v9 6/8 staging: imx-drm: parallel display: add regulator support.

In reply to Denis Carikli

---
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.
- Rebased.

ChangeLog v6->v7:
- Shrinked even more the Cc list.
- Rebased the patch and included video/of_display_timing.h

---
 .../bindings/staging/imx-drm/fsl-imx-drm.txt       |    1 +
 drivers/staging/imx-drm/parallel-display.c         |   13 +++++++++++++
 2 files changed, 14 insertions(+)
Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +1 -0
index 2d24425..4dd7ce5 100644
@@ -28,6 +28,7 @@ Required properties:
 - compatible: Should be "fsl,imx-parallel-display"
 - crtc: the crtc this display is connected to, see below
 Optional properties:
+- display-supply : phandle to the regulator device tree node if needed.
 - interface_pix_fmt: How this display is connected to the
   crtc. Currently supported types: "rgb24", "rgb565", "bgr666", "rgb666"
 - edid: verbatim EDID data block describing attached display.
drivers/staging/imx-drm/parallel-display.c +13 -0
index 084500b..0e0c5ac 100644
@@ -24,6 +24,7 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_panel.h>
+#include <linux/regulator/consumer.h>
 #include <linux/videodev2.h>
 #include <video/of_display_timing.h>
 
@@ -36,6 +37,7 @@ struct imx_parallel_display {
 	struct drm_connector connector;
 	struct drm_encoder encoder;
 	struct device *dev;
+	struct regulator *disp_reg;
 	void *edid;
 	int edid_len;
 	u32 interface_pix_fmt;
@@ -155,6 +157,9 @@ static void imx_pd_encoder_prepare(struct drm_encoder *encoder)
 {
 	struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
 
+	if (regulator_enable(imxpd->disp_reg))
+		dev_err(imxpd->dev, "Failed to enable regulator.\n");
+
 	imx_drm_panel_format(encoder, imxpd->interface_pix_fmt);
 }
 
@@ -170,6 +175,10 @@ static void imx_pd_encoder_mode_set(struct drm_encoder *encoder,
 
 static void imx_pd_encoder_disable(struct drm_encoder *encoder)
 {
+	struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
+
+	if (regulator_disable(imxpd->disp_reg))
+		dev_err(imxpd->dev, "Failed to disable regulator.\n");
 }
 
 static struct drm_connector_funcs imx_pd_connector_funcs = {
@@ -267,6 +276,10 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
 	if (ret)
 		return ret;
 
+	imxpd->disp_reg = devm_regulator_get(dev, "display");
+	if (IS_ERR(imxpd->disp_reg))
+		return PTR_ERR(imxpd->disp_reg);
+
 	dev_set_drvdata(dev, imxpd);
 
 	return 0;
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH v9 6/8 staging: imx-drm: parallel display: add regulator support.

Hi Denis,

Am Donnerstag, den 06.03.2014, 17:04 +0100 schrieb Denis Carikli:

Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt Required properties: · line 31

Quoted 9 lines
Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +1 -0
index 2d24425..4dd7ce5 100644
@@ -28,6 +28,7 @@ Required properties:
 - compatible: Should be "fsl,imx-parallel-display"
 - crtc: the crtc this display is connected to, see below
 Optional properties:
+- display-supply : phandle to the regulator device tree node if needed.

I'd very much prefer to not do this here. I have submitted a patch to add drm_display support to this driver, so you can connect a drm_panel compatible driver as output. The simple-panel driver already supports supply regulator and backlight control.

regards
Philipp

Quoted 55 lines
Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +0 -0
 - interface_pix_fmt: How this display is connected to the
   crtc. Currently supported types: "rgb24", "rgb565", "bgr666", "rgb666"
 - edid: verbatim EDID data block describing attached display.
drivers/staging/imx-drm/parallel-display.c +13 -0
index 084500b..0e0c5ac 100644
@@ -24,6 +24,7 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_panel.h>
+#include <linux/regulator/consumer.h>
 #include <linux/videodev2.h>
 #include <video/of_display_timing.h>
 
@@ -36,6 +37,7 @@ struct imx_parallel_display {
 	struct drm_connector connector;
 	struct drm_encoder encoder;
 	struct device *dev;
+	struct regulator *disp_reg;
 	void *edid;
 	int edid_len;
 	u32 interface_pix_fmt;
@@ -155,6 +157,9 @@ static void imx_pd_encoder_prepare(struct drm_encoder *encoder)
 {
 	struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
 
+	if (regulator_enable(imxpd->disp_reg))
+		dev_err(imxpd->dev, "Failed to enable regulator.\n");
+
 	imx_drm_panel_format(encoder, imxpd->interface_pix_fmt);
 }
 
@@ -170,6 +175,10 @@ static void imx_pd_encoder_mode_set(struct drm_encoder *encoder,
 
 static void imx_pd_encoder_disable(struct drm_encoder *encoder)
 {
+	struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
+
+	if (regulator_disable(imxpd->disp_reg))
+		dev_err(imxpd->dev, "Failed to disable regulator.\n");
 }
 
 static struct drm_connector_funcs imx_pd_connector_funcs = {
@@ -267,6 +276,10 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
 	if (ret)
 		return ret;
 
+	imxpd->disp_reg = devm_regulator_get(dev, "display");
+	if (IS_ERR(imxpd->disp_reg))
+		return PTR_ERR(imxpd->disp_reg);
+
 	dev_set_drvdata(dev, imxpd);
 
 	return 0;
#8 lore raw

Re: [PATCH v9][ 6/8] staging: imx-drm: parallel display: add regulator support.

???????, 6 ????? 2014, 17:29 +01:00 ?? Philipp Zabel <[email protected]>:

Quoted 17 lines

Hi Denis,

Am Donnerstag, den 06.03.2014, 17:04 +0100 schrieb Denis Carikli:

Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt Required properties: · line 31

Quoted 9 lines
Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +1 -0
index 2d24425..4dd7ce5 100644
@@ -28,6 +28,7 @@ Required properties:
 - compatible: Should be "fsl,imx-parallel-display"
 - crtc: the crtc this display is connected to, see below
 Optional properties:
+- display-supply : phandle to the regulator device tree node if needed.

I'd very much prefer to not do this here. I have submitted a patch to add drm_display support to this driver, so you can connect a drm_panel compatible driver as output. The simple-panel driver already supports supply regulator and backlight control.

...

Quoted 3 lines

Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt

Quoted 3 lines
Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +3 -0
+	imxpd->disp_reg = devm_regulator_get(dev, "display");
+	if (IS_ERR(imxpd->disp_reg))
+		return PTR_ERR(imxpd->disp_reg);

And here we can see that this regulator is not optional.

---

#9 lore raw

PATCH v9 6/8 staging: imx-drm: parallel display: add regulator support.

In reply to Denis Carikli

Hi,

Quoted 23 lines · Denis Carikli

---
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.
- Rebased.

ChangeLog v6->v7:
- Shrinked even more the Cc list.
- Rebased the patch and included video/of_display_timing.h

---
 .../bindings/staging/imx-drm/fsl-imx-drm.txt       |    1 +
 drivers/staging/imx-drm/parallel-display.c         |   13 +++++++++++++
 2 files changed, 14 insertions(+)
Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +0 -0
index 2d24425..4dd7ce5 100644

Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt Required properties: · line 32

Quoted 5 lines
Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +1 -0
@@ -28,6 +28,7 @@ Required properties:
 - compatible: Should be "fsl,imx-parallel-display"
 - crtc: the crtc this display is connected to, see below
 Optional properties:
+- display-supply : phandle to the regulator device tree node if needed.
 

Any reason why this is named 'display-supply' rather than 'lcd-supply' like for imxfb?

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
#10 lore raw

PATCH v9 7/8 ARM: dts: mbimx51sd: Add display support.

In reply to Denis Carikli

The CMO-QVGA, DVI-SVGA and DVI-VGA are added.

---
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  |   59 ++++++++++++++++++++
 .../imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts  |   46 +++++++++++++++
 .../imx51-eukrea-mbimxsd51-baseboard-dvi-vga.dts   |   46 +++++++++++++++
 .../boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts  |   47 ++++++++++++++++
 5 files changed, 201 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
index 7407ee8..6979028 100644
@@ -177,6 +177,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 +59 -0

59 lines not on this page · raw message

arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts new file +46 -0

46 lines not on this page · raw message

arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-vga.dts new file +46 -0

46 lines not on this page · raw message

arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts +47 -0

65 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#11 lore raw

PATCH v9 7/8 ARM: dts: mbimx51sd: Add display support.

Hi Denis,

Am Donnerstag, den 06.03.2014, 17:04 +0100 schrieb Denis Carikli:
[...]

arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts line 24

Quoted 4 lines

+&display {

arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts new file +3 -0
+	status = "okay";
+	display-timings {
+		model = "DVI-SVGA";

Does this board really have a DVI connector and no I2C bus routed to the DDC pins?

Quoted 18 lines
arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-dvi-svga.dts new file +18 -0
+		bits-per-pixel = <16>;
+		svga {
+			clock-frequency = <44333333>;
+			hactive = <800>;
+			vactive = <600>;
+			hback-porch = <112>;
+			hfront-porch = <32>;
+			vback-porch = <3>;
+			vfront-porch = <17>;
+			hsync-len = <80>;
+			vsync-len = <4>;
+			hsync-active = <1>;
+			vsync-active = <1>;
+			de-active = <1>;
+			pixelclk-active = <1>;
+		};
+	};
+};

[...]

arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts line 55

Quoted 6 lines
arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts +6 -0
+	imx_drm: imx-drm {
+		compatible = "fsl,imx-drm";
+		crtcs = <&ipu 0>;
+		connectors = <&display>;
+		status = "disabled";
+	};

Please let's postpone this until the imx-drm-dt patch series is accepted. I've changed the device tree bindings so this node is not necessary to be included in every board dts.

regards
Philipp

#12 lore raw

PATCH v9 7/8 ARM: dts: mbimx51sd: Add display support.

Quoted 1 line · Philipp Zabel

Hi Denis,

Hi,

Quoted 2 lines

Does this board really have a DVI connector and no I2C bus routed to the DDC pins?

Yes, I2C is not routed to the DVI connector.

Denis.

#13 lore raw

PATCH v9 8/8 ARM: dts: mbimx51sd: Add CMO-QVGA backlight support.

In reply to Denis Carikli

---
ChangeLog v8->v9:
- Removed the Cc. They are now set in git-send-email directly.
- The backlight is now on at boot.

ChangeLog v6->v7:
- Shrinked even more the Cc list.

ChangeLog v5->v6:
- Reordered the Cc list.

ChangeLog v3->v5:
- Updated to the new GPIO defines.

ChangeLog v2->v3:
- Splitted out from the patch that added support for the cpuimx51/mbimxsd51 boards.
- This patch now only adds backlight 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.

---
 .../imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts  |    8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard-cmo-qvga.dts +9 -0
index dbf1083..59c6038 100644
@@ -17,6 +17,15 @@
 	model = "Eukrea MBIMXSD51 with the CMO-QVGA Display";
 	compatible = "eukrea,mbimxsd51-baseboard-cmo-qvga", "eukrea,mbimxsd51-baseboard", "eukrea,cpuimx51", "fsl,imx51";
 
+	backlight {
+		compatible = "gpio-backlight";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_backlight_1>;
+		gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>;
+		default-brightness-level = <1>;
+		default-on;
+	};
+
 	reg_lcd_3v3: lcd-en {
 		compatible = "regulator-fixed";
 		pinctrl-names = "default";
Signature · 1 line
1.7.9.5
#14 lore raw

PATCH v9 4/8 imx-drm: Match ipu_di_signal_cfg's clk_pol with its description.

In reply to Denis Carikli
Quoted 32 lines · Denis Carikli

According to the datasheet, setting the di0_polarity_disp_clk field in the GENERAL di register sets the output clock polarity to active high.

---
ChangeLog v8->v9:
- 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
index 82a9eba..849b3e1 100644
@@ -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 +0 -0
index e646017..f506075 100644

drivers/staging/imx-drm/ipuv3-crtc.c static int ipu_crtc_mode_set(struct drm_crtc *crtc, · line 164

Quoted 8 lines
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;

I brought this up a while back:

http://archive.arm.linux.org.uk/lurker/message/20131015.103500.0c058eb9.en.html

it looks like it was never properly addressed, so yes, I think this is the right solution, and brings the kernel inline with the code which was in uboot back in October, and the value of sig_cfg.clk_pol now matches the register bit.

However, I think an even better solution would be to have the clk_pol values to be defined: CLK_POL_ACTIVE_HIGH and CLK_POL_ACTIVE_LOW. This makes the actual value used irrelevant, and helps readability. Maybe something to consider for a future patch?

Signature · 2 lines
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
#15 lore raw

PATCH v9 3/8 staging: imx-drm: Correct BGR666 and the board's dts that use them.

In reply to Denis Carikli

Hi Denis,

Am Donnerstag, den 06.03.2014, 17:01 +0100 schrieb Denis Carikli:

Quoted 4 lines

The current BGR666 is not consistent with the other color mapings like BGR24. BGR666 should be in the same byte order than BGR24.

patches 1 to 3

You should add Russell King to Cc:, who has volunteered to collect imx-drm patches before sending them on to Greg for now.

regards
Philipp

#16 lore raw

PATCH v9 3/8 staging: imx-drm: Correct BGR666 and the board's dts that use them.

In reply to Denis Carikli

Hi,

Quoted 3 lines · Denis Carikli

The current BGR666 is not consistent with the other color mapings like BGR24. BGR666 should be in the same byte order than BGR24.

[...]

Quoted 7 lines
drivers/staging/imx-drm/ipu-v3/ipu-dc.c +0 -0
index 6f9abe8..154d293 100644
@@ -397,9 +397,9 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev,
 

drivers/staging/imx-drm/ipu-v3/ipu-dc.c int ipu_dc_init(struct ipu_soc *ipu, struct device *dev, · line 405

Quoted 10 lines
drivers/staging/imx-drm/ipu-v3/ipu-dc.c +2 -2
 	/* 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);

You obviously missed this one which is also affected by your change:

drivers/staging/imx-drm/imx-ldb.c +2 -2
index daa54df..e5a600b 100644
@@ -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",

Without this patch Red/Blue on an 18bit LVDS display will be swapped.

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________