Commit fd9e3169 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/simpledrm: Compute framebuffer stride if not set

Compute the framebuffer's scanline stride length if not given by
the simplefb data.

v3:
	* get pixel size from drm_format_info_bpp() (Geert, Javier)
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220801135028.30647-5-tzimmermann@suse.de
parent 802fd575
......@@ -743,6 +743,9 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,
drm_err(dev, "no simplefb configuration found\n");
return ERR_PTR(-ENODEV);
}
if (!stride)
stride = DIV_ROUND_UP(drm_format_info_bpp(format, 0) * width, 8);
sdev->mode = simpledrm_mode(width, height);
sdev->format = format;
sdev->pitch = stride;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment