mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
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: Thomas Zimmermann <[email protected]> Acked-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
This commit is contained in:
1 parent
802fd5750f
commit
fd9e3169e4
1 file changed
+3
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user