Skip to contentSkip to conversation

drm/i915: be sure panel is powered up in eDP configs

PATCH In review Jesse Barnes 4 participants 6 messages Jul 14, 2010 – Jul 22, 2010

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

PATCH 1/1 drm/i915: be sure panel is powered up in eDP configs

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=28739. We need to enable power to the panel with the AUX VDD bit in order to properly detect the eDP attached panel, and we also need to turn the panel on in case it was off when we started (as happens at resume time).

But this patch raises a couple of questions:
1) why does the first panel on sequence time out?
2) why do I need to unlock the panel protected regs?

Keith, I think this is your code, any ideas?

Thanks,
Jesse

drivers/gpu/drm/i915/i915_reg.h +1 -0
index 42c6024..b191f02 100644
@@ -2805,6 +2805,7 @@
 
 #define PCH_PP_STATUS		0xc7200
 #define PCH_PP_CONTROL		0xc7204
+#define  PANEL_UNLOCK_REGS	(0xabcd << 16)
 #define  EDP_FORCE_VDD		(1 << 3)
 #define  EDP_BLC_ENABLE		(1 << 2)
 #define  PANEL_POWER_RESET	(1 << 1)
drivers/gpu/drm/i915/intel_dp.c +60 -4

88 lines not on this page · raw message

#1 lore raw
Quoted 10 lines · Jesse Barnes

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=28739. We need to enable power to the panel with the AUX VDD bit in order to properly detect the eDP attached panel, and we also need to turn the panel on in case it was off when we started (as happens at resume time).

But this patch raises a couple of questions:
1) why does the first panel on sequence time out?
2) why do I need to unlock the panel protected regs?

Keith, I think this is your code, any ideas?

I just wrote the DP code, not the eDP code. I haven't any idea why the panel on sequence is timing out, although I note that you unlock the panel regs after turning it on...

Signature · 1 line
[email protected]

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

#2 lore raw
In reply to Jesse Barnes
Quoted 8 lines · Jesse Barnes

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=28739. We need to enable power to the panel with the AUX VDD bit in order to properly detect the eDP attached panel, and we also need to turn the panel on in case it was off when we started (as happens at resume time).

But this patch raises a couple of questions:
1) why does the first panel on sequence time out?
2) why do I need to unlock the panel protected regs?

Maybe in your case write protect is set to on? That might lead to panel power sequence time out.

I'll send you some references, I haven't tracked eDP issue recently including spec update, so something may be wrong and not fixed.

Signature · 3 lines
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

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

#3 lore raw

ILK/SNB mode setting sequence

Quoted 10 lines · On Thu, 15 Jul 2010 09:13:19 +0800 Zhenyu Wang <[email protected]> wrote:
Quoted 8 lines · Jesse Barnes

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=28739. We need to enable power to the panel with the AUX VDD bit in order to properly detect the eDP attached panel, and we also need to turn the panel on in case it was off when we started (as happens at resume time).

But this patch raises a couple of questions:
1) why does the first panel on sequence time out?
2) why do I need to unlock the panel protected regs?

Quoted 6 lines

Maybe in your case write protect is set to on? That might lead to panel power sequence time out.

I'll send you some references, I haven't tracked eDP issue recently including spec update, so something may be wrong and not fixed.

Formatting got a little busted, but here's the latest sequence. Might help Adam with the problem he was seeing with VGA too.

1.1.3 Display Mode Set Sequence

