All of lore.kernel.org
 help / color / mirror / Atom feed
From: Erik Jacobson <erikj@tdkt.org>
To: intel-gfx@lists.freedesktop.org
Subject: unreadable external HDMI display in recent kernels, work around
Date: Fri, 9 Dec 2016 12:28:28 -0600	[thread overview]
Message-ID: <20161209182828.GA23583@tdkt.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 4159 bytes --]

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

[-- Attachment #2: patch-erikj-fedora-force-i915-hdmi-8-bpp.patch --]
[-- Type: text/plain, Size: 2056 bytes --]

>From zz Fri Dec  9 00:01:20 CST 2016
From: Erik Jacobson <erikj@tdkt.org>
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 <erikj@tdkt.org>

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);

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

                 reply	other threads:[~2016-12-10  6:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161209182828.GA23583@tdkt.org \
    --to=erikj@tdkt.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.