Skip to contentSkip to conversation

Restore parallel display support for Exynos based boards

PATCH In review Andrzej Hajda 4 participants 17 messages Mar 17, 2014 – Mar 21, 2014 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Restore parallel display support for Exynos based boards

Hi,

This patch set restores parallel display support removed during exynos refactorization. It is rebased on the latest exynos-drm-next branch plus patch adding polarization flags to drm_display_mode [1].

[1]: http://permalink.gmane.org/gmane.linux.drivers.driver-project.devel/47216

Regards
Andrzej

Andrzej Hajda (9):
drm/exynos: delay fbdev initialization until an output is connected drm/exynos: init kms poll after creation of connectors drm/exynos: correct timing porch conversion
exynos/fimd: add parallel output related bindings drm/exynos: restore parallel output interface support
ARM: dts: exynos4210-universal: add exynos/fimd node drm/modes: add polarization handling to mode conversion drm/exynos/fimd: use polarization flags provided by drm_display_mode drm/exynos/fimd: remove unused variable

 .../devicetree/bindings/video/samsung-fimd.txt     |  15 +
 arch/arm/boot/dts/exynos4210-universal_c210.dts    |  25 ++
 drivers/gpu/drm/drm_modes.c                        |  11 +
 drivers/gpu/drm/exynos/Kconfig                     |   8 +
 drivers/gpu/drm/exynos/Makefile                    |   1 +
 drivers/gpu/drm/exynos/exynos_drm_dpi.c            | 339 +++++++++++++++++++++
 drivers/gpu/drm/exynos/exynos_drm_drv.c            |  22 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.h            |   8 +
 drivers/gpu/drm/exynos/exynos_drm_fb.c             |   3 +
 drivers/gpu/drm/exynos/exynos_drm_fimd.c           |  32 +-
 10 files changed, 432 insertions(+), 32 deletions(-)
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_dpi.c
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/9 drm/exynos: delay fbdev initialization until an output is connected

In case fbdev is initialized before any output is connected, fb resolution defaults to 1024x768. After that any output with bigger resolution is ignored and fbdev is not displayed. The patch postpones fbdev initialization to avoid such situation.

---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 16 ++++------------
 drivers/gpu/drm/exynos/exynos_drm_fb.c  |  3 +++
 2 files changed, 7 insertions(+), 12 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +4 -12
index c8869de..25f45b8 100644
@@ -109,24 +109,15 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
 	/* setup possible_clones. */
 	exynos_drm_encoder_setup(dev);
 
-	/*
-	 * create and configure fb helper and also exynos specific
-	 * fbdev object.
-	 */
-	ret = exynos_drm_fbdev_init(dev);
-	if (ret) {
-		DRM_ERROR("failed to initialize drm fbdev\n");
-		goto err_drm_device;
-	}
-
 	drm_vblank_offdelay = VBLANK_OFF_DELAY;
 
 	platform_set_drvdata(dev->platformdev, dev);
 
+	/* force connectors detection */
+	drm_helper_hpd_irq_event(dev);
+
 	return 0;
 
-err_drm_device:
-	exynos_drm_device_unregister(dev);
 err_vblank:
 	drm_vblank_cleanup(dev);
 err_display_cleanup:
@@ -571,6 +562,7 @@ out_hdmi:
 	platform_driver_unregister(&fimd_driver);
 out_fimd:
 #endif
+
 #ifdef CONFIG_DRM_EXYNOS_DP
 	platform_driver_unregister(&dp_driver);
 out_dp:
drivers/gpu/drm/exynos/exynos_drm_fb.c +3 -0
index c7c08d0..65a22ca 100644
@@ -20,6 +20,7 @@
 
 #include "exynos_drm_drv.h"
 #include "exynos_drm_fb.h"
+#include "exynos_drm_fbdev.h"
 #include "exynos_drm_gem.h"
 #include "exynos_drm_iommu.h"
 #include "exynos_drm_crtc.h"
@@ -300,6 +301,8 @@ static void exynos_drm_output_poll_changed(struct drm_device *dev)
 
 	if (fb_helper)
 		drm_fb_helper_hotplug_event(fb_helper);
