]> git.baikalelectronics.ru Git - kernel.git/commit
drm/fbdev: Clamp fbdev surface size if too large
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 5 Oct 2021 07:03:55 +0000 (09:03 +0200)
committerDave Airlie <airlied@redhat.com>
Fri, 15 Oct 2021 05:04:05 +0000 (15:04 +1000)
commit0780d68806cfc9c675369b8e29df177657b7f944
tree93d5315d6d0fb4a7c3cff167225db2a6597b2b62
parentc4545eef69df69e218250dd997f016af8f5365aa
drm/fbdev: Clamp fbdev surface size if too large

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@suse.de>
Fixes: b7390008b818 ("drm: Add simpledrm driver")
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reported-by: Amanoel Dawod <kernel@amanoeldawod.com>
Reported-by: Zoltán Kővágó <dirty.ice.hu@gmail.com>
Reported-by: Michael Stapelberg <michael+lkml@stapelberg.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v5.14+
Link: https://patchwork.freedesktop.org/patch/msgid/20211005070355.7680-1-tzimmermann@suse.de
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_fb_helper.c