From patchwork Fri Dec 9 18:28:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Jacobson X-Patchwork-Id: 9469179 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 193D7602F0 for ; Sat, 10 Dec 2016 06:33:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F310028417 for ; Sat, 10 Dec 2016 06:33:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E45B128493; Sat, 10 Dec 2016 06:33:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1ED6D28417 for ; Sat, 10 Dec 2016 06:33:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 835AD6E21C; Sat, 10 Dec 2016 06:33:05 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org X-Greylist: delayed 43471 seconds by postgrey-1.35 at gabe; Sat, 10 Dec 2016 06:33:03 UTC 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) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=tdkt.org; h=date:from:to :subject:message-id:mime-version:content-type; s=tdkt.org; bh=Mw YTF6hqOBPqayokx42SUdhl2GA=; b=V30t0QQ0RAKHYJiHhCz6T1Kiu6SytoOo0v Q5DIynmPJbfps+/Cwoxl7RB9eh1GtWDLEhnFP18wX8QBWv7u6xjL4JX9wWGiCq1s WxFT9C0nkk4Z1wDC++651eNmMi10SqconzF1ePe0lCoZcwy3b901HfEW+5WWae0L m9jAfb6vQ= 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) Date: Fri, 9 Dec 2016 12:28:28 -0600 From: Erik Jacobson To: intel-gfx@lists.freedesktop.org Message-ID: <20161209182828.GA23583@tdkt.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) Subject: [Intel-gfx] unreadable external HDMI display in recent kernels, work around X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 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);