+	else
+		exynos_drm_fbdev_init(dev);
 }
 
 static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = {
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 2/9 drm/exynos: init kms poll after creation of connectors

In reply to Andrzej Hajda

KMS poll init helper should be run when connectors are created, otherwise it will not schedule connection detector.

---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +3 -3
index 25f45b8..dfee083 100644
@@ -71,9 +71,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
 
 	drm_mode_config_init(dev);
 
-	/* init kms poll for handling hpd */
-	drm_kms_helper_poll_init(dev);
-
 	exynos_drm_mode_config_init(dev);
 
 	ret = exynos_drm_initialize_managers(dev);
@@ -93,6 +90,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
 	if (ret)
 		goto err_manager_cleanup;
 
+	/* init kms poll for handling hpd */
+	drm_kms_helper_poll_init(dev);
+
 	ret = drm_vblank_init(dev, MAX_CRTC);
 	if (ret)
 		goto err_display_cleanup;
Signature · 1 line
1.8.3.2
#3 lore raw

PATCH 3/9 drm/exynos: correct timing porch conversion

In reply to Andrzej Hajda

The patch corrects porch calculation. It should be calculated as a difference between adjacent respective fields of drm_display_mode.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +5 -7
index f78fbf4..10431b0 100644
@@ -221,7 +221,7 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
 	struct drm_display_mode *mode = &ctx->mode;
 	struct fimd_driver_data *driver_data;
 	u32 val, clkdiv, vidcon1;
-	int hblank, vblank, vsync_len, vbpd, vfpd, hsync_len, hbpd, hfpd;
+	int vsync_len, vbpd, vfpd, hsync_len, hbpd, hfpd;
 
 	driver_data = ctx->driver_data;
 	if (ctx->suspended)
@@ -240,10 +240,9 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
 	writel(vidcon1, ctx->regs + driver_data->timing_base + VIDCON1);
 
 	/* setup vertical timing values. */
-	vblank = mode->crtc_vblank_end - mode->crtc_vblank_start;
 	vsync_len = mode->crtc_vsync_end - mode->crtc_vsync_start;
-	vbpd = (vblank - vsync_len) / 2;
-	vfpd = vblank - vsync_len - vbpd;
+	vbpd = mode->crtc_vtotal - mode->crtc_vsync_end;
+	vfpd = mode->crtc_vsync_start - mode->crtc_vdisplay;
 
 	val = VIDTCON0_VBPD(vbpd - 1) |
 		VIDTCON0_VFPD(vfpd - 1) |
@@ -251,10 +250,9 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
 	writel(val, ctx->regs + driver_data->timing_base + VIDTCON0);
 
 	/* setup horizontal timing values.  */
-	hblank = mode->crtc_hblank_end - mode->crtc_hblank_start;
 	hsync_len = mode->crtc_hsync_end - mode->crtc_hsync_start;
-	hbpd = (hblank - hsync_len) / 2;
-	hfpd = hblank - hsync_len - hbpd;
+	hbpd = mode->crtc_htotal - mode->crtc_hsync_end;
+	hfpd = mode->crtc_hsync_start - mode->crtc_hdisplay;
 
 	val = VIDTCON1_HBPD(hbpd - 1) |
 		VIDTCON1_HFPD(hfpd - 1) |
Signature · 1 line
1.8.3.2
#4 lore raw

PATCH 4/9 exynos/fimd: add parallel output related bindings

In reply to Andrzej Hajda

The patch adds bindings required to add support
for parallel output.

---
 Documentation/devicetree/bindings/video/samsung-fimd.txt | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Documentation/devicetree/bindings/video/samsung-fimd.txt +15 -0
index 36b7895..2dad41b 100644
@@ -41,6 +41,21 @@ Optional Properties:
 - samsung,power-domain: a phandle to FIMD power domain node.
 - samsung,invert-vden: video enable signal is inverted
 - samsung,invert-vclk: video clock signal is inverted
+- display-timings: timing settings for FIMD, as described in document [1].
+		Can be used in case timings cannot be provided otherwise
+		or to override timings provided by the panel.
+
+The device node can contain 'port' child nodes according to the bindings defined
+in [2]. The following are properties specific to those nodes:
+- reg: (required) port index, can be:
+		0 - for CAMIF0 input,
+		1 - for CAMIF1 input,
+		2 - for CAMIF2 input,
+		3 - for parallel output,
+		4 - for write-back interface
+
+[1]: Documentation/devicetree/bindings/video/display-timing.txt
+[2]: Documentation/devicetree/bindings/media/video-interfaces.txt
 
 Example:
 
Signature · 1 line
1.8.3.2
#5 lore raw

PATCH 5/9 drm/exynos: restore parallel output interface support

In reply to Andrzej Hajda

The patch adds parallel output interface to FIMD device driver. It also restores support for panels initialized by boot loader, but without proper kernel driver.
Driver uses video interface bindings to find connected panel. It uses drm_panel interface to interact with the panel.

---
 drivers/gpu/drm/exynos/Kconfig           |   8 +
 drivers/gpu/drm/exynos/Makefile          |   1 +
 drivers/gpu/drm/exynos/exynos_drm_dpi.c  | 339 +++++++++++++++++++++++++++++++
 drivers/gpu/drm/exynos/exynos_drm_drv.h  |   8 +
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   4 +
 5 files changed, 360 insertions(+)
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_dpi.c
drivers/gpu/drm/exynos/Kconfig +8 -0
index 7eea698..56f9581 100644
@@ -31,6 +31,14 @@ config DRM_EXYNOS_FIMD
 	help
 	  Choose this option if you want to use Exynos FIMD for DRM.
 
+config DRM_EXYNOS_DPI
+	bool "EXYNOS DRM parallel output support"
+	depends on DRM_EXYNOS
+	select DRM_PANEL
+	default n
+	help
+	  This enables support for Exynos parallel output.
+
 config DRM_EXYNOS_DP
 	bool "EXYNOS DRM DP driver support"
 	depends on DRM_EXYNOS && ARCH_EXYNOS
drivers/gpu/drm/exynos/Makefile +1 -0
index b1839e8..babcd52 100644
@@ -11,6 +11,7 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o \
 exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_DMABUF) += exynos_drm_dmabuf.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)	+= exynos_drm_fimd.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_DPI)	+= exynos_drm_dpi.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_DP)	+= exynos_dp_core.o exynos_dp_reg.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)	+= exynos_hdmi.o exynos_mixer.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)	+= exynos_drm_vidi.o
