From mboxrd@z Thu Jan 1 00:00:00 1970 From: Erik Jacobson Subject: unreadable external HDMI display in recent kernels, work around Date: Fri, 9 Dec 2016 12:28:28 -0600 Message-ID: <20161209182828.GA23583@tdkt.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="17pEHd4RhPHOinZp" Return-path: Received: from hapkido.dreamhost.com (hapkido.dreamhost.com [66.33.216.122]) by gabe.freedesktop.org (Postfix) with ESMTPS id B90E36E21C for ; Sat, 10 Dec 2016 06:33:03 +0000 (UTC) Received: from homiemail-a119.g.dreamhost.com (sub5.mail.dreamhost.com [208.113.200.129]) by hapkido.dreamhost.com (Postfix) with ESMTP id 7B88FE9717 for ; Fri, 9 Dec 2016 10:28:31 -0800 (PST) Received: from homiemail-a119.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a119.g.dreamhost.com (Postfix) with ESMTP id CD3EE60001202 for ; Fri, 9 Dec 2016 10:28:30 -0800 (PST) Received: from tdkt.org (c-24-118-62-93.hsd1.mn.comcast.net [24.118.62.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: erikj@tdkt.org) by homiemail-a119.g.dreamhost.com (Postfix) with ESMTPSA id 990D760001200 for ; Fri, 9 Dec 2016 10:28:30 -0800 (PST) Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I hope this email finds you well. I apologize as I'm not a graphics kernel developer. I hope we don't discover that this email is a complete newbie email. Problem: External HDMI display is unreadable. You can make out edges of windows and other stuff. Other than that it looks like a garbled mess of colors. Work around: See below and attached proof of concept patch. HW: - IdeaPad y510P (i7 notebook) - Intel and NVIDIA graphics (Intel primary) -> 00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06) -> 01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GT 755M] (rev a1) - Monitor: External HDMI Acer H243H SW - Problem Started in a Fedora23 update (Fedora23 GA was OK. -> I would guess it happened with the switch to the 4.8 series Good: kernel-4.2.3-300.fc23, bad: kernel-4.8.10-100.fc23 - Fedora 25 has the problem - OpenSUSE Leap 42.2 has the problem - drm-intel drm-intel-nightly branch kernel has the problem - Latest kernel.org versions have the problem Research and Work Around Besides building several different kernels to see where the problems were, I booted the kernel with the drm.debug=14 option and looked carefully at the output. I found these interesting lines: Working OLD Fedora23 GA kernel kernel-4.2.3-300.fc23: [ 2.895638] [drm:intel_modeset_stage_output_state] [CONNECTOR:42:HDMI-A-1] to [CRTC:25] [ 2.895639] [drm:connected_sink_compute_bpp] [CONNECTOR:42:HDMI-A-1] checking for sink bpp constrains [ 2.895640] [drm:connected_sink_compute_bpp] clamping display bpp (was 36) to EDID reported max of 30 [ 2.895642] [drm:intel_hdmi_compute_config] picking bpc to 8 for HDMI output [ 2.895642] [drm:intel_hdmi_compute_config] forcing pipe bpc to 24 for HDMI [ 2.895643] [drm:intel_crtc_compute_config] intel_crtc = ffff880360b76000 drm_state (pipe_config->base.state) = ffff88035c7d5ae0 [ 2.895643] [drm:intel_modeset_pipe_config] plane bpp: 36, pipe bpp: 24, dithering: 0 [ 2.895644] [drm:intel_dump_pipe_config] [CRTC:25][modeset] config ffff88035d3bd000 for pipe B [ 2.895644] [drm:intel_dump_pipe_config] cpu_transcoder: B [ 2.895644] [drm:intel_dump_pipe_config] pipe bpp: 24, dithering: 0 Broken new Fedora25 kernel 4.8.11-300.fc25 [ 2.625766] [drm:connected_sink_compute_bpp] [CONNECTOR:47:HDMI-A-1] checking for sink bpp constrains [ 2.625767] [drm:connected_sink_compute_bpp] clamping display bpp (was 36) to EDID reported max of 30 [ 2.625769] [drm:intel_hdmi_compute_config] picking bpc to 12 for HDMI output [ 2.625769] [drm:intel_hdmi_compute_config] forcing pipe bpc to 36 for HDMI [ 2.625770] [drm:intel_modeset_pipe_config] hw max bpp: 36, pipe bpp: 36, dithering: 0 [ 2.625770] [drm:intel_dump_pipe_config] [CRTC:30:pipe B][modeset] config ffffa2f99ba00800 for pipe B When I saw that the 'bpc' that was decided on differed, I used this information and made a patch to the drm i915 driver in the kernel. It is obviously not a solution but a proof of concept. The patch changes the intel_hdmi_compute_config() function in intel_hdmi.c to always pick bpc 8 and never try to use 12. I have attached the proof of concept patch to this email. Once I showed the proof of concept worked, I rebuilt the Fedora25 4.8.11-300.fc25 rpms with the patch and installed them. It is working great. I am not an expert in this area. However, if the problem is some sort of issue that my HDMI monitor is mis-reporting, one idea would be to expose yet another module parameter option to force the bpc value. Then people with the offending hw combination like me could use normal kernels and simply add the option. I do not know if that is a reasonable solution. I did try to explore some EDID options (I guess you can supply your own in /usr/lib/firmware and the initrd) but it seemed like it wasn't likely to solve this specific issue. Please tell me if that was incorrect! I'm hoping someone will help me out by saying I missed an obvious easy solution. Then I will crawl back in to my cave, happy :) Best wishes everybody, Erik --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch-erikj-fedora-force-i915-hdmi-8-bpp.patch" >>From zz Fri Dec 9 00:01:20 CST 2016 From: Erik Jacobson Date: Fri Dec 9 00:01:59 CST 2016 Subject: Fix Erik's i915 acer external hdmi monitor hdmi Fix my hdmi monitor Signed-off-by: Erik Jacobson diff -Narup kernel-4.8.fc25-ORIG/linux-4.8.11-300.fc25.x86_64/drivers/gpu/drm/i915/intel_hdmi.c kernel-4.8.fc25/linux-4.8.11-300.fc25.x86_64/drivers/gpu/drm/i915/intel_hdmi.c --- a/drivers/gpu/drm/i915/intel_hdmi.c 2016-12-08 23:49:38.385708682 -0600 +++ b/drivers/gpu/drm/i915/intel_hdmi.c 2016-12-08 23:53:00.677599745 -0600 @@ -1327,20 +1327,27 @@ bool intel_hdmi_compute_config(struct in * outputs. We also need to check that the higher clock still fits * within limits. */ - if (pipe_config->pipe_bpp > 8*3 && pipe_config->has_hdmi_sink && - hdmi_port_clock_valid(intel_hdmi, clock_12bpc, true) == MODE_OK && - hdmi_12bpc_possible(pipe_config)) { - DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n"); - desired_bpp = 12*3; +/* erikj forcing 8 */ +// if (pipe_config->pipe_bpp > 8*3 && pipe_config->has_hdmi_sink && +// hdmi_port_clock_valid(intel_hdmi, clock_12bpc, true) == MODE_OK && +// hdmi_12bpc_possible(pipe_config)) { +// DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n"); +// desired_bpp = 12*3; +// +// /* Need to adjust the port link by 1.5x for 12bpc. */ +// pipe_config->port_clock = clock_12bpc; +// } else { +// DRM_DEBUG_KMS("picking bpc to 8 for HDMI output\n"); +// desired_bpp = 8*3; +// +// pipe_config->port_clock = clock_8bpc; +// } +/* erikj here is the force */ + DRM_DEBUG_KMS("erikj force-picking bpc to 8 for HDMI output\n"); + desired_bpp = 8*3; - /* Need to adjust the port link by 1.5x for 12bpc. */ - pipe_config->port_clock = clock_12bpc; - } else { - DRM_DEBUG_KMS("picking bpc to 8 for HDMI output\n"); - desired_bpp = 8*3; - - pipe_config->port_clock = clock_8bpc; - } + pipe_config->port_clock = clock_8bpc; +/* end erikj */ if (!pipe_config->bw_constrained) { DRM_DEBUG_KMS("forcing pipe bpc to %i for HDMI\n", desired_bpp); --17pEHd4RhPHOinZp Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --17pEHd4RhPHOinZp--