tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: framebuffer refresh rate and geometry



On Mon, 11 Apr 2022, Emmanuel Dreyfus wrote:

When the kernel initialize a framebuffer, the signal ouput changes a bit
fro mwhat is inherited from the BIOS. I face the situation where the
display looses the signal, and I suspect this is related to the refresh
rate.


OK, I'm able to get a usable UEFI console (intelfb) with the hack below
(starting X, however, immediately locks up the system):

```
diff -urN a/sys/external/bsd/drm2/dist/drm/i915/display/intel_lvds.c b/sys/external/bsd/drm2/dist/drm/i915/display/intel_lvds.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_lvds.c	2021-12-18 23:45:30.000000000 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_lvds.c	2022-04-12 10:28:48.162488466 +0000
@@ -962,11 +962,6 @@
 	if (fixed_mode)
 		goto out;

-	/* Failed to get EDID, what about VBT? */
-	fixed_mode = intel_panel_vbt_fixed_mode(intel_connector);
-	if (fixed_mode)
-		goto out;
-
 	/*
 	 * If we didn't get EDID, try checking if the panel is already turned
 	 * on.  If so, assume that whatever is currently programmed is the
@@ -977,8 +972,12 @@
 		DRM_DEBUG_KMS("using current (BIOS) mode: ");
 		drm_mode_debug_printmodeline(fixed_mode);
 		fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
+		goto out;
 	}

+	/* Failed to get current mode, what about VBT? */
+	fixed_mode = intel_panel_vbt_fixed_mode(intel_connector);
+
 	/* If we still don't have a mode after all that, give up. */
 	if (!fixed_mode)
 		goto failed;
```

Going by the kernel messages, on 9.2, the old DRM fails to find a VBT:

```
kern info: [drm] failed to find VBIOS tables
i915drmkms0: interrupting at ioapic0 pin 16 (i915drmkms0)
intelfb0 at i915drmkms0
intelfb0: framebuffer at 0xffffd700687fb000, size 1366x768, depth 32, stride 5504
kern error: [drm:(/usr/src/sys/external/bsd/drm2/dist/drm/i915/intel_fifo_underrun.c:230)cpt_set_fifo_underrun_reporting] *ERROR* uncleared pch fifo underrun on pch transcoder A
kern error: [drm:(/usr/src/sys/external/bsd/drm2/dist/drm/i915/intel_fifo_underrun.c:381)intel_pch_fifo_underrun_irq_handler] *ERROR* PCH transcoder A FIFO underrun
wsdisplay0 at intelfb0 kbdmux 1: console (default, vt100 emulation), using wskbd0
```

but, somehow still picks the correct native mode (1366x768) and everything is fine. The new DRM code, _does_ seem to find a VBT, but picks a non-native resolution (1024x768) in UEFI mode and the display gets messed up. In CSM mode, 1366x768 is correctly picked from the VBT.

I'll try to chase this down further when I have the time, but, somebody who
_knows_ this stuff would obviously make quicker progress.

-RVP


Home | Main Index | Thread Index | Old Index