Wait values
[DevIBX and DevCPT]: PCH clock reference source and PCH SSC modulator warmup = 1uS
[DevIBX and DevCPT]: PCH FDI receiver PLL warmup = 25us
[DevIBX and DevCPT]: PCH DPLL warmup = 50uS
[DevILK and DevSNB]: CPU DP PLL warmup = 20uS
[DevILK and DevSNB]: CPU FDI transmitter PLL warmup = 10us
[DevILK and DevSNB and DevIBX and DevCPT]: DMI latency = 20uS
FDI training pattern 1 time = 0.5uS
FDI training pattern 2 time = 1.5uS
FDI idle pattern time = 31uS
Enable sequence
1. Enable panel power as needed to retrieve panel configuration ([DevIBX-B+] use AUX VDD enable bit) ([DevIBX-A] this requires enabling embedded DisplayPort)
2. Enable PCH clock reference source and PCH SSC modulator, wait for warmup (Can be done anytime before enabling port)
3. If enabling CPU embedded DisplayPort A: (Can be done anytime before enabling CPU pipe or port)
a. Enable PCH 120MHz clock source output to CPU, wait for DMI latency
b. Configure and enable CPU DisplayPort PLL in the DisplayPort A register, wait for warmup
4. If enabling port on PCH: (Must be done before enabling CPU pipe or FDI)
a. Enable PCH FDI Receiver PLL, wait for warmup plus DMI latency
b. Switch from Rawclk to PCDclk in FDI Receiver (FDI A OR FDI B)
c. [DevSNB] Enable CPU FDI Transmitter PLL, wait for warmup
d. [DevILK] CPU FDI PLL is always on and does not need to be enabled
5. Enable CPU panel fitter if needed for hires, required for VGA (Can be done anytime before enabling CPU pipe)
6. Configure CPU pipe timings, M/N/TU, and other pipe settings (Can be done anytime before enabling CPU pipe)
7. Enable CPU pipe
8. Configure and enable CPU planes (VGA or hires)
9. If enabling port on PCH:
a. [DevIBX-B+] Program PCH FDI Receiver TU size same as Transmitter TU size for TU error checking
b. Train FDI
i. Set pre-emphasis and voltage (iterate if training steps fail)
ii. Enable CPU FDI Transmitter and PCH FDI Receiver with Training Pattern 1 enabled.
iii. Wait for FDI training pattern 1 time
iv. Read PCH FDI Receiver ISR ([DevIBX-B+] IIR) for bit lock in bit 8 (retry at least once if no lock)
v. Enable training pattern 2 on CPU FDI Transmitter and PCH FDI Receiver
vi. Wait for FDI training pattern 2 time
vii. Read PCH FDI Receiver ISR ([DevIBX-B+] IIR) for symbol lock in bit 9 (retry at least once if no lock)
viii. Enable normal pixel output on CPU FDI Transmitter and PCH FDI Receiver
ix. Wait for FDI idle pattern time for link to become active
c. Configure and enable PCH DPLL, wait for PCH DPLL warmup (Can be done anytime before enabling PCH transcoder)
d. [DevCPT] Configure DPLL SEL to set the DPLL to transcoder mapping and enable DPLL to the transcoder.
e. [DevCPT] Configure DPLL_CTL DPLL_SDVO_HDMI_multipler.
f. Configure PCH transcoder timings, M/N/TU, and other transcoder settings (should match CPU settings).
g. [DevCPT] Configure and enable Transcoder DisplayPort Control if DisplayPort will be used
h. Enable PCH transcoder
10. Enable ports (DisplayPort must enable in training pattern 1)
11. Enable panel power through panel power sequencing
12. Wait for panel power sequencing to reach enabled steady state
13. Disable panel power override
14. If DisplayPort, complete link training
15. Enable panel backlight
Disable sequence
1. Disable Panel backlight
2. Disable panel power through panel power sequencing
3. Disable CPU planes (VGA or hires)
4. [DevILK-A] Disable CPU panel fitter
5. Disable CPU pipe
6. Wait for CPU pipe off status (CPU pipe config register pipe state)
7. [DevILK-B+ and DevSNB] Disable CPU panel fitter (Can be done anytime after CPU pipe is off)
8. If disabling CPU embedded DisplayPort A
a. Disable port
b. Disable CPU DisplayPort PLL in the DisplayPort A register
c. Disable PCH 120MHz clock source output to CPU
9. Else disabling port on PCH:
a. Disable CPU FDI Transmitter and PCH FDI Receiver
b. Disable sDVO ADD device
c. Disable port
d. Disable PCH transcoder
e. Wait for PCH transcoder off status (PCH transcoder config register transcoder state)
f. [DevCPT] Disable Transcoder DisplayPort Control if DisplayPort was used
g. [DevCPT] Disable Transcoder DPLL Enable bit in DPLL_SEL
h. Disable PCH DPLL (Can be done anytime after PCH ports and transcoder are off)
i. If no other PCH transcoder is enabled
i. Switch from PCDclk to Rawclk in PCH FDI Receiver
ii. [DevSNB] Disable CPU FDI Transmitter PLL
iii. Disable PCH FDI Receiver PLL
10. If SSC is no longer needed, disable PCH SSC modulator
11. If clock reference no longer needed, disable PCH clock reference source
Pipe timings change
Use complete disable sequence followed by complete enable sequence with new mode programmings.
Please note that pipe source size can be changed on the fly when panel fitting is enabled.
Notes
When using sDVO ADD device line stall, keep the sDVO port line stall input disabled programming the ADD device registers to prevent erratic stall behavior.

CPU FDI Transmitter should not be set to idle while PCH transcoder is enabled as this will cause PCH transcoder underflow.

#4 lore raw
In reply to Jesse Barnes

Hi!,
so what is the state of this ?

From: Adam Jackson <[email protected]>
To: [email protected]
Subject: [Intel-gfx] [PATCH 1/6] drm/i915/dp: Rename has_edp to is_pch_edp to reflect its real meaning
Date: Fri, 16 Jul 2010 14:46:27 -0400 (07/16/2010 07:46:27 PM)

seems that have something related to this.
Should I try yours patch in this email ?

Quoted 125 lines · Jesse Barnes

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=28739. We need to enable power to the panel with the AUX VDD bit in order to properly detect the eDP attached panel, and we also need to turn the panel on in case it was off when we started (as happens at resume time).

But this patch raises a couple of questions:
1) why does the first panel on sequence time out?
2) why do I need to unlock the panel protected regs?

Keith, I think this is your code, any ideas?

Thanks,
Jesse

