OSDN Git Service

drm: mxsfb: check framebuffer pitch
authorStefan Agner <stefan@agner.ch>
Tue, 8 Sep 2020 14:16:54 +0000 (16:16 +0200)
committerStefan Agner <stefan@agner.ch>
Wed, 16 Sep 2020 09:13:27 +0000 (11:13 +0200)
commitd5a0c816900419105a12e7471bf074319dfa34be
tree2c3638d623d4395cffed35eb7f1d45331ba1dfea
parentdd425545a8cc57ae99515e771e87a4465e2f43dc
drm: mxsfb: check framebuffer pitch

The lcdif IP does not support a framebuffer pitch (stride) other than
framebuffer width. Check for equality and reject the framebuffer
otherwise.

This prevents a distorted picture when using 640x800 and running the
Mesa graphics stack. Mesa tries to use a cache aligned stride, which
leads at that particular resolution to width != stride. Currently
Mesa has no fallback behavior, but rejecting this configuration allows
userspace to handle the issue correctly.

Fixes: 45d59d704080 ("drm: Add new driver for MXSFB controller")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200908141654.266836-1-stefan@agner.ch
drivers/gpu/drm/mxsfb/mxsfb_drv.c