drivers/gpu/drm/exynos/exynos_drm_dpi.c new file +339 -0

339 lines not on this page · raw message

drivers/gpu/drm/exynos/exynos_drm_drv.h +8 -0
index 1c78806..8bbc415 100644
@@ -361,6 +361,14 @@ int exynos_platform_device_ipp_register(void);
  */
 void exynos_platform_device_ipp_unregister(void);
 
+#ifdef CONFIG_DRM_EXYNOS_DPI
+int exynos_dpi_probe(struct device *dev);
+int exynos_dpi_remove(struct device *dev);
+#else
+int exynos_dpi_probe(struct device *dev) { return 0; }
+int exynos_dpi_remove(struct device *dev) { return 0; }
+#endif
+
 extern struct platform_driver dp_driver;
 extern struct platform_driver fimd_driver;
 extern struct platform_driver hdmi_driver;
drivers/gpu/drm/exynos/exynos_drm_fimd.c +4 -0
index 10431b0..15d6b37 100644
@@ -920,6 +920,8 @@ static int fimd_probe(struct platform_device *pdev)
 	fimd_manager.ctx = ctx;
 	exynos_drm_manager_register(&fimd_manager);
 
+	exynos_dpi_probe(ctx->dev);
+
 	pm_runtime_enable(dev);
 
 	for (win = 0; win < WINDOWS_NR; win++)
@@ -932,6 +934,8 @@ static int fimd_remove(struct platform_device *pdev)
 {
 	struct exynos_drm_manager *mgr = platform_get_drvdata(pdev);
 
+	exynos_dpi_remove(&pdev->dev);
+
 	exynos_drm_manager_unregister(&fimd_manager);
 
 	fimd_dpms(mgr, DRM_MODE_DPMS_OFF);
Signature · 1 line
1.8.3.2
#6 lore raw

PATCH v2 5/9 drm/exynos: restore parallel output interface support

The patch adds parallel output interface to FIMD device driver. It also restores support for panels initialized by boot loader, but without proper kernel driver.
Driver uses video interface bindings to find connected panel. It uses drm_panel interface to interact with the panel.

---
v2:
- corrected stub definitions

---
 drivers/gpu/drm/exynos/Kconfig           |   8 +
 drivers/gpu/drm/exynos/Makefile          |   1 +
 drivers/gpu/drm/exynos/exynos_drm_dpi.c  | 339 +++++++++++++++++++++++++++++++
 drivers/gpu/drm/exynos/exynos_drm_drv.h  |   8 +
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   4 +
 5 files changed, 360 insertions(+)
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_dpi.c
drivers/gpu/drm/exynos/Kconfig +8 -0
index 7eea698..56f9581 100644
@@ -31,6 +31,14 @@ config DRM_EXYNOS_FIMD
 	help
 	  Choose this option if you want to use Exynos FIMD for DRM.
 
+config DRM_EXYNOS_DPI
+	bool "EXYNOS DRM parallel output support"
+	depends on DRM_EXYNOS
+	select DRM_PANEL
+	default n
+	help
+	  This enables support for Exynos parallel output.
+
 config DRM_EXYNOS_DP
 	bool "EXYNOS DRM DP driver support"
 	depends on DRM_EXYNOS && ARCH_EXYNOS
drivers/gpu/drm/exynos/Makefile +1 -0
index b1839e8..babcd52 100644
@@ -11,6 +11,7 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o \
 exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_DMABUF) += exynos_drm_dmabuf.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)	+= exynos_drm_fimd.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_DPI)	+= exynos_drm_dpi.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_DP)	+= exynos_dp_core.o exynos_dp_reg.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)	+= exynos_hdmi.o exynos_mixer.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)	+= exynos_drm_vidi.o
drivers/gpu/drm/exynos/exynos_drm_dpi.c new file +339 -0

339 lines not on this page · raw message

drivers/gpu/drm/exynos/exynos_drm_drv.h +8 -0
index 1c78806..2d892f3 100644
@@ -361,6 +361,14 @@ int exynos_platform_device_ipp_register(void);
  */
 void exynos_platform_device_ipp_unregister(void);
 
+#ifdef CONFIG_DRM_EXYNOS_DPI
+int exynos_dpi_probe(struct device *dev);
+int exynos_dpi_remove(struct device *dev);
+#else
+static inline int exynos_dpi_probe(struct device *dev) { return 0; }
+static inline int exynos_dpi_remove(struct device *dev) { return 0; }
+#endif
+
 extern struct platform_driver dp_driver;
 extern struct platform_driver fimd_driver;
 extern struct platform_driver hdmi_driver;
drivers/gpu/drm/exynos/exynos_drm_fimd.c +4 -0
index 10431b0..15d6b37 100644
@@ -920,6 +920,8 @@ static int fimd_probe(struct platform_device *pdev)
 	fimd_manager.ctx = ctx;
 	exynos_drm_manager_register(&fimd_manager);
 
+	exynos_dpi_probe(ctx->dev);
+
 	pm_runtime_enable(dev);
 
 	for (win = 0; win < WINDOWS_NR; win++)
@@ -932,6 +934,8 @@ static int fimd_remove(struct platform_device *pdev)
 {
 	struct exynos_drm_manager *mgr = platform_get_drvdata(pdev);
 
+	exynos_dpi_remove(&pdev->dev);
+
 	exynos_drm_manager_unregister(&fimd_manager);
 
 	fimd_dpms(mgr, DRM_MODE_DPMS_OFF);
Signature · 1 line
1.8.3.2
#7 lore raw

PATCH 6/9 ARM: dts: exynos4210-universal: add exynos/fimd node

In reply to Andrzej Hajda

The patch adds fimd node with display timings for exynos4210-universal device. It also makes LCD regulators always on. This allow to re-use panel initialized by boot loader.

---
 arch/arm/boot/dts/exynos4210-universal_c210.dts | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
arch/arm/boot/dts/exynos4210-universal_c210.dts +25 -0
index d2e3f5f..21ca0b978 100644
@@ -225,6 +225,7 @@
 					regulator-name = "VLCD+VMIPI_1.8V";
 					regulator-min-microvolt = <1800000>;
 					regulator-max-microvolt = <1800000>;
+					regulator-always-on;
 				};
 
 				ldo8_reg: LDO8 {
@@ -288,6 +289,7 @@
 					regulator-name = "VCC_3.0V_LCD";
 					regulator-min-microvolt = <3000000>;
 					regulator-max-microvolt = <3000000>;
+					regulator-always-on;
 				};
 
 				buck1_reg: BUCK1 {
@@ -345,6 +347,29 @@
 		};
 	};
 
