On the 2015 MacBook Pro and the 12" MacBook, the firmware reports a 
framebuffer size of 2880x1800 but the screens are 2560x1600 and 
2304x1440.  Our console ends up drawing text off screen and the 
latest few lines can't be read.

Once X loads, it probes the outputs again and uses the proper 
resolution.

For the console, the outputs are already being probed but the BIOS 
resolution is only discarded if it's too small.  I'd like to change 
it to discard it if it's too large as well, so it uses the actual 
resolution probed.

On a machine like a server where inteldrm loads but has nothing 
connected, intel_fb is null, so this code doesn't run.


Index: sys/dev/pci/drm/i915/intel_fbdev.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/i915/intel_fbdev.c,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 intel_fbdev.c
--- sys/dev/pci/drm/i915/intel_fbdev.c  1 Jul 2017 16:14:10 -0000       1.3
+++ sys/dev/pci/drm/i915/intel_fbdev.c  23 Jul 2018 17:58:03 -0000
@@ -202,10 +202,9 @@ static int intelfb_create(struct drm_fb_
        mutex_lock(&dev->struct_mutex);
 
        if (intel_fb &&
-           (sizes->fb_width > intel_fb->base.width ||
-            sizes->fb_height > intel_fb->base.height)) {
-               DRM_DEBUG_KMS("BIOS fb too small (%dx%d), we require (%dx%d),"
-                             " releasing it\n",
+           (sizes->fb_width != intel_fb->base.width ||
+            sizes->fb_height != intel_fb->base.height)) {
+               DRM_DEBUG_KMS("BIOS fb %dx%d != %dx%d, releasing it\n",
                              intel_fb->base.width, intel_fb->base.height,
                              sizes->fb_width, sizes->fb_height);
                drm_framebuffer_unreference(&intel_fb->base);

Reply via email to