[PATCH] i915: use surface size for bios fb size check

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

 



Lenovo laptop BIOS (possibly others too) provides a framebuffer with the size 
of the primary display. The primary display by this BIOS as the internal display
(lid open) or external display (lid closed).

Thus, if the external display supports higher resolution than the internal one, 
and the lid is open during boot, the BIOS allocated frame buffer size is not 
enough for the preferred resolution of the external display.

This causes the framebuffer select non-preferred mode for the external display.
And this causes resolution change (and screen flicker) when switching between
framebuffer mode and drm mode (X11/Plymouth).

This patch modifies the frame buffer size logic to ensure that the framebuffer 
size is compared against maximum surface size (real screen resolution) so that 
the BIOS framebuffer is not reused if it's too small for all monitors.
---
 drivers/gpu/drm/i915/display/intel_fbdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index df05d28..291dc8a 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -192,13 +192,13 @@ static int intelfb_create(struct drm_fb_helper *helper,
 	int ret;
 
 	if (intel_fb &&
-	    (sizes->fb_width > intel_fb->base.width ||
-	     sizes->fb_height > intel_fb->base.height)) {
+	    (sizes->surface_width > intel_fb->base.width ||
+	     sizes->surface_height > intel_fb->base.height)) {
 		drm_dbg_kms(&dev_priv->drm,
 			    "BIOS fb too small (%dx%d), we require (%dx%d),"
 			    " releasing it\n",
 			    intel_fb->base.width, intel_fb->base.height,
-			    sizes->fb_width, sizes->fb_height);
+			    sizes->surface_width, sizes->surface_height);
 		drm_framebuffer_put(&intel_fb->base);
 		intel_fb = ifbdev->fb = NULL;
 	}
-- 
2.15.0




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux