summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/tiny/simpledrm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
index 9d27608d7369..11a7348ccf4d 100644
--- a/drivers/gpu/drm/tiny/simpledrm.c
+++ b/drivers/gpu/drm/tiny/simpledrm.c
@@ -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;