drivers/gpu/drm/i915/i915_reg.h +1 -0
index 42c6024..b191f02 100644
@@ -2805,6 +2805,7 @@
 
 #define PCH_PP_STATUS		0xc7200
 #define PCH_PP_CONTROL		0xc7204
+#define  PANEL_UNLOCK_REGS	(0xabcd << 16)
 #define  EDP_FORCE_VDD		(1 << 3)
 #define  EDP_BLC_ENABLE		(1 << 2)
 #define  PANEL_POWER_RESET	(1 << 1)
drivers/gpu/drm/i915/intel_dp.c +60 -4
index b4f0282..a20dd7b 100644
@@ -744,6 +744,32 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
 	}
 }
 
+static void ironlake_edp_panel_on(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	unsigned long timeout = jiffies + msecs_to_jiffies(5000);
+	u32 pp, pp_status;
+
+	pp_status = I915_READ(PCH_PP_STATUS);
+	if (pp_status & PP_ON)
+		return;
+
+	DRM_DEBUG_KMS("\n");
+	pp = I915_READ(PCH_PP_CONTROL);
+	pp |= POWER_TARGET_ON;
+	I915_WRITE(PCH_PP_CONTROL, pp);
+	do {
+		pp_status = I915_READ(PCH_PP_STATUS);
+	} while (((pp_status & PP_ON) == 0) && !time_after(jiffies, timeout));
+
+	if (time_after(jiffies, timeout))
+		DRM_DEBUG_KMS("panel on wait timed out: 0x%08x\n", pp_status);
+
+	pp |= PANEL_UNLOCK_REGS;
+	pp &= ~EDP_FORCE_VDD;
+	I915_WRITE(PCH_PP_CONTROL, pp);
+}
+
 static void ironlake_edp_backlight_on (struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
@@ -755,6 +781,28 @@ static void ironlake_edp_backlight_on (struct drm_device *dev)
 	I915_WRITE(PCH_PP_CONTROL, pp);
 }
 
+static void ironlake_edp_panel_off(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	unsigned long timeout = jiffies + msecs_to_jiffies(5000);
+	u32 pp, pp_status;
+
+	DRM_DEBUG_KMS("\n");
+	pp = I915_READ(PCH_PP_CONTROL);
+	pp &= ~POWER_TARGET_ON;
+	I915_WRITE(PCH_PP_CONTROL, pp);
+	do {
+		pp_status = I915_READ(PCH_PP_STATUS);
+	} while ((pp_status & PP_ON) && !time_after(jiffies, timeout));
+
+	if (time_after(jiffies, timeout))
+		DRM_DEBUG_KMS("panel off wait timed out\n");
+
+	/* Make sure VDD is enabled so DP AUX will work */
+	pp |= EDP_FORCE_VDD;
+	I915_WRITE(PCH_PP_CONTROL, pp);
+}
+
 static void ironlake_edp_backlight_off (struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
@@ -776,16 +824,24 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode)
 	uint32_t dp_reg = I915_READ(dp_priv->output_reg);
 
 	if (mode != DRM_MODE_DPMS_ON) {
+		if (IS_eDP(intel_encoder) || IS_PCH_eDP(dp_priv)) {
+			ironlake_edp_backlight_off(dev);
+			ironlake_edp_panel_off(dev);
+		}
 		if (dp_reg & DP_PORT_EN) {
 			intel_dp_link_down(intel_encoder, dp_priv->DP);
-			if (IS_eDP(intel_encoder) || IS_PCH_eDP(dp_priv))
-				ironlake_edp_backlight_off(dev);
 		}
 	} else {
+		/* Turn off the panel so we can modify DP_A etc */
+		if (IS_eDP(intel_encoder) || IS_PCH_eDP(dp_priv))
+			ironlake_edp_panel_off(dev);
 		if (!(dp_reg & DP_PORT_EN)) {
 			intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration);
-			if (IS_eDP(intel_encoder) || IS_PCH_eDP(dp_priv))
-				ironlake_edp_backlight_on(dev);
+		}
+		if (IS_eDP(intel_encoder) || IS_PCH_eDP(dp_priv)) {
+			if (I915_READ(dp_priv->output_reg) & DP_PORT_EN)
+				ironlake_edp_panel_on(dev);
+			ironlake_edp_backlight_on(dev);
 		}
 	}
 	dp_priv->dpms_mode = mode;

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

Signature · 1 line
Sérgio M. B.

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

#5 lore raw
In reply to Jesse Barnes
Quoted 10 lines · On Wed, 14 Jul 2010 15:40:56 -0700 Jesse Barnes <[email protected]>…

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=28739. We need to enable power to the panel with the AUX VDD bit in order to properly detect the eDP attached panel, and we also need to turn the panel on in case it was off when we started (as happens at resume time).

But this patch raises a couple of questions:
1) why does the first panel on sequence time out?
2) why do I need to unlock the panel protected regs?

Keith, I think this is your code, any ideas?

Just posted a more minimal fix and separated out the register patch. Apparently we just need to unlock the panel regs around the actual power on sequence. Talking with the hw guys about this now as there may be a better workaround to the broken panel sequencing logic.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center