+	fimd: fimd@11c00000 {
+		pinctrl-0 = <&lcd_clk>, <&lcd_data24>;
+		pinctrl-names = "default";
+		status = "okay";
+		display-timings {
+			timing {
+				clock-frequency = <23492370>;
+				hactive = <480>;
+				vactive = <800>;
+				hback-porch = <16>;
+				hfront-porch = <16>;
+				vback-porch = <2>;
+				vfront-porch = <28>;
+				hsync-len = <2>;
+				vsync-len = <1>;
+				hsync-active = <0>;
+				vsync-active = <0>;
+				de-active = <0>;
+				pixelclk-active = <0>;
+			};
+		};
+	};
+
 	pwm@139D0000 {
 		compatible = "samsung,s5p6440-pwm";
 		status = "okay";
Signature · 1 line
1.8.3.2
#8 lore raw

PATCH 7/9 drm/modes: add polarization handling to mode conversion

In reply to Andrzej Hajda

The patch adds conversion of DISPLAY_FLAGS_DE_* and DISPLAY_FLAGS_PIXDATA_* flags to pol_flags in drm_display_mode_from_videomode function.

---
 drivers/gpu/drm/drm_modes.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/drm_modes.c +11 -0
index b073315..5dbff8d 100644
@@ -537,6 +537,17 @@ int drm_display_mode_from_videomode(const struct videomode *vm,
 		dmode->flags |= DRM_MODE_FLAG_DBLSCAN;
 	if (vm->flags & DISPLAY_FLAGS_DOUBLECLK)
 		dmode->flags |= DRM_MODE_FLAG_DBLCLK;
+
+	dmode->pol_flags = 0;
+	if (vm->flags & DISPLAY_FLAGS_DE_LOW)
+		dmode->pol_flags |= DRM_MODE_FLAG_POL_DE_NEGEDGE;
+	if (vm->flags & DISPLAY_FLAGS_DE_HIGH)
+		dmode->pol_flags |= DRM_MODE_FLAG_POL_DE_POSEDGE;
+	if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
+		dmode->pol_flags |= DRM_MODE_FLAG_POL_PIXDATA_NEGEDGE;
+	if (vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE)
+		dmode->pol_flags |= DRM_MODE_FLAG_POL_PIXDATA_POSEDGE;
+
 	drm_mode_set_name(dmode);
 
 	return 0;
Signature · 1 line
1.8.3.2
#9 lore raw

PATCH 8/9 drm/exynos/fimd: use polarization flags provided by drm_display_mode

In reply to Andrzej Hajda

The patch replaces fimd private bindings for signal polarization by polarization flags provided by drm_display_mode.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +5 -7
index 15d6b37..dbfad4e 100644
@@ -115,7 +115,6 @@ struct fimd_context {
 	unsigned int			default_win;
 	unsigned long			irq_flags;
 	u32				vidcon0;
-	u32				vidcon1;
 	bool				suspended;
 	int				pipe;
 	wait_queue_head_t		wait_vsync_queue;
@@ -232,7 +231,11 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
 		return;
 
 	/* setup polarity values */
-	vidcon1 = ctx->vidcon1;
+	vidcon1 = 0;
+	if (mode->pol_flags & DRM_MODE_FLAG_POL_DE_NEGEDGE)
+		vidcon1 |= VIDCON1_INV_VDEN;
+	if (mode->pol_flags & DRM_MODE_FLAG_POL_PIXDATA_NEGEDGE)
+		vidcon1 |= VIDCON1_INV_VCLK;
 	if (mode->flags & DRM_MODE_FLAG_NVSYNC)
 		vidcon1 |= VIDCON1_INV_VSYNC;
 	if (mode->flags & DRM_MODE_FLAG_NHSYNC)
@@ -875,11 +878,6 @@ static int fimd_probe(struct platform_device *pdev)
 	ctx->dev = dev;
 	ctx->suspended = true;
 
-	if (of_property_read_bool(dev->of_node, "samsung,invert-vden"))
-		ctx->vidcon1 |= VIDCON1_INV_VDEN;
-	if (of_property_read_bool(dev->of_node, "samsung,invert-vclk"))
-		ctx->vidcon1 |= VIDCON1_INV_VCLK;
-
 	ctx->bus_clk = devm_clk_get(dev, "fimd");
 	if (IS_ERR(ctx->bus_clk)) {
 		dev_err(dev, "failed to get bus clock\n");
Signature · 1 line
1.8.3.2
maintainer
#10 lore raw

Re: [PATCH 8/9] drm/exynos/fimd: use polarization flags provided by drm_display_mode

Thanks for your contributions,

2014-03-17 19:27 GMT+09:00 Andrzej Hajda <[email protected]>:

Quoted 3 lines

The patch replaces fimd private bindings for signal polarization by polarization flags provided by drm_display_mode.

This patch needs below patch not merged yet,
drm: drm_display_mode: add signal polarity flags

So let me pick up all of your path series except for patch 7 and 8. And for these two patches, later.

Your opinion?

Thanks,
Inki Dae

Quoted 49 lines
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +5 -8
index 15d6b37..dbfad4e 100644
@@ -115,7 +115,6 @@ struct fimd_context {
        unsigned int                    default_win;
        unsigned long                   irq_flags;
        u32                             vidcon0;
-       u32                             vidcon1;
        bool                            suspended;
        int                             pipe;
        wait_queue_head_t               wait_vsync_queue;
@@ -232,7 +231,11 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
                return;
 
        /* setup polarity values */
-       vidcon1 = ctx->vidcon1;
+       vidcon1 = 0;
+       if (mode->pol_flags & DRM_MODE_FLAG_POL_DE_NEGEDGE)
+               vidcon1 |= VIDCON1_INV_VDEN;
+       if (mode->pol_flags & DRM_MODE_FLAG_POL_PIXDATA_NEGEDGE)
+               vidcon1 |= VIDCON1_INV_VCLK;
        if (mode->flags & DRM_MODE_FLAG_NVSYNC)
                vidcon1 |= VIDCON1_INV_VSYNC;
        if (mode->flags & DRM_MODE_FLAG_NHSYNC)
@@ -875,11 +878,6 @@ static int fimd_probe(struct platform_device *pdev)
        ctx->dev = dev;
        ctx->suspended = true;
 
-       if (of_property_read_bool(dev->of_node, "samsung,invert-vden"))
-               ctx->vidcon1 |= VIDCON1_INV_VDEN;
-       if (of_property_read_bool(dev->of_node, "samsung,invert-vclk"))
-               ctx->vidcon1 |= VIDCON1_INV_VCLK;
-
        ctx->bus_clk = devm_clk_get(dev, "fimd");
        if (IS_ERR(ctx->bus_clk)) {
                dev_err(dev, "failed to get bus clock\n");
--

1.8.3.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw

Re: [PATCH 8/9] drm/exynos/fimd: use polarization flags provided by drm_display_mode

Quoted 8 lines · Inki Dae

Thanks for your contributions,

2014-03-17 19:27 GMT+09:00 Andrzej Hajda <[email protected]>:

Quoted 3 lines

The patch replaces fimd private bindings for signal polarization by polarization flags provided by drm_display_mode.

Quoted 7 lines

This patch needs below patch not merged yet,
drm: drm_display_mode: add signal polarity flags

So let me pick up all of your path series except for patch 7 and 8. And for these two patches, later.

Your opinion?

Yes, please do it.

Regards
Andrzej

Quoted 53 lines

Thanks,
Inki Dae

Quoted 49 lines
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +5 -8
index 15d6b37..dbfad4e 100644
@@ -115,7 +115,6 @@ struct fimd_context {
        unsigned int                    default_win;
        unsigned long                   irq_flags;
        u32                             vidcon0;
-       u32                             vidcon1;
        bool                            suspended;
        int                             pipe;
        wait_queue_head_t               wait_vsync_queue;
@@ -232,7 +231,11 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
                return;
 
        /* setup polarity values */
-       vidcon1 = ctx->vidcon1;
+       vidcon1 = 0;
+       if (mode->pol_flags & DRM_MODE_FLAG_POL_DE_NEGEDGE)
+               vidcon1 |= VIDCON1_INV_VDEN;
+       if (mode->pol_flags & DRM_MODE_FLAG_POL_PIXDATA_NEGEDGE)
+               vidcon1 |= VIDCON1_INV_VCLK;
        if (mode->flags & DRM_MODE_FLAG_NVSYNC)
                vidcon1 |= VIDCON1_INV_VSYNC;
        if (mode->flags & DRM_MODE_FLAG_NHSYNC)
@@ -875,11 +878,6 @@ static int fimd_probe(struct platform_device *pdev)
        ctx->dev = dev;
        ctx->suspended = true;
 
-       if (of_property_read_bool(dev->of_node, "samsung,invert-vden"))
-               ctx->vidcon1 |= VIDCON1_INV_VDEN;
-       if (of_property_read_bool(dev->of_node, "samsung,invert-vclk"))
-               ctx->vidcon1 |= VIDCON1_INV_VCLK;
-
        ctx->bus_clk = devm_clk_get(dev, "fimd");
        if (IS_ERR(ctx->bus_clk)) {
                dev_err(dev, "failed to get bus clock\n");
--

1.8.3.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw

PATCH 1/1 ARM: dts: exynos4210-universal: add fimd polarization settings

In reply to Inki Dae

The patch adds polarization flags to fimd node. It fixes parallel display support.

---
Hi Inki,

Since polarization patches were not merged, polarization settings should be provided to fimd via properties. This patch fixes it.

Regards
Andrzej

---
 arch/arm/boot/dts/exynos4210-universal_c210.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/exynos4210-universal_c210.dts +2 -0
index 21ca0b978..477208d 100644
@@ -351,6 +351,8 @@
 		pinctrl-0 = <&lcd_clk>, <&lcd_data24>;
 		pinctrl-names = "default";
 		status = "okay";
+		samsung,invert-vden;
+		samsung,invert-vclk;
 		display-timings {
 			timing {
 				clock-frequency = <23492370>;
Signature · 1 line
1.8.3.2
maintainer
#13 lore raw

Re: [PATCH] ARM: dts: exynos4210-universal: add fimd polarization settings

Hi Andrzej,

2014-03-20 22:26 GMT+09:00 Andrzej Hajda <[email protected]>:

Quoted 11 lines

The patch adds polarization flags to fimd node. It fixes parallel display support.

---
Hi Inki,

Since polarization patches were not merged, polarization settings should be provided to fimd via properties. This patch fixes it.

Just let me integrate it to old one, 'ARM: dts: exynos4210-universal:
add exynos/fimd node'.

Thanks,
Inki Dae

Quoted 26 lines

Regards
Andrzej

---
 arch/arm/boot/dts/exynos4210-universal_c210.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/exynos4210-universal_c210.dts +2 -1
index 21ca0b978..477208d 100644
@@ -351,6 +351,8 @@
                pinctrl-0 = <&lcd_clk>, <&lcd_data24>;
                pinctrl-names = "default";
                status = "okay";
+               samsung,invert-vden;
+               samsung,invert-vclk;
                display-timings {
                        timing {
                                clock-frequency = <23492370>;
--

1.8.3.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): 1395052045-23848-1-git-send-email-a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org

#15 lore raw

PATCH 9/9 drm/exynos/fimd: remove unused variable

The patch removes unused vidcon0 field from fimd_context structure.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -3
index dbfad4e..375ec66 100644
@@ -114,7 +114,6 @@ struct fimd_context {
 	struct fimd_win_data		win_data[WINDOWS_NR];
 	unsigned int			default_win;
 	unsigned long			irq_flags;
-	u32				vidcon0;
 	bool				suspended;
 	int				pipe;
 	wait_queue_head_t		wait_vsync_queue;
@@ -270,8 +269,7 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
 	writel(val, ctx->regs + driver_data->timing_base + VIDTCON2);
 
 	/* setup clock source, clock divider, enable dma. */
-	val = ctx->vidcon0;
-	val &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR);
+	val = ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR);
 
 	if (ctx->driver_data->has_clksel) {
 		val &= ~VIDCON0_CLKSEL_MASK;
Signature · 6 lines
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#16 lore raw

PATCH v2 9/9 drm/exynos/fimd: remove unused variable

The patch removes unused vidcon0 field from fimd_context structure.

---
v2:
- corrected vidcon0 calculation

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +6 -14
index dbfad4e..158d53a 100644
@@ -114,7 +114,6 @@ struct fimd_context {
 	struct fimd_win_data		win_data[WINDOWS_NR];
 	unsigned int			default_win;
 	unsigned long			irq_flags;
-	u32				vidcon0;
 	bool				suspended;
 	int				pipe;
 	wait_queue_head_t		wait_vsync_queue;
@@ -269,26 +268,19 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
 	       VIDTCON2_HOZVAL_E(mode->hdisplay - 1);
 	writel(val, ctx->regs + driver_data->timing_base + VIDTCON2);
 
-	/* setup clock source, clock divider, enable dma. */
-	val = ctx->vidcon0;
-	val &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR);
+	/*
+	 * fields of register with prefix '_F' would be updated
+	 * at vsync(same as dma start)
+	 */
+	val = VIDCON0_ENVID | VIDCON0_ENVID_F;
 
-	if (ctx->driver_data->has_clksel) {
-		val &= ~VIDCON0_CLKSEL_MASK;
+	if (ctx->driver_data->has_clksel)
 		val |= VIDCON0_CLKSEL_LCD;
-	}
 
 	clkdiv = fimd_calc_clkdiv(ctx, mode);
 	if (clkdiv > 1)
 		val |= VIDCON0_CLKVAL_F(clkdiv - 1) | VIDCON0_CLKDIR;
-	else
-		val &= ~VIDCON0_CLKDIR;	/* 1:1 clock */
 
-	/*
-	 * fields of register with prefix '_F' would be updated
-	 * at vsync(same as dma start)
-	 */
-	val |= VIDCON0_ENVID | VIDCON0_ENVID_F;
 	writel(val, ctx->regs + VIDCON0);
 }
 
Signature · 1 line
1.8.3.2
Reviewed-by on the v1 series
#17 lore raw
In reply to Andrzej Hajda

Hi Andrzej,

Quoted 34 lines · Andrzej Hajda

Hi,

This patch set restores parallel display support removed during exynos refactorization. It is rebased on the latest exynos-drm-next branch plus patch adding polarization flags to drm_display_mode [1].

[1]: http://permalink.gmane.org/gmane.linux.drivers.driver-project.devel/47216

Regards
Andrzej

Andrzej Hajda (9):
drm/exynos: delay fbdev initialization until an output is connected drm/exynos: init kms poll after creation of connectors drm/exynos: correct timing porch conversion
exynos/fimd: add parallel output related bindings drm/exynos: restore parallel output interface support
ARM: dts: exynos4210-universal: add exynos/fimd node drm/modes: add polarization handling to mode conversion drm/exynos/fimd: use polarization flags provided by drm_display_mode drm/exynos/fimd: remove unused variable

  .../devicetree/bindings/video/samsung-fimd.txt     |  15 +
  arch/arm/boot/dts/exynos4210-universal_c210.dts    |  25 ++
  drivers/gpu/drm/drm_modes.c                        |  11 +
  drivers/gpu/drm/exynos/Kconfig                     |   8 +
  drivers/gpu/drm/exynos/Makefile                    |   1 +
  drivers/gpu/drm/exynos/exynos_drm_dpi.c            | 339 +++++++++++++++++++++
  drivers/gpu/drm/exynos/exynos_drm_drv.c            |  22 +-
  drivers/gpu/drm/exynos/exynos_drm_drv.h            |   8 +
  drivers/gpu/drm/exynos/exynos_drm_fb.c             |   3 +
  drivers/gpu/drm/exynos/exynos_drm_fimd.c           |  32 +-
  10 files changed, 432 insertions(+), 32 deletions(-)
Quoted 2 lines

create mode 100644 drivers/gpu/drm/exynos/exynos_drm_dpi.c

Including the V2 fixups sent for particular patches:

Will try to test on one of my boards with parallel displays soon.

Best regards,
Tomasz