Bug 103400

Summary: [KBL] Black screen at boot, unknown DP link BW code 0 warning
Product: DRI Reporter: Nicolas P. <issun.artiste>
Component: DRM/IntelAssignee: Intel GFX Bugs mailing list <intel-gfx-bugs>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: intel-gfx-bugs
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard: PatchSubmitted
i915 platform: KBL i915 features: display/eDP
Attachments:
Description Flags
dmesg from drm-tip with drm.debug=0x1e (commit: 9dd506b9e3b79799503694e9c1bb5aba0d7d72eb)
none
edid
none
dpcd none

Description Nicolas P. 2017-10-22 01:04:05 UTC
Created attachment 134984 [details]
dmesg from drm-tip with drm.debug=0x1e (commit: 9dd506b9e3b79799503694e9c1bb5aba0d7d72eb)

Hello,

Kernel version: At least since 4.9 (previous versions unteseted), up
                until latest drm-tip
Linux distribution: Archlinux
Machine model: MSI GE63VF 7RF (Intel i7 7700HQ with HD Graphics 630)
Display connector: eDP

Description:
While booting, my laptop's screen turns black (with backlights on) when
the i915 module is loaded. The virtual console doesn't show up and Xorg
wont start. The only way to get my virtual console displayed is by
passing nomodeset as kernel parameter. I've observed this issue on
kernel version 4.9, 4.13, 4.14-rc5 and finally on the current head of
drm-tip. The following warning can be noticed with the latest drm-tip:

> [   16.096671] unknown DP link BW code 0, using 162000
> [   16.096685] ------------[ cut here ]------------
> [   16.096688] WARNING: CPU: 0 PID: 316 at drivers/gpu/drm/drm_dp_helper.c:157 drm_dp_bw_code_to_link_rate+0x3b/0x50 [drm_kms_helper]

Since it's a bit long, I didn't paste the entire warning, it can be found
in the enclosed dmesg.
I noticed that the warning location changed between the kernel mainline
and the drm-tip branch, but it seems to refer to the same problem. Here
are the first line of the warning on the kernel mainline (if it's
required, I could provide this dmesg too):

> invalid max DP link bw val 0, using 1.62Gbps
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 318 at drivers/gpu/drm/i915/intel_dp.c:144 intel_dp_num_rates+0x3b/0x50 [i915]

Also, this only affects my laptop's screen, I can use an external
display since it goes through my Nvidia card.

If you need any further information, please just ask.
Best regards,
Comment 1 Jani Nikula 2017-10-25 10:07:13 UTC
I think the problem is that your display has incorrect eDP DPCD information (bit 3 of DPCD register 0x006 is not set, instead the whole register is set to 0x03). Please try this debug patch to see if it helps:

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index aa75f55eeb61..b2bb7d2941f3 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3736,8 +3736,7 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp)
 	}
 
 	/* Read the eDP Display control capabilities registers */
-	if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP] & DP_DPCD_DISPLAY_CONTROL_CAPABLE) &&
-	    drm_dp_dpcd_read(&intel_dp->aux, DP_EDP_DPCD_REV,
+	if (drm_dp_dpcd_read(&intel_dp->aux, DP_EDP_DPCD_REV,
 			     intel_dp->edp_dpcd, sizeof(intel_dp->edp_dpcd)) ==
 			     sizeof(intel_dp->edp_dpcd))
 		DRM_DEBUG_KMS("EDP DPCD : %*ph\n", (int) sizeof(intel_dp->edp_dpcd),

Please let us know the contents of that "EDP DPCD" debug message with this change.
Comment 2 Nicolas P. 2017-10-25 22:36:53 UTC
Hello,

Thanks for your reply.
The patch indeed helps : with it, my virtual console now shows up
successfully without nomodeset.
Here's the content of EDP DPCD with the debug patch:
> $ dmesg | grep "EDP DPCD"
> [   19.924664] [drm:intel_dp_init_connector [i915]] EDP DPCD : 12 00 00

Best regards,
Comment 3 Jani Nikula 2017-10-26 12:00:56 UTC
(In reply to Nicolas P. from comment #2)
> The patch indeed helps : with it, my virtual console now shows up
> successfully without nomodeset.

Thanks for testing.

> Here's the content of EDP DPCD with the debug patch:
> > $ dmesg | grep "EDP DPCD"
> > [   19.924664] [drm:intel_dp_init_connector [i915]] EDP DPCD : 12 00 00

Auch, that's garbage too, in violation of the eDP spec. :(

I'll try to cook up something.
Comment 4 Jani Nikula 2017-10-26 14:36:25 UTC
Effectively same patch as comment #1, with polish:

http://patchwork.freedesktop.org/patch/msgid/20171026142932.17737-1-jani.nikula@intel.com
Comment 5 Ville Syrjala 2017-10-26 14:49:59 UTC
Can you please attach the entire DPCD here for posterity? Oh and EDID would be nice as well.

This should normally work (needs CONFIG_DRM_DP_AUX_CHARDEV=y in the kernel config):
cat /dev/drm_dp_aux0 > dpcd
But if there are read errors you will have to use someting like ddrescue to read it out.

For the EDID you can use:
cat /sys/class/drm/card0-eDP-1/edid > edid
Comment 6 Nicolas P. 2017-10-26 19:22:18 UTC
Hello,

Jani Nikula 2017-10-26 14:36:25 UTC:
> Effectively same patch as comment #1, with polish:

Thanks a lot. :)

Ville Syrjala 2017-10-26 14:49:59 UTC:
> Can you please attach the entire DPCD here for posterity? Oh and EDID would be nice as well.

Sure, I will attach them right away.

Best regards,
Comment 7 Nicolas P. 2017-10-26 19:22:43 UTC
Created attachment 135089 [details]
edid
Comment 8 Nicolas P. 2017-10-26 19:23:19 UTC
Created attachment 135090 [details]
dpcd
Comment 9 Jani Nikula 2017-10-27 10:29:18 UTC
Fixed by

commit 0501a3b0eb01ac2209ef6fce76153e5d6b07034e
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Thu Oct 26 17:29:31 2017 +0300

    drm/i915/edp: read edp display control registers unconditionally

and cc: stable to backport it to stable kernels.

Thanks for the report and testing.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.