Skip to contentSkip to conversation

drm/exynos: Support DP CLKCON register in FIMD driver

PATCH Superseded Ajay Kumar 4 participants 5 messages Jun 24, 2014 – Jun 25, 2014

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ajay Kumar

author
#0 lore raw

PATCH 1/1 drm/exynos: Support DP CLKCON register in FIMD driver

Add the missing setting for DP CLKCON register.

This register is present on Exynos5 based FIMD controllers, and needs to be used if we are using DP.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |    5 +++++
 include/video/samsung_fimd.h             |    4 ++++
 2 files changed, 9 insertions(+)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +5 -0
index 33161ad..5d3045d 100644
@@ -72,6 +72,7 @@ struct fimd_driver_data {
 	unsigned int has_shadowcon:1;
 	unsigned int has_clksel:1;
 	unsigned int has_limited_fmt:1;
+	unsigned int has_dp_clkcon:1;
 };
 
 static struct fimd_driver_data s3c64xx_fimd_driver_data = {
@@ -88,6 +89,7 @@ static struct fimd_driver_data exynos4_fimd_driver_data = {
 static struct fimd_driver_data exynos5_fimd_driver_data = {
 	.timing_base = 0x20000,
 	.has_shadowcon = 1,
+	.has_dp_clkcon = 1,
 };
 
 struct fimd_win_data {
@@ -331,6 +333,9 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
 	if (clkdiv > 1)
 		val |= VIDCON0_CLKVAL_F(clkdiv - 1) | VIDCON0_CLKDIR;
 
+	if (ctx->driver_data->has_dp_clkcon)
+		writel(DP_CLK_ENABLE, ctx->regs + DP_CLKCON);
+
 	writel(val, ctx->regs + VIDCON0);
 }
 
include/video/samsung_fimd.h +4 -0
index b039320..d8f4b0b 100644
@@ -435,6 +435,10 @@
 #define BLENDCON_NEW_8BIT_ALPHA_VALUE		(1 << 0)
 #define BLENDCON_NEW_4BIT_ALPHA_VALUE		(0 << 0)
 
+/* Video clock enable for DP */
+#define DP_CLKCON				0x27C
+#define DP_CLK_ENABLE				0x2
+
 /* Notes on per-window bpp settings
  *
  * Value	Win0	 Win1	  Win2	   Win3	    Win 4
Signature · 1 line
1.7.9.5
#1 lore raw

Hi Ajay,

Quoted 32 lines · Ajay Kumar

Add the missing setting for DP CLKCON register.

This register is present on Exynos5 based FIMD controllers, and needs to be used if we are using DP.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |    5 +++++
 include/video/samsung_fimd.h             |    4 ++++
 2 files changed, 9 insertions(+)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -0
index 33161ad..5d3045d 100644
@@ -72,6 +72,7 @@ struct fimd_driver_data {
 	unsigned int has_shadowcon:1;
 	unsigned int has_clksel:1;
 	unsigned int has_limited_fmt:1;
+	unsigned int has_dp_clkcon:1;
 };
 
 static struct fimd_driver_data s3c64xx_fimd_driver_data = {
@@ -88,6 +89,7 @@ static struct fimd_driver_data exynos4_fimd_driver_data = {
 static struct fimd_driver_data exynos5_fimd_driver_data = {
 	.timing_base = 0x20000,
 	.has_shadowcon = 1,
+	.has_dp_clkcon = 1,
 };
 
 struct fimd_win_data {

drivers/gpu/drm/exynos/exynos_drm_fimd.c static void fimd_commit(struct exynos_drm_manager *mgr) · line 338

Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +3 -0
@@ -331,6 +333,9 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
 	if (clkdiv > 1)
 		val |= VIDCON0_CLKVAL_F(clkdiv - 1) | VIDCON0_CLKDIR;
 
+	if (ctx->driver_data->has_dp_clkcon)
+		writel(DP_CLK_ENABLE, ctx->regs + DP_CLKCON);
+

This code always enables the clock on exynos5. As I understand it should be enabled only if DP is used.

Regards
Andrzej

Quoted 19 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -0
 	writel(val, ctx->regs + VIDCON0);
 }
 
include/video/samsung_fimd.h +4 -0
index b039320..d8f4b0b 100644
@@ -435,6 +435,10 @@
 #define BLENDCON_NEW_8BIT_ALPHA_VALUE		(1 << 0)
 #define BLENDCON_NEW_4BIT_ALPHA_VALUE		(0 << 0)
 
+/* Video clock enable for DP */
+#define DP_CLKCON				0x27C
+#define DP_CLK_ENABLE				0x2
+
 /* Notes on per-window bpp settings
  *
  * Value	Win0	 Win1	  Win2	   Win3	    Win 4
#2 lore raw
Quoted 38 lines · Andrzej Hajda

Hi Ajay,

Quoted 35 lines · Ajay Kumar

Add the missing setting for DP CLKCON register.

This register is present on Exynos5 based FIMD controllers, and needs to be used if we are using DP.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |    5 +++++
 include/video/samsung_fimd.h             |    4 ++++
 2 files changed, 9 insertions(+)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -0
index 33161ad..5d3045d 100644
@@ -72,6 +72,7 @@ struct fimd_driver_data {
      unsigned int has_shadowcon:1;
      unsigned int has_clksel:1;
      unsigned int has_limited_fmt:1;
+     unsigned int has_dp_clkcon:1;
 };
 
 static struct fimd_driver_data s3c64xx_fimd_driver_data = {
@@ -88,6 +89,7 @@ static struct fimd_driver_data exynos4_fimd_driver_data = {
 static struct fimd_driver_data exynos5_fimd_driver_data = {
      .timing_base = 0x20000,
      .has_shadowcon = 1,
+     .has_dp_clkcon = 1,
 };
 
 struct fimd_win_data {
@@ -331,6 +333,9 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
      if (clkdiv > 1)
              val |= VIDCON0_CLKVAL_F(clkdiv - 1) | VIDCON0_CLKDIR;
 
Quoted 6 lines

drivers/gpu/drm/exynos/exynos_drm_fimd.c static void fimd_commit(struct exynos_drm_manager *mgr) · line 338

Quoted 3 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +3 -0
+     if (ctx->driver_data->has_dp_clkcon)
+             writel(DP_CLK_ENABLE, ctx->regs + DP_CLKCON);
+

This code always enables the clock on exynos5. As I understand it should be enabled only if DP is used.

Right!
But, when I searched for the display interface,
only exynos4 based boards use MIPI/DPI, and all exynos5 based boards use DP. So, I thought adding this in driver_data for exynos5 should be fine.

Inki/Andrej - Shall I add it as an optional DT property?

Ajay

Quoted 22 lines
Quoted 21 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -0
      writel(val, ctx->regs + VIDCON0);
 }
 
include/video/samsung_fimd.h +4 -0
index b039320..d8f4b0b 100644
@@ -435,6 +435,10 @@
 #define BLENDCON_NEW_8BIT_ALPHA_VALUE                (1 << 0)
 #define BLENDCON_NEW_4BIT_ALPHA_VALUE                (0 << 0)
 
+/* Video clock enable for DP */
+#define DP_CLKCON                            0x27C
+#define DP_CLK_ENABLE                                0x2
+
 /* Notes on per-window bpp settings
  *
  * Value     Win0     Win1     Win2     Win3     Win 4
#3 lore raw
Quoted 44 lines · Ajay kumar
Quoted 38 lines · Andrzej Hajda

Hi Ajay,

Quoted 35 lines · Ajay Kumar

Add the missing setting for DP CLKCON register.

This register is present on Exynos5 based FIMD controllers, and needs to be used if we are using DP.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |    5 +++++
 include/video/samsung_fimd.h             |    4 ++++
 2 files changed, 9 insertions(+)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -0
index 33161ad..5d3045d 100644
@@ -72,6 +72,7 @@ struct fimd_driver_data {
      unsigned int has_shadowcon:1;
      unsigned int has_clksel:1;
      unsigned int has_limited_fmt:1;
+     unsigned int has_dp_clkcon:1;
 };
 
 static struct fimd_driver_data s3c64xx_fimd_driver_data = {
@@ -88,6 +89,7 @@ static struct fimd_driver_data exynos4_fimd_driver_data = {
 static struct fimd_driver_data exynos5_fimd_driver_data = {
      .timing_base = 0x20000,
      .has_shadowcon = 1,
+     .has_dp_clkcon = 1,
 };
 
 struct fimd_win_data {
@@ -331,6 +333,9 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
      if (clkdiv > 1)
              val |= VIDCON0_CLKVAL_F(clkdiv - 1) | VIDCON0_CLKDIR;
 
Quoted 5 lines

drivers/gpu/drm/exynos/exynos_drm_fimd.c static void fimd_commit(struct exynos_drm_manager *mgr) · line 338

Quoted 3 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +3 -0
+     if (ctx->driver_data->has_dp_clkcon)
+             writel(DP_CLK_ENABLE, ctx->regs + DP_CLKCON);
+

This code always enables the clock on exynos5. As I understand it should be enabled only if DP is used.

Quoted 4 lines

Right!
But, when I searched for the display interface,
only exynos4 based boards use MIPI/DPI, and all exynos5 based boards use DP. So, I thought adding this in driver_data for exynos5 should be fine.

Arndale and Arndale-Octa have MIPI/DSI interface with MIPI/LVDS bridge.

Quoted 2 lines

Inki/Andrej - Shall I add it as an optional DT property?

No, property is redundant. The simplest solution could be to use CONFIG_DRM_EXYNOS_DP
macro but it is quite ugly.
I guess extending little bit exynos_drm framework to allow detection of DP in fimd would be better.

Regards
Andrzej

Quoted 22 lines

Ajay

Quoted 20 lines
Quoted 20 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -0
      writel(val, ctx->regs + VIDCON0);
 }
 
include/video/samsung_fimd.h +4 -0
index b039320..d8f4b0b 100644
@@ -435,6 +435,10 @@
 #define BLENDCON_NEW_8BIT_ALPHA_VALUE                (1 << 0)
 #define BLENDCON_NEW_4BIT_ALPHA_VALUE                (0 << 0)
 
+/* Video clock enable for DP */
+#define DP_CLKCON                            0x27C
+#define DP_CLK_ENABLE                                0x2
+
 /* Notes on per-window bpp settings
  *
  * Value     Win0     Win1     Win2     Win3     Win 4
#4 lore raw
Quoted 45 lines · Andrzej Hajda
Quoted 44 lines · Ajay kumar
Quoted 43 lines · Andrzej Hajda

Hi Ajay,

Quoted 32 lines · Ajay Kumar

Add the missing setting for DP CLKCON register.

This register is present on Exynos5 based FIMD controllers, and needs to be used if we are using DP.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |    5 +++++
 include/video/samsung_fimd.h             |    4 ++++
 2 files changed, 9 insertions(+)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -0
index 33161ad..5d3045d 100644
@@ -72,6 +72,7 @@ struct fimd_driver_data {
      unsigned int has_shadowcon:1;
      unsigned int has_clksel:1;
      unsigned int has_limited_fmt:1;
+     unsigned int has_dp_clkcon:1;
 };
 
 static struct fimd_driver_data s3c64xx_fimd_driver_data = {
@@ -88,6 +89,7 @@ static struct fimd_driver_data exynos4_fimd_driver_data = {
 static struct fimd_driver_data exynos5_fimd_driver_data = {
      .timing_base = 0x20000,
      .has_shadowcon = 1,
+     .has_dp_clkcon = 1,
 };
 
 struct fimd_win_data {

drivers/gpu/drm/exynos/exynos_drm_fimd.c static void fimd_commit(struct exynos_drm_manager *mgr) · line 338

Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +3 -0
@@ -331,6 +333,9 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
      if (clkdiv > 1)
              val |= VIDCON0_CLKVAL_F(clkdiv - 1) | VIDCON0_CLKDIR;
 
+     if (ctx->driver_data->has_dp_clkcon)
+             writel(DP_CLK_ENABLE, ctx->regs + DP_CLKCON);
+

This code always enables the clock on exynos5. As I understand it should be enabled only if DP is used.

Quoted 4 lines
Quoted 4 lines

Right!
But, when I searched for the display interface,
only exynos4 based boards use MIPI/DPI, and all exynos5 based boards use DP. So, I thought adding this in driver_data for exynos5 should be fine.

No, it should be selectable. Even some exynos5 based boards use MIPI LCD.

Quoted 9 lines

Arndale and Arndale-Octa have MIPI/DSI interface with MIPI/LVDS bridge.

Quoted 2 lines

Inki/Andrej - Shall I add it as an optional DT property?

No, property is redundant. The simplest solution could be to use CONFIG_DRM_EXYNOS_DP
macro but it is quite ugly.

Right, CONFIG_DRM_EXYNOS_DP is the simplest. But, the macro doesn't look good.

Quoted 2 lines

I guess extending little bit exynos_drm framework to allow detection of DP in fimd would be better.

I agree on Andrzej's opinion.

Best regards,
Jingoo Han

Quoted 26 lines

Regards
Andrzej

Quoted 22 lines

Ajay

Quoted 20 lines
Quoted 20 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -0
      writel(val, ctx->regs + VIDCON0);
 }
 
include/video/samsung_fimd.h +4 -0
index b039320..d8f4b0b 100644
@@ -435,6 +435,10 @@
 #define BLENDCON_NEW_8BIT_ALPHA_VALUE                (1 << 0)
 #define BLENDCON_NEW_4BIT_ALPHA_VALUE                (0 << 0)
 
+/* Video clock enable for DP */
+#define DP_CLKCON                            0x27C
+#define DP_CLK_ENABLE                                0x2
+
 /* Notes on per-window bpp settings
  *
  * Value     Win0     Win1     Win2     Win3     Win 4