[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211018132341.499234552@linuxfoundation.org>
Date: Mon, 18 Oct 2021 15:23:24 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Thomas Zimmermann <tzimmermann@...e.de>,
Ville Syrjälä
<ville.syrjala@...ux.intel.com>,
Alex Deucher <alexander.deucher@....com>,
Amanoel Dawod <kernel@...noeldawod.com>,
Zoltán Kővágó
<dirty.ice.hu@...il.com>,
Michael Stapelberg <michael+lkml@...pelberg.ch>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Maxime Ripard <maxime@...no.tech>,
dri-devel@...ts.freedesktop.org, Dave Airlie <airlied@...hat.com>
Subject: [PATCH 5.14 025/151] drm/fbdev: Clamp fbdev surface size if too large
From: Thomas Zimmermann <tzimmermann@...e.de>
commit b693e42921e0220c0d564c55c6cdc680b0f85390 upstream.
Clamp the fbdev surface size of the available maximumi height to avoid
failing to init console emulation. An example error is shown below.
bad framebuffer height 2304, should be >= 768 && <= 768
[drm] Initialized simpledrm 1.0.0 20200625 for simple-framebuffer.0 on minor 0
simple-framebuffer simple-framebuffer.0: [drm] *ERROR* fbdev: Failed to setup generic emulation (ret=-22)
This is especially a problem with drivers that have very small screen
sizes and cannot over-allocate at all.
v2:
* reduce warning level (Ville)
Signed-off-by: Thomas Zimmermann <tzimmermann@...e.de>
Fixes: 11e8f5fd223b ("drm: Add simpledrm driver")
Reviewed-by: Ville Syrjälä <ville.syrjala@...ux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@....com>
Reported-by: Amanoel Dawod <kernel@...noeldawod.com>
Reported-by: Zoltán Kővágó <dirty.ice.hu@...il.com>
Reported-by: Michael Stapelberg <michael+lkml@...pelberg.ch>
Cc: Daniel Vetter <daniel.vetter@...ll.ch>
Cc: Maxime Ripard <maxime@...no.tech>
Cc: dri-devel@...ts.freedesktop.org
Cc: <stable@...r.kernel.org> # v5.14+
Link: https://patchwork.freedesktop.org/patch/msgid/20211005070355.7680-1-tzimmermann@suse.de
Signed-off-by: Dave Airlie <airlied@...hat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/gpu/drm/drm_fb_helper.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1506,6 +1506,7 @@ static int drm_fb_helper_single_fb_probe
{
struct drm_client_dev *client = &fb_helper->client;
struct drm_device *dev = fb_helper->dev;
+ struct drm_mode_config *config = &dev->mode_config;
int ret = 0;
int crtc_count = 0;
struct drm_connector_list_iter conn_iter;
@@ -1663,6 +1664,11 @@ static int drm_fb_helper_single_fb_probe
/* Handle our overallocation */
sizes.surface_height *= drm_fbdev_overalloc;
sizes.surface_height /= 100;
+ if (sizes.surface_height > config->max_height) {
+ drm_dbg_kms(dev, "Fbdev over-allocation too large; clamping height to %d\n",
+ config->max_height);
+ sizes.surface_height = config->max_height;
+ }
/* push down into drivers */
ret = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes);
Powered by blists - more mailing lists