Skip to contentSkip to conversation

Broxton DSI dual-link and sequence fixes

PATCH In review Vidya Srinivas 5 participants 31 messages Feb 8, 2017 – Feb 21, 2017

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

cover Broxton DSI dual-link and sequence fixes

This patch series enables Broxton DSI dual-link support. This also fixes sequence issues and resolves split screen and suspend/resume issues.

Uma Shankar (9):
drm/i915: Check for platform specific GPIO config drm/i915: Fix PLL 8x/3 divider for MIPI video mode
drm: Add DSI panel power on/off sequence programming drm/i915: Add DSI panel power on/off sequence callbacks drm/i915/bxt: Fix BXT DSI ULPS sequence drm/i915/bxt: Fix BXT DSI disable sequence drm/i915/bxt: Disable device ready before shutdown command drm/i915/bxt: Enable BXT DSI dual link drm/i915/bxt: Fix the DSI enable sequence

 drivers/gpu/drm/i915/i915_reg.h            |   5 ++
 drivers/gpu/drm/i915/intel_dsi.c           | 105 ++++++++++++++++++++---------
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c |  18 ++++-
 drivers/gpu/drm/i915/intel_dsi_pll.c       |   6 +-
 include/drm/drm_panel.h                    |  18 +++++
 5 files changed, 112 insertions(+), 40 deletions(-)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/9 drm/i915: Check for platform specific GPIO config

From: Uma Shankar <[email protected]>

Panel GPIO control should be done based on platform. Add a check to restrict VLV and CHT specific GPIO confirguration, so that they dont apply to other platforms.

---
 drivers/gpu/drm/i915/intel_dsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dsi.c +2 -1
index c98234e..c297ea9 100644
@@ -1584,7 +1584,8 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
 	 * In case of BYT with CRC PMIC, we need to use GPIO for
 	 * Panel control.
 	 */
-	if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
+	if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
+		(dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC)) {
 		intel_dsi->gpio_panel =
 			gpiod_get(dev->dev, "panel", GPIOD_OUT_HIGH);
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/9
#2 lore raw

Re: [PATCH 1/9] drm/i915: Check for platform specific GPIO config

Quoted 17 lines · On Wed, 8 Feb 2017 16:20:50 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Panel GPIO control should be done based on platform. Add a check to restrict VLV and CHT specific GPIO confirguration, so that they dont apply to other platforms.

---
 drivers/gpu/drm/i915/intel_dsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dsi.c +0 -0
index c98234e..c297ea9 100644

drivers/gpu/drm/i915/intel_dsi.c void intel_dsi_init(struct drm_i915_private *dev_priv) · line 1591

Quoted 9 lines
drivers/gpu/drm/i915/intel_dsi.c +2 -1
@@ -1584,7 +1584,8 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
 	 * In case of BYT with CRC PMIC, we need to use GPIO for
 	 * Panel control.
 	 */
-	if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
+	if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
+		(dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC)) {
 		intel_dsi->gpio_panel =
 			gpiod_get(dev->dev, "panel", GPIOD_OUT_HIGH);
 

It makes sense to restrict this as it isn't valid for other platforms as written. But is there something similar for other platforms that we should set up here?

Since it makes sense to limit this today..

Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 2/9 drm/i915: Fix PLL 8x/3 divider for MIPI video mode

In reply to Vidya Srinivas

From: Uma Shankar <[email protected]>

MIPI Video Mode for high res panels (requiring dual link), need a 8X/3 divider to be programmed as 0x2. Modifying the same in this patch.

---
 drivers/gpu/drm/i915/intel_dsi_pll.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_dsi_pll.c +1 -5
index 61440e5..3a73086 100644
@@ -416,11 +416,7 @@ static void bxt_dsi_program_clocks(struct drm_device *dev, enum port port,
 	rx_div_lower = rx_div & RX_DIVIDER_BIT_1_2;
 	rx_div_upper = (rx_div & RX_DIVIDER_BIT_3_4) >> 2;
 
-	/* As per bpsec program the 8/3X clock divider to the below value */
-	if (dev_priv->vbt.dsi.config->is_cmd_mode)
-		mipi_8by3_divider = 0x2;
-	else
-		mipi_8by3_divider = 0x3;
+	mipi_8by3_divider = 0x2;
 
 	tmp |= BXT_MIPI_8X_BY3_DIVIDER(port, mipi_8by3_divider);
 	tmp |= BXT_MIPI_TX_ESCLK_DIVIDER(port, tx_div);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [PATCH 2/9] drm/i915: Fix PLL 8x/3 divider for MIPI video mode

Quoted 8 lines · Vidya Srinivas

From: Uma Shankar <[email protected]>

MIPI Video Mode for high res panels (requiring dual link), need a 8X/3 divider to be programmed as 0x2. Modifying the same in this patch.

Pushed the first two patches to drm-intel-next-queued, thanks for the patches.

BR,
Jani.

Quoted 21 lines
---
 drivers/gpu/drm/i915/intel_dsi_pll.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_dsi_pll.c +1 -5
index 61440e5..3a73086 100644
@@ -416,11 +416,7 @@ static void bxt_dsi_program_clocks(struct drm_device *dev, enum port port,
 	rx_div_lower = rx_div & RX_DIVIDER_BIT_1_2;
 	rx_div_upper = (rx_div & RX_DIVIDER_BIT_3_4) >> 2;
 
-	/* As per bpsec program the 8/3X clock divider to the below value */
-	if (dev_priv->vbt.dsi.config->is_cmd_mode)
-		mipi_8by3_divider = 0x2;
-	else
-		mipi_8by3_divider = 0x3;
+	mipi_8by3_divider = 0x2;
 
 	tmp |= BXT_MIPI_8X_BY3_DIVIDER(port, mipi_8by3_divider);
 	tmp |= BXT_MIPI_TX_ESCLK_DIVIDER(port, tx_div);
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

PATCH 3/9 drm: Add DSI panel power on/off sequence programming

In reply to Vidya Srinivas

From: Uma Shankar <[email protected]>

Panel Power On/Off sequences are part of Panel spec. Enabling the support of same in DRM layer for fine grained panel control. Some DSI controller/panels require making SOC specific device ready changes in between the panel power ON and sending the OTP sequences.

This patch introduces drm_panel_power_on which can be used to decouple panel power ON and OTP. Earlier both operations were being done as part of drm_panel_prepare.

---
 include/drm/drm_panel.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
include/drm/drm_panel.h +18 -0
index 220d1e2b..515595b 100644
@@ -69,6 +69,8 @@ struct drm_panel_funcs {
 	int (*disable)(struct drm_panel *panel);
 	int (*unprepare)(struct drm_panel *panel);
 	int (*prepare)(struct drm_panel *panel);
+	int (*power_on)(struct drm_panel *panel);
+	int (*power_off)(struct drm_panel *panel);
 	int (*enable)(struct drm_panel *panel);
 	int (*get_modes)(struct drm_panel *panel);
 	int (*get_timings)(struct drm_panel *panel, unsigned int num_timings,
@@ -166,6 +168,22 @@ static inline int drm_panel_enable(struct drm_panel *panel)
 	return panel ? -ENOSYS : -EINVAL;
 }
 
+static inline int drm_panel_power_on(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->power_on)
+		return panel->funcs->power_on(panel);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
+static inline int drm_panel_power_off(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->power_off)
+		return panel->funcs->power_off(panel);
+
+	return panel ? -ENOSYS : -EINVAL;
+}
+
 /**
  * drm_panel_get_modes - probe the available display modes of a panel
  * @panel: DRM panel
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH 4/9 drm/i915: Add DSI panel power on/off sequence callbacks

In reply to Vidya Srinivas

From: Uma Shankar <[email protected]>

Panel Power On/Off sequences are part of Panel spec. These are present in VBT v3 of the Intel VBT spec. Some DSI controller/panels require making SOC specific device ready changes in between the panel power ON and sending the OTP sequences.

This patch introduces panel power on callbacks to decouple panel power ON and OTP.

---
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +14 -0
index 8f683b8..4279279 100644
@@ -547,10 +547,24 @@ static int vbt_panel_get_modes(struct drm_panel *panel)
 	return 1;
 }
 
+static int vbt_panel_power_on(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_POWER_ON);
+	return 0;
+}
+
+static int vbt_panel_power_off(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_POWER_OFF);
+	return 0;
+}
+
 static const struct drm_panel_funcs vbt_panel_funcs = {
 	.disable = vbt_panel_disable,
 	.unprepare = vbt_panel_unprepare,
 	.prepare = vbt_panel_prepare,
+	.power_on = vbt_panel_power_on,
+	.power_off = vbt_panel_power_off,
 	.enable = vbt_panel_enable,
 	.get_modes = vbt_panel_get_modes,
 };
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

Re: [PATCH 4/9] drm/i915: Add DSI panel power on/off sequence callbacks

Quoted 8 lines · On Wed, 8 Feb 2017 16:20:53 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Panel Power On/Off sequences are part of Panel spec. These are present in VBT v3 of the Intel VBT spec. Some DSI controller/panels require making SOC specific device ready changes in between the panel power ON and sending the OTP sequences.

Quoted 5 lines

This patch introduces panel power on callbacks to decouple panel power ON and OTP.

Based on some conversation with Jani, we probably don't want to expand the use of the drm_panel interfaces but instead move to an i915 only panel interface. This would allow us to have more granular control over the sequences.

But since this is actually adding new drm_panel interfaces,

Quoted 33 lines
---
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +14 -0
index 8f683b8..4279279 100644
@@ -547,10 +547,24 @@ static int vbt_panel_get_modes(struct drm_panel *panel)
 	return 1;
 }
 
+static int vbt_panel_power_on(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_POWER_ON);
+	return 0;
+}
+
+static int vbt_panel_power_off(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_POWER_OFF);
+	return 0;
+}
+
 static const struct drm_panel_funcs vbt_panel_funcs = {
 	.disable = vbt_panel_disable,
 	.unprepare = vbt_panel_unprepare,
 	.prepare = vbt_panel_prepare,
+	.power_on = vbt_panel_power_on,
+	.power_off = vbt_panel_power_off,
 	.enable = vbt_panel_enable,
 	.get_modes = vbt_panel_get_modes,
 };
Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

PATCH 5/9 drm/i915/bxt: Fix BXT DSI ULPS sequence

In reply to Vidya Srinivas

From: Uma Shankar <[email protected]>

Fix the Sequence to program BXT DSI Latch and ULPS.

---
 drivers/gpu/drm/i915/intel_dsi.c | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_dsi.c +5 -18
index c297ea9..538755b 100644
@@ -366,32 +366,19 @@ static void bxt_dsi_device_ready(struct intel_encoder *encoder)
 
 	DRM_DEBUG_KMS("\n");
 
-	/* Exit Low power state in 4 steps*/
+	/* Enable MIPI PHY transparent latch */
 	for_each_dsi_port(port, intel_dsi->ports) {
-
-		/* 1. Enable MIPI PHY transparent latch */
 		val = I915_READ(BXT_MIPI_PORT_CTRL(port));
 		I915_WRITE(BXT_MIPI_PORT_CTRL(port), val | LP_OUTPUT_HOLD);
 		usleep_range(2000, 2500);
+	}
 
-		/* 2. Enter ULPS */
-		val = I915_READ(MIPI_DEVICE_READY(port));
-		val &= ~ULPS_STATE_MASK;
-		val |= (ULPS_STATE_ENTER | DEVICE_READY);
-		I915_WRITE(MIPI_DEVICE_READY(port), val);
-		/* at least 2us - relaxed for hrtimer subsystem optimization */
-		usleep_range(10, 50);
-
-		/* 3. Exit ULPS */
+	/* Clear ULPS and set device ready */
+	for_each_dsi_port(port, intel_dsi->ports) {
 		val = I915_READ(MIPI_DEVICE_READY(port));
 		val &= ~ULPS_STATE_MASK;
-		val |= (ULPS_STATE_EXIT | DEVICE_READY);
 		I915_WRITE(MIPI_DEVICE_READY(port), val);
-		usleep_range(1000, 1500);
-
-		/* Clear ULPS and set device ready */
-		val = I915_READ(MIPI_DEVICE_READY(port));
-		val &= ~ULPS_STATE_MASK;
+		usleep_range(2000, 2500);
 		val |= DEVICE_READY;
 		I915_WRITE(MIPI_DEVICE_READY(port), val);
 	}
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 5/9
#9 lore raw

Re: [PATCH 5/9] drm/i915/bxt: Fix BXT DSI ULPS sequence

Quoted 6 lines · On Wed, 8 Feb 2017 16:20:54 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Fix the Sequence to program BXT DSI Latch and ULPS.

Quoted 46 lines
---
 drivers/gpu/drm/i915/intel_dsi.c | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_dsi.c +5 -18
index c297ea9..538755b 100644
@@ -366,32 +366,19 @@ static void bxt_dsi_device_ready(struct intel_encoder *encoder)
 
 	DRM_DEBUG_KMS("\n");
 
-	/* Exit Low power state in 4 steps*/
+	/* Enable MIPI PHY transparent latch */
 	for_each_dsi_port(port, intel_dsi->ports) {
-
-		/* 1. Enable MIPI PHY transparent latch */
 		val = I915_READ(BXT_MIPI_PORT_CTRL(port));
 		I915_WRITE(BXT_MIPI_PORT_CTRL(port), val | LP_OUTPUT_HOLD);
 		usleep_range(2000, 2500);
+	}
 
-		/* 2. Enter ULPS */
-		val = I915_READ(MIPI_DEVICE_READY(port));
-		val &= ~ULPS_STATE_MASK;
-		val |= (ULPS_STATE_ENTER | DEVICE_READY);
-		I915_WRITE(MIPI_DEVICE_READY(port), val);
-		/* at least 2us - relaxed for hrtimer subsystem optimization */
-		usleep_range(10, 50);
-
-		/* 3. Exit ULPS */
+	/* Clear ULPS and set device ready */
+	for_each_dsi_port(port, intel_dsi->ports) {
 		val = I915_READ(MIPI_DEVICE_READY(port));
 		val &= ~ULPS_STATE_MASK;
-		val |= (ULPS_STATE_EXIT | DEVICE_READY);
 		I915_WRITE(MIPI_DEVICE_READY(port), val);
-		usleep_range(1000, 1500);
-
-		/* Clear ULPS and set device ready */
-		val = I915_READ(MIPI_DEVICE_READY(port));
-		val &= ~ULPS_STATE_MASK;
+		usleep_range(2000, 2500);
 		val |= DEVICE_READY;
 		I915_WRITE(MIPI_DEVICE_READY(port), val);
 	}
Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

Re: [PATCH 5/9] drm/i915/bxt: Fix BXT DSI ULPS sequence

Quoted 11 lines · Bob Paauwe
Quoted 6 lines · On Wed, 8 Feb 2017 16:20:54 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Fix the Sequence to program BXT DSI Latch and ULPS.

Pushed this one patch to dinq, thanks for the patch and review.

BR,
Jani.

Quoted 47 lines
Quoted 47 lines
---
 drivers/gpu/drm/i915/intel_dsi.c | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_dsi.c +5 -18
index c297ea9..538755b 100644
@@ -366,32 +366,19 @@ static void bxt_dsi_device_ready(struct intel_encoder *encoder)
 
 	DRM_DEBUG_KMS("\n");
 
-	/* Exit Low power state in 4 steps*/
+	/* Enable MIPI PHY transparent latch */
 	for_each_dsi_port(port, intel_dsi->ports) {
-
-		/* 1. Enable MIPI PHY transparent latch */
 		val = I915_READ(BXT_MIPI_PORT_CTRL(port));
 		I915_WRITE(BXT_MIPI_PORT_CTRL(port), val | LP_OUTPUT_HOLD);
 		usleep_range(2000, 2500);
+	}
 
-		/* 2. Enter ULPS */
-		val = I915_READ(MIPI_DEVICE_READY(port));
-		val &= ~ULPS_STATE_MASK;
-		val |= (ULPS_STATE_ENTER | DEVICE_READY);
-		I915_WRITE(MIPI_DEVICE_READY(port), val);
-		/* at least 2us - relaxed for hrtimer subsystem optimization */
-		usleep_range(10, 50);
-
-		/* 3. Exit ULPS */
+	/* Clear ULPS and set device ready */
+	for_each_dsi_port(port, intel_dsi->ports) {
 		val = I915_READ(MIPI_DEVICE_READY(port));
 		val &= ~ULPS_STATE_MASK;
-		val |= (ULPS_STATE_EXIT | DEVICE_READY);
 		I915_WRITE(MIPI_DEVICE_READY(port), val);
-		usleep_range(1000, 1500);
-
-		/* Clear ULPS and set device ready */
-		val = I915_READ(MIPI_DEVICE_READY(port));
-		val &= ~ULPS_STATE_MASK;
+		usleep_range(2000, 2500);
 		val |= DEVICE_READY;
 		I915_WRITE(MIPI_DEVICE_READY(port), val);
 	}
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw

PATCH 6/9 drm/i915/bxt: Fix BXT DSI disable sequence

In reply to Vidya Srinivas

From: Uma Shankar <[email protected]>

Fix BXT DSI disable sequence as per latest updates in BSpec.

---
 drivers/gpu/drm/i915/intel_dsi.c | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_dsi.c +25 -4
index 538755b..808158f 100644
@@ -632,8 +632,10 @@ static void intel_dsi_disable(struct intel_encoder *encoder)
 		for_each_dsi_port(port, intel_dsi->ports)
 			wait_for_dsi_fifo_empty(intel_dsi, port);
 
-		intel_dsi_port_disable(encoder);
-		msleep(2);
+		if (!IS_BROXTON(dev_priv)) {
+			intel_dsi_port_disable(encoder);
+			usleep_range(2000, 2500);
+		}
 	}
 
 	for_each_dsi_port(port, intel_dsi->ports) {
@@ -641,7 +643,11 @@ static void intel_dsi_disable(struct intel_encoder *encoder)
 		I915_WRITE(MIPI_DEVICE_READY(port), 0x0);
 
 		intel_dsi_reset_clocks(encoder, port);
-		I915_WRITE(MIPI_EOT_DISABLE(port), CLOCKSTOP);
+		temp = 0;
+		if (intel_dsi->clock_stop) {
+			temp |= CLOCKSTOP;
+			I915_WRITE(MIPI_EOT_DISABLE(port), temp);
+		}
 
 		temp = I915_READ(MIPI_DSI_FUNC_PRG(port));
 		temp &= ~VID_MODE_FORMAT_MASK;
@@ -707,12 +713,25 @@ static void intel_dsi_post_disable(struct intel_encoder *encoder,
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
 	u32 val;
+	enum port port;
 
 	DRM_DEBUG_KMS("\n");
 
 	intel_dsi_disable(encoder);
 
-	intel_dsi_clear_device_ready(encoder);
+	if (IS_BROXTON(dev_priv)) {
+		/*
+		 * Reset the DSI Device ready first for both ports
+		 * and then port control registers for both ports
+		 */
+		for_each_dsi_port(port, intel_dsi->ports)
+			I915_WRITE(MIPI_DEVICE_READY(port), 0);
+
+		for_each_dsi_port(port, intel_dsi->ports)
+			I915_WRITE(BXT_MIPI_PORT_CTRL(port), 0);
+	} else {
+		intel_dsi_clear_device_ready(encoder);
+	}
 
 	if (IS_BROXTON(dev_priv)) {
 		/* Power down DSI regulator to save power */
@@ -737,6 +756,8 @@ static void intel_dsi_post_disable(struct intel_encoder *encoder,
 
 	drm_panel_unprepare(intel_dsi->panel);
 
+	/* Disable Panel */
+	drm_panel_power_off(intel_dsi->panel);
 	msleep(intel_dsi->panel_off_delay);
 
 	/* Panel Disable over CRC PMIC */
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw

Re: [PATCH 6/9] drm/i915/bxt: Fix BXT DSI disable sequence

Quoted 28 lines · On Wed, 8 Feb 2017 16:20:55 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Fix BXT DSI disable sequence as per latest updates in BSpec.

---
 drivers/gpu/drm/i915/intel_dsi.c | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_dsi.c +4 -2
index 538755b..808158f 100644
@@ -632,8 +632,10 @@ static void intel_dsi_disable(struct intel_encoder *encoder)
 		for_each_dsi_port(port, intel_dsi->ports)
 			wait_for_dsi_fifo_empty(intel_dsi, port);
 
-		intel_dsi_port_disable(encoder);
-		msleep(2);
+		if (!IS_BROXTON(dev_priv)) {
+			intel_dsi_port_disable(encoder);
+			usleep_range(2000, 2500);
+		}
 	}
 
 	for_each_dsi_port(port, intel_dsi->ports) {

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_disable(struct intel_encoder *encoder) · line 650

Quoted 9 lines
drivers/gpu/drm/i915/intel_dsi.c +5 -1
@@ -641,7 +643,11 @@ static void intel_dsi_disable(struct intel_encoder *encoder)
 		I915_WRITE(MIPI_DEVICE_READY(port), 0x0);
 
 		intel_dsi_reset_clocks(encoder, port);
-		I915_WRITE(MIPI_EOT_DISABLE(port), CLOCKSTOP);
+		temp = 0;
+		if (intel_dsi->clock_stop) {
+			temp |= CLOCKSTOP;
+			I915_WRITE(MIPI_EOT_DISABLE(port), temp);
+		}

This could be simplified to just

		if (intel_dsi->clock_stop)
			I915_WRITE(MIPI_EOT_DISABLE(port), CLOCKSTOP);
Quoted 31 lines
drivers/gpu/drm/i915/intel_dsi.c +14 -1
 		temp = I915_READ(MIPI_DSI_FUNC_PRG(port));
 		temp &= ~VID_MODE_FORMAT_MASK;
@@ -707,12 +713,25 @@ static void intel_dsi_post_disable(struct intel_encoder *encoder,
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
 	u32 val;
+	enum port port;
 
 	DRM_DEBUG_KMS("\n");
 
 	intel_dsi_disable(encoder);
 
-	intel_dsi_clear_device_ready(encoder);
+	if (IS_BROXTON(dev_priv)) {
+		/*
+		 * Reset the DSI Device ready first for both ports
+		 * and then port control registers for both ports
+		 */
+		for_each_dsi_port(port, intel_dsi->ports)
+			I915_WRITE(MIPI_DEVICE_READY(port), 0);
+
+		for_each_dsi_port(port, intel_dsi->ports)
+			I915_WRITE(BXT_MIPI_PORT_CTRL(port), 0);
+	} else {
+		intel_dsi_clear_device_ready(encoder);
+	}
 
 	if (IS_BROXTON(dev_priv)) {
 		/* Power down DSI regulator to save power */

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_post_disable(struct intel_encoder *encoder, · line 760

Quoted 5 lines
drivers/gpu/drm/i915/intel_dsi.c +2 -0
@@ -737,6 +756,8 @@ static void intel_dsi_post_disable(struct intel_encoder *encoder,
 
 	drm_panel_unprepare(intel_dsi->panel);
 
+	/* Disable Panel */
+	drm_panel_power_off(intel_dsi->panel);

This depends on the previous patch, which I don't think is the direction we want to go. If the code is reworked to not use the drm_panel interface, then this would need to change also.

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_post_disable(struct intel_encoder *encoder, · line 762

Quoted 2 lines
drivers/gpu/drm/i915/intel_dsi.c +0 -0
 	msleep(intel_dsi->panel_off_delay);
 

Do we need to call intel_disable_dsi_pll(encoder) here as part of the power off?

Quoted 1 line
drivers/gpu/drm/i915/intel_dsi.c +0 -0
 	/* Panel Disable over CRC PMIC */
Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#13 lore raw

Re: [PATCH 6/9] drm/i915/bxt: Fix BXT DSI disable sequence

Quoted 54 lines

-----Original Message-----
From: Paauwe, Bob J
Sent: Wednesday, February 15, 2017 11:55 PM
To: Srinivas, Vidya <[email protected]>
Cc: [email protected]; Nikula, Jani <[email protected]>
Subject: Re: [Intel-gfx] [PATCH 6/9] drm/i915/bxt: Fix BXT DSI disable sequence

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_disable(struct intel_encoder

Quoted 16 lines · On Wed, 8 Feb 2017 16:20:55 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Fix BXT DSI disable sequence as per latest updates in BSpec.

---
 drivers/gpu/drm/i915/intel_dsi.c | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_dsi.c +0 -0
index 538755b..808158f 100644
@@ -632,8 +632,10 @@ static void intel_dsi_disable(struct intel_encoder

*encoder)

Quoted 13 lines
drivers/gpu/drm/i915/intel_dsi.c +4 -2
 		for_each_dsi_port(port, intel_dsi->ports)
 			wait_for_dsi_fifo_empty(intel_dsi, port);
 
-		intel_dsi_port_disable(encoder);
-		msleep(2);
+		if (!IS_BROXTON(dev_priv)) {
+			intel_dsi_port_disable(encoder);
+			usleep_range(2000, 2500);
+		}
 	}
 
 	for_each_dsi_port(port, intel_dsi->ports) { @@ -641,7 +643,11 @@

static void intel_dsi_disable(struct intel_encoder *encoder)

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_disable(struct intel_encoder *encoder) · line 650

Quoted 9 lines
drivers/gpu/drm/i915/intel_dsi.c +5 -1
 		I915_WRITE(MIPI_DEVICE_READY(port), 0x0);
 
 		intel_dsi_reset_clocks(encoder, port);
-		I915_WRITE(MIPI_EOT_DISABLE(port), CLOCKSTOP);
+		temp = 0;
+		if (intel_dsi->clock_stop) {
+			temp |= CLOCKSTOP;
+			I915_WRITE(MIPI_EOT_DISABLE(port), temp);
+		}

This could be simplified to just

Quoted 3 lines
		if (intel_dsi->clock_stop)
			I915_WRITE(MIPI_EOT_DISABLE(port), CLOCKSTOP);

Yes, thanks Bob. I will fix this and resend.

Quoted 34 lines

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_post_disable(struct

Quoted 4 lines
drivers/gpu/drm/i915/intel_dsi.c +0 -0
 		temp = I915_READ(MIPI_DSI_FUNC_PRG(port));
 		temp &= ~VID_MODE_FORMAT_MASK;
@@ -707,12 +713,25 @@ static void intel_dsi_post_disable(struct

intel_encoder *encoder,

Quoted 16 lines
drivers/gpu/drm/i915/intel_dsi.c +7 -1
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
 	u32 val;
+	enum port port;
 
 	DRM_DEBUG_KMS("\n");
 
 	intel_dsi_disable(encoder);
 
-	intel_dsi_clear_device_ready(encoder);
+	if (IS_BROXTON(dev_priv)) {
+		/*
+		 * Reset the DSI Device ready first for both ports
+		 * and then port control registers for both ports
+		 */
+		for_each_dsi_port(port, intel_dsi->ports)

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_post_disable(struct intel_encoder *encoder,

Quoted 10 lines
drivers/gpu/drm/i915/intel_dsi.c +7 -0
+			I915_WRITE(MIPI_DEVICE_READY(port), 0);
+
+		for_each_dsi_port(port, intel_dsi->ports)
+			I915_WRITE(BXT_MIPI_PORT_CTRL(port), 0);
+	} else {
+		intel_dsi_clear_device_ready(encoder);
+	}
 
 	if (IS_BROXTON(dev_priv)) {
 		/* Power down DSI regulator to save power */ @@ -737,6

+756,8 @@

Quoted 2 lines

static void intel_dsi_post_disable(struct intel_encoder *encoder,

Quoted 9 lines

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_post_disable(struct intel_encoder *encoder, · line 760

Quoted 4 lines
drivers/gpu/drm/i915/intel_dsi.c +2 -0
 	drm_panel_unprepare(intel_dsi->panel);
 
+	/* Disable Panel */
+	drm_panel_power_off(intel_dsi->panel);

This depends on the previous patch, which I don't think is the direction we want to go. If the code is reworked to not use the drm_panel interface, then this would need to change also.

Yes, I am planning a different approach to remove the drm_panel interface Dependency. Will re-submit an updated series.

Thanks Bob for the review and useful comments.

Regards
Vidya

Quoted 10 lines
Quoted 2 lines

msleep(intel_dsi->panel_off_delay);

Do we need to call intel_disable_dsi_pll(encoder) here as part of the power off?

Quoted 1 line

/* Panel Disable over CRC PMIC */

Quoted 7 lines

--
--
Bob Paauwe
[email protected]
IOTG / PED Software Organization
Intel Corp. Folsom, CA
(916) 356-6193

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#14 lore raw

PATCH 7/9 drm/i915/bxt: Disable device ready before shutdown command

In reply to Vidya Srinivas

From: Uma Shankar <[email protected]>

Disable device ready before MIPI port shutdown command. This helps to avoid mipi split screen issues.

---
 drivers/gpu/drm/i915/intel_dsi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/i915/intel_dsi.c +11 -0
index 808158f..12aeee1 100644
@@ -603,6 +603,8 @@ static void intel_dsi_pre_disable(struct intel_encoder *encoder,
 				  struct intel_crtc_state *old_crtc_state,
 				  struct drm_connector_state *old_conn_state)
 {
+	struct drm_device *dev = encoder->base.dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
 	enum port port;
 
@@ -610,6 +612,15 @@ static void intel_dsi_pre_disable(struct intel_encoder *encoder,
 
 	intel_panel_disable_backlight(intel_dsi->attached_connector);
 
+	/*
+	 * Disable Device ready before the port shutdown in order
+	 * to avoid split screen
+	 */
+	if (IS_BROXTON(dev_priv)) {
+		for_each_dsi_port(port, intel_dsi->ports)
+			I915_WRITE(MIPI_DEVICE_READY(port), 0);
+	}
+
 	if (is_vid_mode(intel_dsi)) {
 		/* Send Shutdown command to the panel in LP mode */
 		for_each_dsi_port(port, intel_dsi->ports)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 7/9
#15 lore raw

Re: [PATCH 7/9] drm/i915/bxt: Disable device ready before shutdown command

Quoted 7 lines · On Wed, 8 Feb 2017 16:20:56 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Disable device ready before MIPI port shutdown command. This helps to avoid mipi split screen issues.

Quoted 33 lines
---
 drivers/gpu/drm/i915/intel_dsi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/i915/intel_dsi.c +11 -0
index 808158f..12aeee1 100644
@@ -603,6 +603,8 @@ static void intel_dsi_pre_disable(struct intel_encoder *encoder,
 				  struct intel_crtc_state *old_crtc_state,
 				  struct drm_connector_state *old_conn_state)
 {
+	struct drm_device *dev = encoder->base.dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
 	enum port port;
 
@@ -610,6 +612,15 @@ static void intel_dsi_pre_disable(struct intel_encoder *encoder,
 
 	intel_panel_disable_backlight(intel_dsi->attached_connector);
 
+	/*
+	 * Disable Device ready before the port shutdown in order
+	 * to avoid split screen
+	 */
+	if (IS_BROXTON(dev_priv)) {
+		for_each_dsi_port(port, intel_dsi->ports)
+			I915_WRITE(MIPI_DEVICE_READY(port), 0);
+	}
+
 	if (is_vid_mode(intel_dsi)) {
 		/* Send Shutdown command to the panel in LP mode */
 		for_each_dsi_port(port, intel_dsi->ports)
Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#16 lore raw

Re: [PATCH 7/9] drm/i915/bxt: Disable device ready before shutdown command

Quoted 5 lines · Bob Paauwe
Quoted 2 lines · On Wed, 8 Feb 2017 16:20:56 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Quoted 7 lines
Quoted 5 lines

Disable device ready before MIPI port shutdown command. This helps to avoid mipi split screen issues.

Pushed this one patch to dinq, thanks for the patch and review.

BR,
Jani.

Quoted 34 lines
Quoted 34 lines
---
 drivers/gpu/drm/i915/intel_dsi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/i915/intel_dsi.c +11 -0
index 808158f..12aeee1 100644
@@ -603,6 +603,8 @@ static void intel_dsi_pre_disable(struct intel_encoder *encoder,
 				  struct intel_crtc_state *old_crtc_state,
 				  struct drm_connector_state *old_conn_state)
 {
+	struct drm_device *dev = encoder->base.dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
 	enum port port;
 
@@ -610,6 +612,15 @@ static void intel_dsi_pre_disable(struct intel_encoder *encoder,
 
 	intel_panel_disable_backlight(intel_dsi->attached_connector);
 
+	/*
+	 * Disable Device ready before the port shutdown in order
+	 * to avoid split screen
+	 */
+	if (IS_BROXTON(dev_priv)) {
+		for_each_dsi_port(port, intel_dsi->ports)
+			I915_WRITE(MIPI_DEVICE_READY(port), 0);
+	}
+
 	if (is_vid_mode(intel_dsi)) {
 		/* Send Shutdown command to the panel in LP mode */
 		for_each_dsi_port(port, intel_dsi->ports)
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#17 lore raw

PATCH 8/9 drm/i915/bxt: Enable BXT DSI dual link

In reply to Vidya Srinivas

From: Uma Shankar <[email protected]>

Enable support for BXT DSI dual link mode.

---
 drivers/gpu/drm/i915/i915_reg.h  |  5 +++++
 drivers/gpu/drm/i915/intel_dsi.c | 27 ++++++++++++++++++---------
 2 files changed, 23 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +5 -0
index 07b1a2d..3b2925c 100644
@@ -8425,6 +8425,7 @@ enum {
 #define  LANE_CONFIGURATION_4LANE			(0 << 0)
 #define  LANE_CONFIGURATION_DUAL_LINK_A			(1 << 0)
 #define  LANE_CONFIGURATION_DUAL_LINK_B			(2 << 0)
+#define  LANE_CONFIGURATION_DUAL_LINK_ENABLE		(1 << 0)
 
 #define _MIPIA_TEARING_CTRL			(VLV_DISPLAY_BASE + 0x61194)
 #define _MIPIC_TEARING_CTRL			(VLV_DISPLAY_BASE + 0x61704)
@@ -8758,6 +8759,10 @@ enum {
 #define  READ_REQUEST_PRIORITY_HIGH			(3 << 3)
 #define  RGB_FLIP_TO_BGR				(1 << 2)
 
+/* BXT has dual link Z inversion overlap field */
+#define  BXT_PIXEL_OVERLAP_CNT_MASK			(0xf << 10)
+#define  BXT_PIXEL_OVERLAP_CNT_SHIFT			10
+
 #define  BXT_PIPE_SELECT_SHIFT				7
 #define  BXT_PIPE_SELECT_MASK				(7 << 7)
 #define  BXT_PIPE_SELECT(pipe)				((pipe) << 7)
drivers/gpu/drm/i915/intel_dsi.c +18 -9
index 12aeee1..60ca0b9 100644
@@ -440,15 +440,24 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
 	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
 	enum port port;
+	u32 temp;
 
 	if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
-		u32 temp;
-
-		temp = I915_READ(VLV_CHICKEN_3);
-		temp &= ~PIXEL_OVERLAP_CNT_MASK |
+		if (IS_BROXTON(dev_priv)) {
+			for_each_dsi_port(port, intel_dsi->ports) {
+				temp = I915_READ(MIPI_CTRL(port));
+				temp &= ~BXT_PIXEL_OVERLAP_CNT_MASK |
 					intel_dsi->pixel_overlap <<
-					PIXEL_OVERLAP_CNT_SHIFT;
-		I915_WRITE(VLV_CHICKEN_3, temp);
+					BXT_PIXEL_OVERLAP_CNT_SHIFT;
+				I915_WRITE(MIPI_CTRL(port), temp);
+			}
+		} else {
+			temp = I915_READ(VLV_CHICKEN_3);
+			temp &= ~PIXEL_OVERLAP_CNT_MASK |
+				intel_dsi->pixel_overlap <<
+				PIXEL_OVERLAP_CNT_SHIFT;
+			I915_WRITE(VLV_CHICKEN_3, temp);
+		}
 	}
 
 	for_each_dsi_port(port, intel_dsi->ports) {
@@ -464,12 +473,12 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
 		if (intel_dsi->ports == (BIT(PORT_A) | BIT(PORT_C))) {
 			temp |= (intel_dsi->dual_link - 1)
 						<< DUAL_LINK_MODE_SHIFT;
-			if (IS_BROXTON(dev_priv))
-				temp |= LANE_CONFIGURATION_DUAL_LINK_A;
-			else
+			if (IS_VALLEYVIEW(dev_priv))
 				temp |= intel_crtc->pipe ?
 					LANE_CONFIGURATION_DUAL_LINK_B :
 					LANE_CONFIGURATION_DUAL_LINK_A;
+			else if (IS_BROXTON(dev_priv))
+				temp |= LANE_CONFIGURATION_DUAL_LINK_ENABLE;
 		}
 		/* assert ip_tg_enable signal */
 		I915_WRITE(port_ctrl, temp | DPI_ENABLE);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 8/9
#18 lore raw

Re: [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

Quoted 6 lines · On Wed, 8 Feb 2017 16:20:57 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Enable support for BXT DSI dual link mode.

Quoted 79 lines
---
 drivers/gpu/drm/i915/i915_reg.h  |  5 +++++
 drivers/gpu/drm/i915/intel_dsi.c | 27 ++++++++++++++++++---------
 2 files changed, 23 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +5 -0
index 07b1a2d..3b2925c 100644
@@ -8425,6 +8425,7 @@ enum {
 #define  LANE_CONFIGURATION_4LANE			(0 << 0)
 #define  LANE_CONFIGURATION_DUAL_LINK_A			(1 << 0)
 #define  LANE_CONFIGURATION_DUAL_LINK_B			(2 << 0)
+#define  LANE_CONFIGURATION_DUAL_LINK_ENABLE		(1 << 0)
 
 #define _MIPIA_TEARING_CTRL			(VLV_DISPLAY_BASE + 0x61194)
 #define _MIPIC_TEARING_CTRL			(VLV_DISPLAY_BASE + 0x61704)
@@ -8758,6 +8759,10 @@ enum {
 #define  READ_REQUEST_PRIORITY_HIGH			(3 << 3)
 #define  RGB_FLIP_TO_BGR				(1 << 2)
 
+/* BXT has dual link Z inversion overlap field */
+#define  BXT_PIXEL_OVERLAP_CNT_MASK			(0xf << 10)
+#define  BXT_PIXEL_OVERLAP_CNT_SHIFT			10
+
 #define  BXT_PIPE_SELECT_SHIFT				7
 #define  BXT_PIPE_SELECT_MASK				(7 << 7)
 #define  BXT_PIPE_SELECT(pipe)				((pipe) << 7)
drivers/gpu/drm/i915/intel_dsi.c +18 -9
index 12aeee1..60ca0b9 100644
@@ -440,15 +440,24 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
 	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
 	enum port port;
+	u32 temp;
 
 	if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
-		u32 temp;
-
-		temp = I915_READ(VLV_CHICKEN_3);
-		temp &= ~PIXEL_OVERLAP_CNT_MASK |
+		if (IS_BROXTON(dev_priv)) {
+			for_each_dsi_port(port, intel_dsi->ports) {
+				temp = I915_READ(MIPI_CTRL(port));
+				temp &= ~BXT_PIXEL_OVERLAP_CNT_MASK |
 					intel_dsi->pixel_overlap <<
-					PIXEL_OVERLAP_CNT_SHIFT;
-		I915_WRITE(VLV_CHICKEN_3, temp);
+					BXT_PIXEL_OVERLAP_CNT_SHIFT;
+				I915_WRITE(MIPI_CTRL(port), temp);
+			}
+		} else {
+			temp = I915_READ(VLV_CHICKEN_3);
+			temp &= ~PIXEL_OVERLAP_CNT_MASK |
+				intel_dsi->pixel_overlap <<
+				PIXEL_OVERLAP_CNT_SHIFT;
+			I915_WRITE(VLV_CHICKEN_3, temp);
+		}
 	}
 
 	for_each_dsi_port(port, intel_dsi->ports) {
@@ -464,12 +473,12 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
 		if (intel_dsi->ports == (BIT(PORT_A) | BIT(PORT_C))) {
 			temp |= (intel_dsi->dual_link - 1)
 						<< DUAL_LINK_MODE_SHIFT;
-			if (IS_BROXTON(dev_priv))
-				temp |= LANE_CONFIGURATION_DUAL_LINK_A;
-			else
+			if (IS_VALLEYVIEW(dev_priv))
 				temp |= intel_crtc->pipe ?
 					LANE_CONFIGURATION_DUAL_LINK_B :
 					LANE_CONFIGURATION_DUAL_LINK_A;
+			else if (IS_BROXTON(dev_priv))
+				temp |= LANE_CONFIGURATION_DUAL_LINK_ENABLE;
 		}
 		/* assert ip_tg_enable signal */
 		I915_WRITE(port_ctrl, temp | DPI_ENABLE);
Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#19 lore raw

Re: [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

Quoted 11 lines · Bob Paauwe
Quoted 6 lines · On Wed, 8 Feb 2017 16:20:57 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Enable support for BXT DSI dual link mode.

This doesn't apply because I've pushed

commit 6043801f937ada9c9ed9dfa3c6ce542a79643401

Author: Deepak M <[email protected]>
Date:   Tue Feb 14 18:46:16 2017 +0530

drm/i915: Set the Z inversion overlap field

Please update the patch, and in general, please send a new series of patches that do *not* depend on the drm_panel changes. We can get all of those merged first. We should try to make progress.

BR,
Jani.

Quoted 80 lines
Quoted 80 lines
---
 drivers/gpu/drm/i915/i915_reg.h  |  5 +++++
 drivers/gpu/drm/i915/intel_dsi.c | 27 ++++++++++++++++++---------
 2 files changed, 23 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +5 -0
index 07b1a2d..3b2925c 100644
@@ -8425,6 +8425,7 @@ enum {
 #define  LANE_CONFIGURATION_4LANE			(0 << 0)
 #define  LANE_CONFIGURATION_DUAL_LINK_A			(1 << 0)
 #define  LANE_CONFIGURATION_DUAL_LINK_B			(2 << 0)
+#define  LANE_CONFIGURATION_DUAL_LINK_ENABLE		(1 << 0)
 
 #define _MIPIA_TEARING_CTRL			(VLV_DISPLAY_BASE + 0x61194)
 #define _MIPIC_TEARING_CTRL			(VLV_DISPLAY_BASE + 0x61704)
@@ -8758,6 +8759,10 @@ enum {
 #define  READ_REQUEST_PRIORITY_HIGH			(3 << 3)
 #define  RGB_FLIP_TO_BGR				(1 << 2)
 
+/* BXT has dual link Z inversion overlap field */
+#define  BXT_PIXEL_OVERLAP_CNT_MASK			(0xf << 10)
+#define  BXT_PIXEL_OVERLAP_CNT_SHIFT			10
+
 #define  BXT_PIPE_SELECT_SHIFT				7
 #define  BXT_PIPE_SELECT_MASK				(7 << 7)
 #define  BXT_PIPE_SELECT(pipe)				((pipe) << 7)
drivers/gpu/drm/i915/intel_dsi.c +18 -9
index 12aeee1..60ca0b9 100644
@@ -440,15 +440,24 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
 	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
 	enum port port;
+	u32 temp;
 
 	if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
-		u32 temp;
-
-		temp = I915_READ(VLV_CHICKEN_3);
-		temp &= ~PIXEL_OVERLAP_CNT_MASK |
+		if (IS_BROXTON(dev_priv)) {
+			for_each_dsi_port(port, intel_dsi->ports) {
+				temp = I915_READ(MIPI_CTRL(port));
+				temp &= ~BXT_PIXEL_OVERLAP_CNT_MASK |
 					intel_dsi->pixel_overlap <<
-					PIXEL_OVERLAP_CNT_SHIFT;
-		I915_WRITE(VLV_CHICKEN_3, temp);
+					BXT_PIXEL_OVERLAP_CNT_SHIFT;
+				I915_WRITE(MIPI_CTRL(port), temp);
+			}
+		} else {
+			temp = I915_READ(VLV_CHICKEN_3);
+			temp &= ~PIXEL_OVERLAP_CNT_MASK |
+				intel_dsi->pixel_overlap <<
+				PIXEL_OVERLAP_CNT_SHIFT;
+			I915_WRITE(VLV_CHICKEN_3, temp);
+		}
 	}
 
 	for_each_dsi_port(port, intel_dsi->ports) {
@@ -464,12 +473,12 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
 		if (intel_dsi->ports == (BIT(PORT_A) | BIT(PORT_C))) {
 			temp |= (intel_dsi->dual_link - 1)
 						<< DUAL_LINK_MODE_SHIFT;
-			if (IS_BROXTON(dev_priv))
-				temp |= LANE_CONFIGURATION_DUAL_LINK_A;
-			else
+			if (IS_VALLEYVIEW(dev_priv))
 				temp |= intel_crtc->pipe ?
 					LANE_CONFIGURATION_DUAL_LINK_B :
 					LANE_CONFIGURATION_DUAL_LINK_A;
+			else if (IS_BROXTON(dev_priv))
+				temp |= LANE_CONFIGURATION_DUAL_LINK_ENABLE;
 		}
 		/* assert ip_tg_enable signal */
 		I915_WRITE(port_ctrl, temp | DPI_ENABLE);
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#20 lore raw

Re: [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

Quoted 29 lines

-----Original Message-----
From: Nikula, Jani
Sent: Thursday, February 16, 2017 8:56 PM
To: Paauwe, Bob J <[email protected]>; Srinivas, Vidya <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

Quoted 11 lines · Bob Paauwe
Quoted 6 lines · On Wed, 8 Feb 2017 16:20:57 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Enable support for BXT DSI dual link mode.

This doesn't apply because I've pushed

commit 6043801f937ada9c9ed9dfa3c6ce542a79643401

Author: Deepak M <[email protected]>
Date:   Tue Feb 14 18:46:16 2017 +0530
Quoted 8 lines

drm/i915: Set the Z inversion overlap field

Please update the patch, and in general, please send a new series of patches that do *not* depend on the drm_panel changes. We can get all of those merged first. We should try to make progress.

BR,
Jani.

Thanks Jani. I will rebase and re-submit and also to remove drm_panel interface dependency, I am planning to create panel sequence callbacks in intel_dsi structure itself. Is this approach okay?

Regards
Vidya

Quoted 93 lines
Quoted 8 lines
Quoted 8 lines


---
 drivers/gpu/drm/i915/i915_reg.h  |  5 +++++
drivers/gpu/drm/i915/intel_dsi.c | 27 ++++++++++++++++++---------
 2 files changed, 23 insertions(+), 9 deletions(-)
Quoted 7 lines

drivers/gpu/drm/i915/i915_reg.h enum { · line 8426

Quoted 7 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/i915_reg.h index 07b1a2d..3b2925c 100644

drivers/gpu/drm/i915/i915_reg.h +0 -0
@@ -8425,6 +8425,7 @@ enum {
 #define  LANE_CONFIGURATION_4LANE			(0 << 0)
 #define  LANE_CONFIGURATION_DUAL_LINK_A			(1 <<

0)

Quoted 1 line

drivers/gpu/drm/i915/i915_reg.h enum { · line 8427

Quoted 1 line
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define  LANE_CONFIGURATION_DUAL_LINK_B			(2 <<

0)

Quoted 1 line

drivers/gpu/drm/i915/i915_reg.h enum { · line 8428

Quoted 1 line
drivers/gpu/drm/i915/i915_reg.h +1 -0
+#define  LANE_CONFIGURATION_DUAL_LINK_ENABLE		(1 <<

0)

Quoted 2 lines

drivers/gpu/drm/i915/i915_reg.h enum { · line 8429

Quoted 2 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define _MIPIA_TEARING_CTRL			(VLV_DISPLAY_BASE

+ 0x61194)

Quoted 1 line

drivers/gpu/drm/i915/i915_reg.h enum { · line 8430

Quoted 1 line
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define _MIPIC_TEARING_CTRL			(VLV_DISPLAY_BASE

+ 0x61704)

Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
@@ -8758,6 +8759,10 @@ enum {
 #define  READ_REQUEST_PRIORITY_HIGH			(3 << 3)
 #define  RGB_FLIP_TO_BGR				(1 << 2)
 
Quoted 13 lines

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_port_enable(struct

Quoted 13 lines
drivers/gpu/drm/i915/i915_reg.h +4 -0
+/* BXT has dual link Z inversion overlap field */
+#define  BXT_PIXEL_OVERLAP_CNT_MASK			(0xf << 10)
+#define  BXT_PIXEL_OVERLAP_CNT_SHIFT			10
+
 #define  BXT_PIPE_SELECT_SHIFT				7
 #define  BXT_PIPE_SELECT_MASK				(7 << 7)
 #define  BXT_PIPE_SELECT(pipe)				((pipe) << 7)
drivers/gpu/drm/i915/intel_dsi.c +0 -0
index 12aeee1..60ca0b9 100644
@@ -440,15 +440,24 @@ static void intel_dsi_port_enable(struct

intel_encoder *encoder)

Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/i915/intel_dsi.c +1 -0
 	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
 	enum port port;
+	u32 temp;
 
Quoted 9 lines

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_port_enable(struct intel_encoder *encoder)

Quoted 9 lines
drivers/gpu/drm/i915/intel_dsi.c +4 -4
 	if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
-		u32 temp;
-
-		temp = I915_READ(VLV_CHICKEN_3);
-		temp &= ~PIXEL_OVERLAP_CNT_MASK |
+		if (IS_BROXTON(dev_priv)) {
+			for_each_dsi_port(port, intel_dsi->ports) {
+				temp = I915_READ(MIPI_CTRL(port));
+				temp &= ~BXT_PIXEL_OVERLAP_CNT_MASK

|

Quoted 15 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_dsi.c +10 -2
 					intel_dsi->pixel_overlap <<
-					PIXEL_OVERLAP_CNT_SHIFT;
-		I915_WRITE(VLV_CHICKEN_3, temp);
+					BXT_PIXEL_OVERLAP_CNT_SHIFT;
+				I915_WRITE(MIPI_CTRL(port), temp);
+			}
+		} else {
+			temp = I915_READ(VLV_CHICKEN_3);
+			temp &= ~PIXEL_OVERLAP_CNT_MASK |
+				intel_dsi->pixel_overlap <<
+				PIXEL_OVERLAP_CNT_SHIFT;
+			I915_WRITE(VLV_CHICKEN_3, temp);
+		}
 	}
 
Quoted 1 line

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_port_enable(struct · line 463

Quoted 1 line
drivers/gpu/drm/i915/intel_dsi.c +0 -0
 	for_each_dsi_port(port, intel_dsi->ports) { @@ -464,12 +473,12

@@

Quoted 4 lines

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_port_enable(struct intel_encoder *encoder)

Quoted 4 lines

static void intel_dsi_port_enable(struct intel_encoder *encoder)

drivers/gpu/drm/i915/intel_dsi.c +0 -0
 		if (intel_dsi->ports == (BIT(PORT_A) | BIT(PORT_C))) {
 			temp |= (intel_dsi->dual_link - 1)
 						<<

DUAL_LINK_MODE_SHIFT;

Quoted 2 lines

drivers/gpu/drm/i915/intel_dsi.c

Quoted 2 lines
drivers/gpu/drm/i915/intel_dsi.c +0 -2
-			if (IS_BROXTON(dev_priv))
-				temp |=

LANE_CONFIGURATION_DUAL_LINK_A;

Quoted 4 lines

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_port_enable(struct intel_encoder *encoder) · line 477

Quoted 4 lines
drivers/gpu/drm/i915/intel_dsi.c +1 -1
-			else
+			if (IS_VALLEYVIEW(dev_priv))
 				temp |= intel_crtc->pipe ?

LANE_CONFIGURATION_DUAL_LINK_B :

Quoted 1 line
Quoted 1 line
	LANE_CONFIGURATION_DUAL_LINK_A;
Quoted 2 lines

drivers/gpu/drm/i915/intel_dsi.c

Quoted 2 lines
drivers/gpu/drm/i915/intel_dsi.c +2 -0
+			else if (IS_BROXTON(dev_priv))
+				temp |=

LANE_CONFIGURATION_DUAL_LINK_ENABLE;

Quoted 6 lines
Quoted 3 lines

drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_port_enable(struct intel_encoder *encoder) · line 484

Quoted 3 lines
drivers/gpu/drm/i915/intel_dsi.c +0 -0
 		}
 		/* assert ip_tg_enable signal */
 		I915_WRITE(port_ctrl, temp | DPI_ENABLE);

--
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#21 lore raw

Re: [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

Quoted 3 lines · Vidya

Thanks Jani. I will rebase and re-submit and also to remove drm_panel interface dependency, I am planning to create panel sequence callbacks in intel_dsi structure itself. Is this approach okay?

I think that's unnecessary overhead. I've come to think we should just do what Hans suggested in his patch [1]. It's easiest, and we don't really benefit anything from the drm_panel interface or function pointer chasing.

Hans, do you think you'll have the time or motivation to refresh your series, or should we just let Vidya do this?

As an added difficulty, there's Madhav doing the Geminilake enabling at the same time, and these two/three series [2][3][4] are bound to conflict to some extent.

BR,
Jani.

[1] http://patchwork.freedesktop.org/patch/msgid/[email protected]
[2] http://mid.mail-archive.com/[email protected]
[3] http://mid.mail-archive.com/[email protected]
[4] http://mid.mail-archive.com/[email protected]

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#22 lore raw

Re: [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

Hi,

Quoted 10 lines · Jani Nikula
Quoted 3 lines · Vidya

Thanks Jani. I will rebase and re-submit and also to remove drm_panel interface dependency, I am planning to create panel sequence callbacks in intel_dsi structure itself. Is this approach okay?

I think that's unnecessary overhead. I've come to think we should just do what Hans suggested in his patch [1]. It's easiest, and we don't really benefit anything from the drm_panel interface or function pointer chasing.

Quoted 6 lines

Hans, do you think you'll have the time or motivation to refresh your series, or should we just let Vidya do this?

As an added difficulty, there's Madhav doing the Geminilake enabling at the same time, and these two/three series [2][3][4] are bound to conflict to some extent.

I've my series rebased in a personal repo. As I was planning on resubmitting it at some point in the future. I can send out a new version right now if you want ...

Regards,

Hans
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#23 lore raw

Re: [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

Quoted 16 lines · Hans de Goede

Hi,

Quoted 13 lines · Jani Nikula
Quoted 3 lines · Vidya

Thanks Jani. I will rebase and re-submit and also to remove drm_panel interface dependency, I am planning to create panel sequence callbacks in intel_dsi structure itself. Is this approach okay?

I think that's unnecessary overhead. I've come to think we should just do what Hans suggested in his patch [1]. It's easiest, and we don't really benefit anything from the drm_panel interface or function pointer chasing.

Hans, do you think you'll have the time or motivation to refresh your series, or should we just let Vidya do this?

Quoted 7 lines
Quoted 3 lines

As an added difficulty, there's Madhav doing the Geminilake enabling at the same time, and these two/three series [2][3][4] are bound to conflict to some extent.

I've my series rebased in a personal repo. As I was planning on resubmitting it at some point in the future. I can send out a new version right now if you want ...

Please do!

BR,
Jani.

Quoted 4 lines

Regards,

Hans

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#24 lore raw

Re: [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

In reply to Hans de Goede
Quoted 16 lines · Hans de Goede

Hi,

Quoted 13 lines · Jani Nikula
Quoted 3 lines · Vidya

Thanks Jani. I will rebase and re-submit and also to remove drm_panel interface dependency, I am planning to create panel sequence callbacks in intel_dsi structure itself. Is this approach okay?

I think that's unnecessary overhead. I've come to think we should just do what Hans suggested in his patch [1]. It's easiest, and we don't really benefit anything from the drm_panel interface or function pointer chasing.

Hans, do you think you'll have the time or motivation to refresh your series, or should we just let Vidya do this?

Quoted 7 lines
Quoted 3 lines

As an added difficulty, there's Madhav doing the Geminilake enabling at the same time, and these two/three series [2][3][4] are bound to conflict to some extent.

I've my series rebased in a personal repo. As I was planning on resubmitting it at some point in the future. I can send out a new version right now if you want ...

Vidya, see [1] for Hans' series. I'm inclined to pick (most of) that, and continue from there. Thoughts?

BR,
Jani.

[1] http://mid.mail-archive.com/[email protected]

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#25 lore raw

Re: [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

Quoted 37 lines

-----Original Message-----
From: Nikula, Jani
Sent: Tuesday, February 21, 2017 12:49 AM
To: Hans de Goede <[email protected]>; Srinivas, Vidya <[email protected]>; Paauwe, Bob J <[email protected]>
Cc: [email protected]; Chauhan, Madhav <[email protected]>
Subject: Re: [Intel-gfx] [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

Quoted 4 lines · Hans de Goede

Hi,

Quoted 1 line · Jani Nikula

On Mon, 20 Feb 2017, "Srinivas, Vidya" <[email protected]>

Quoted 12 lines · wrote:
Quoted 12 lines
Quoted 3 lines

Thanks Jani. I will rebase and re-submit and also to remove drm_panel interface dependency, I am planning to create panel sequence callbacks in intel_dsi structure itself. Is this approach okay?

I think that's unnecessary overhead. I've come to think we should just do what Hans suggested in his patch [1]. It's easiest, and we don't really benefit anything from the drm_panel interface or function pointer chasing.

Hans, do you think you'll have the time or motivation to refresh your series, or should we just let Vidya do this?

Quoted 7 lines
Quoted 3 lines

As an added difficulty, there's Madhav doing the Geminilake enabling at the same time, and these two/three series [2][3][4] are bound to conflict to some extent.

I've my series rebased in a personal repo. As I was planning on resubmitting it at some point in the future. I can send out a new version right now if you want ...

Quoted 5 lines

Vidya, see [1] for Hans' series. I'm inclined to pick (most of) that, and continue from there. Thoughts?

BR,
Jani.

We went through Hans' series.
http://www.mail-archive.com/[email protected]/msg113101.html
We feel its okay to call the panel sequences directly instead of introducing new call backs. We can use this approach. But, Hans' series has other changes as well. For now, can we have only the generic sequence changes merged and we will rebase our changes on top of that.

Regards
Vidya

Quoted 8 lines

[1] http://mid.mail-archive.com/20170220140845.1714-1-
[email protected]

--
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#26 lore raw

Re: [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

Hi,

Quoted 40 lines · Vidya
Quoted 40 lines

-----Original Message-----
From: Nikula, Jani
Sent: Tuesday, February 21, 2017 12:49 AM
To: Hans de Goede <[email protected]>; Srinivas, Vidya <[email protected]>; Paauwe, Bob J <[email protected]>
Cc: [email protected]; Chauhan, Madhav <[email protected]>
Subject: Re: [Intel-gfx] [PATCH 8/9] drm/i915/bxt: Enable BXT DSI dual link

Quoted 4 lines · Hans de Goede

Hi,

Quoted 1 line · Jani Nikula

On Mon, 20 Feb 2017, "Srinivas, Vidya" <[email protected]>

Quoted 12 lines · wrote:
Quoted 12 lines
Quoted 3 lines

Thanks Jani. I will rebase and re-submit and also to remove drm_panel interface dependency, I am planning to create panel sequence callbacks in intel_dsi structure itself. Is this approach okay?

I think that's unnecessary overhead. I've come to think we should just do what Hans suggested in his patch [1]. It's easiest, and we don't really benefit anything from the drm_panel interface or function pointer chasing.

Hans, do you think you'll have the time or motivation to refresh your series, or should we just let Vidya do this?

Quoted 7 lines
Quoted 3 lines

As an added difficulty, there's Madhav doing the Geminilake enabling at the same time, and these two/three series [2][3][4] are bound to conflict to some extent.

I've my series rebased in a personal repo. As I was planning on resubmitting it at some point in the future. I can send out a new version right now if you want ...

Vidya, see [1] for Hans' series. I'm inclined to pick (most of) that, and continue from there. Thoughts?

Quoted 8 lines
Quoted 2 lines

BR,
Jani.

We went through Hans' series.
http://www.mail-archive.com/[email protected]/msg113101.html
We feel its okay to call the panel sequences directly instead of introducing new call backs. We can use this approach. But, Hans' series has other changes as well.

Right, changes to actually make the driver follow the spec, instead of calling a number of sequences at the wrong time, these seem like worthwhile changes to have and it would be good to land them sooner rather then later so that most bxt qa will be done with the sequences called at the proper times.

Regards,

Hans

For now, can we have only the generic sequence changes merged and

Quoted 12 lines

we will rebase our changes on top of that.

Regards
Vidya

Quoted 8 lines

[1] http://mid.mail-archive.com/20170220140845.1714-1-
[email protected]

--
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#27 lore raw

PATCH 9/9 drm/i915/bxt: Fix the DSI enable sequence

In reply to Vidya Srinivas

From: Uma Shankar <[email protected]>

Device ready to be done after panel power on and before sending the OTP commands. Patch fixes the enable sequence as per this.

---
 drivers/gpu/drm/i915/intel_dsi.c           | 12 ++++++++++++
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c |  4 +---
 2 files changed, 13 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dsi.c +12 -0
index 60ca0b9..ac02fd8 100644
@@ -568,6 +568,12 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder,
 
 	intel_dsi_prepare(encoder, pipe_config);
 
+	if (IS_BROXTON(dev_priv)) {
+		/* Panel Enable */
+		drm_panel_power_on(intel_dsi->panel);
+		msleep(intel_dsi->panel_on_delay);
+	}
+
 	/* Panel Enable over CRC PMIC */
 	if (intel_dsi->gpio_panel)
 		gpiod_set_value_cansleep(intel_dsi->gpio_panel, 1);
@@ -586,6 +592,12 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder,
 	/* put device in ready state */
 	intel_dsi_device_ready(encoder);
 
+	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
+		/* Panel Enable */
+		drm_panel_power_on(intel_dsi->panel);
+		msleep(intel_dsi->panel_on_delay);
+	}
+
 	drm_panel_prepare(intel_dsi->panel);
 
 	for_each_dsi_port(port, intel_dsi->ports)
drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +1 -3
index 4279279..aa73d22 100644
@@ -493,9 +493,6 @@ static void generic_exec_sequence(struct drm_panel *panel, enum mipi_seq seq_id)
 
 static int vbt_panel_prepare(struct drm_panel *panel)
 {
-	generic_exec_sequence(panel, MIPI_SEQ_ASSERT_RESET);
-	generic_exec_sequence(panel, MIPI_SEQ_POWER_ON);
-	generic_exec_sequence(panel, MIPI_SEQ_DEASSERT_RESET);
 	generic_exec_sequence(panel, MIPI_SEQ_INIT_OTP);
 
 	return 0;
@@ -550,6 +547,7 @@ static int vbt_panel_get_modes(struct drm_panel *panel)
 static int vbt_panel_power_on(struct drm_panel *panel)
 {
 	generic_exec_sequence(panel, MIPI_SEQ_POWER_ON);
+	generic_exec_sequence(panel, MIPI_SEQ_ASSERT_RESET);
 	return 0;
 }
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#28 lore raw

Re: [PATCH 9/9] drm/i915/bxt: Fix the DSI enable sequence

Quoted 8 lines · On Wed, 8 Feb 2017 16:20:58 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Device ready to be done after panel power on and before sending the OTP commands. Patch fixes the enable sequence as per this.

I think this will need to be rebased now.

The sequence looks like it will be slightly different from what I'm currently using for Broxton. But in general it seems correct.

Bob

Quoted 57 lines
---
 drivers/gpu/drm/i915/intel_dsi.c           | 12 ++++++++++++
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c |  4 +---
 2 files changed, 13 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dsi.c +12 -0
index 60ca0b9..ac02fd8 100644
@@ -568,6 +568,12 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder,
 
 	intel_dsi_prepare(encoder, pipe_config);
 
+	if (IS_BROXTON(dev_priv)) {
+		/* Panel Enable */
+		drm_panel_power_on(intel_dsi->panel);
+		msleep(intel_dsi->panel_on_delay);
+	}
+
 	/* Panel Enable over CRC PMIC */
 	if (intel_dsi->gpio_panel)
 		gpiod_set_value_cansleep(intel_dsi->gpio_panel, 1);
@@ -586,6 +592,12 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder,
 	/* put device in ready state */
 	intel_dsi_device_ready(encoder);
 
+	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
+		/* Panel Enable */
+		drm_panel_power_on(intel_dsi->panel);
+		msleep(intel_dsi->panel_on_delay);
+	}
+
 	drm_panel_prepare(intel_dsi->panel);
 
 	for_each_dsi_port(port, intel_dsi->ports)
drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +1 -3
index 4279279..aa73d22 100644
@@ -493,9 +493,6 @@ static void generic_exec_sequence(struct drm_panel *panel, enum mipi_seq seq_id)
 
 static int vbt_panel_prepare(struct drm_panel *panel)
 {
-	generic_exec_sequence(panel, MIPI_SEQ_ASSERT_RESET);
-	generic_exec_sequence(panel, MIPI_SEQ_POWER_ON);
-	generic_exec_sequence(panel, MIPI_SEQ_DEASSERT_RESET);
 	generic_exec_sequence(panel, MIPI_SEQ_INIT_OTP);
 
 	return 0;
@@ -550,6 +547,7 @@ static int vbt_panel_get_modes(struct drm_panel *panel)
 static int vbt_panel_power_on(struct drm_panel *panel)
 {
 	generic_exec_sequence(panel, MIPI_SEQ_POWER_ON);
+	generic_exec_sequence(panel, MIPI_SEQ_ASSERT_RESET);
 	return 0;
 }
 
Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#29 lore raw

Re: [PATCH 9/9] drm/i915/bxt: Fix the DSI enable sequence

Quoted 18 lines

-----Original Message-----
From: Paauwe, Bob J
Sent: Thursday, February 16, 2017 12:31 AM
To: Srinivas, Vidya <[email protected]>
Cc: [email protected]; Nikula, Jani <[email protected]>
Subject: Re: [Intel-gfx] [PATCH 9/9] drm/i915/bxt: Fix the DSI enable sequence

Quoted 5 lines · On Wed, 8 Feb 2017 16:20:58 +0530 Vidya Srinivas <[email protected]>…

From: Uma Shankar <[email protected]>

Device ready to be done after panel power on and before sending the OTP commands. Patch fixes the enable sequence as per this.

Quoted 8 lines
Quoted 2 lines

I think this will need to be rebased now.
The sequence looks like it will be slightly different from what I'm currently using for Broxton. But in general it seems correct.

Bob

Thanks Bob. I will rebase the rest of the changes and re-submit.

Regards
Vidya

Quoted 66 lines
Quoted 24 lines
---
 drivers/gpu/drm/i915/intel_dsi.c           | 12 ++++++++++++
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c |  4 +---
 2 files changed, 13 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dsi.c +6 -0
index 60ca0b9..ac02fd8 100644
@@ -568,6 +568,12 @@ static void intel_dsi_pre_enable(struct
 intel_encoder *encoder,
 
 	intel_dsi_prepare(encoder, pipe_config);
 
+	if (IS_BROXTON(dev_priv)) {
+		/* Panel Enable */
+		drm_panel_power_on(intel_dsi->panel);
+		msleep(intel_dsi->panel_on_delay);
+	}
+
 	/* Panel Enable over CRC PMIC */
 	if (intel_dsi->gpio_panel)
Quoted 1 line

gpiod_set_value_cansleep(intel_dsi->gpio_panel, 1); @@ -

586,6

Quoted 1 line

+592,12 @@ static void intel_dsi_pre_enable(struct intel_encoder

*encoder,

drivers/gpu/drm/i915/intel_dsi_panel_vbt.c static void generic_exec_sequence(struct

Quoted 18 lines
drivers/gpu/drm/i915/intel_dsi.c +6 -0
 	/* put device in ready state */
 	intel_dsi_device_ready(encoder);
 
+	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
+		/* Panel Enable */
+		drm_panel_power_on(intel_dsi->panel);
+		msleep(intel_dsi->panel_on_delay);
+	}
+
 	drm_panel_prepare(intel_dsi->panel);
 
 	for_each_dsi_port(port, intel_dsi->ports) diff --git

a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
index 4279279..aa73d22 100644

drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +0 -0
@@ -493,9 +493,6 @@ static void generic_exec_sequence(struct

drm_panel

Quoted 10 lines
drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +0 -3
 *panel, enum mipi_seq seq_id)
 
 static int vbt_panel_prepare(struct drm_panel *panel)  {
-	generic_exec_sequence(panel, MIPI_SEQ_ASSERT_RESET);
-	generic_exec_sequence(panel, MIPI_SEQ_POWER_ON);
-	generic_exec_sequence(panel, MIPI_SEQ_DEASSERT_RESET);
 	generic_exec_sequence(panel, MIPI_SEQ_INIT_OTP);
 
 	return 0;

drivers/gpu/drm/i915/intel_dsi_panel_vbt.c static int vbt_panel_get_modes(struct drm_panel · line 552

Quoted 6 lines
drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +1 -0
@@ -550,6 +547,7 @@ static int vbt_panel_get_modes(struct drm_panel
 *panel)  static int vbt_panel_power_on(struct drm_panel *panel)  {
 	generic_exec_sequence(panel, MIPI_SEQ_POWER_ON);
+	generic_exec_sequence(panel, MIPI_SEQ_ASSERT_RESET);
 	return 0;
 }
 
Quoted 7 lines

--
--
Bob Paauwe
[email protected]
IOTG / PED Software Organization
Intel Corp. Folsom, CA
(916) 356-6193

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#30 lore raw

✓ Fi.CI.BAT: success for Broxton DSI dual-link and sequence fixes

In reply to Vidya Srinivas
== Series Details ==

== Series Details ==

Series: Broxton DSI dual-link and sequence fixes
URL : https://patchwork.freedesktop.org/series/19296/
State : success

== Summary ==

Series 19296v1 Broxton DSI dual-link and sequence fixes
https://patchwork.freedesktop.org/api/1.0/series/19296/revisions/1/mbox/

Test kms_force_connector_basic:

        Subgroup force-connector-state:
                dmesg-warn -> PASS       (fi-snb-2520m)
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-c-frame-sequence:
                fail       -> PASS       (fi-skl-6770hq)
        Subgroup read-crc-pipe-a-frame-sequence:
                fail       -> PASS       (fi-skl-6770hq)
fi-bdw-5557u     total:252  pass:238  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:252  pass:213  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:252  pass:230  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700     total:83   pass:70   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:252  pass:225  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:252  pass:221  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:252  pass:233  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:252  pass:233  dwarn:0   dfail:0   fail:0   skip:19 
fi-ilk-650       total:252  pass:199  dwarn:0   dfail:0   fail:0   skip:53 
fi-ivb-3520m     total:252  pass:231  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:252  pass:231  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:252  pass:229  dwarn:0   dfail:0   fail:2   skip:21 
fi-skl-6260u     total:252  pass:239  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:252  pass:232  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:252  pass:227  dwarn:4   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:252  pass:239  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:252  pass:221  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:252  pass:220  dwarn:0   dfail:0   fail:0   skip:32 

80b02983d80ad38722a8bb6c86ca001ed57b9755 drm-tip: 2017y-02m-08d-09h-27m-34s UTC integration manifest b97fb97 drm/i915/bxt: Fix the DSI enable sequence
4d707c7 drm/i915/bxt: Enable BXT DSI dual link
23c7423 drm/i915/bxt: Disable device ready before shutdown command
5833cc7 drm/i915/bxt: Fix BXT DSI disable sequence
a588169 drm/i915/bxt: Fix BXT DSI ULPS sequence
225ab01 drm/i915: Add DSI panel power on/off sequence callbacks
d2e83b3 drm: Add DSI panel power on/off sequence programming
00c0935 drm/i915: Fix PLL 8x/3 divider for MIPI video mode
82b4e12 drm/i915: Check for platform specific GPIO config

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3733/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx