mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 22:03:17 +01:00
drm/simpledrm: Compute linestride with drm_format_info_min_pitch()
If not given, compute the stride with drm_format_info_min_pitch(). It's
the standard helper for this purpose.
Suggested-by: Daniel Vetter <[email protected]>
Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Fixes: fd9e3169e4 ("drm/simpledrm: Compute framebuffer stride if not set")
Cc: Javier Martinez Canillas <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
This commit is contained in:
1 parent
c7bcc1056c
commit
7bfa5c7b28
1 file changed
+5
-2
@@ -687,8 +687,11 @@ 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);
|
||||
if (!stride) {
|
||||
stride = drm_format_info_min_pitch(format, 0, width);
|
||||
if (drm_WARN_ON(dev, !stride))
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
sdev->mode = simpledrm_mode(width, height);
|
||||
sdev->format = format;
|
||||
|
||||
Reference in new issue
Block a user