summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2013-03-12 14:19:25 +0100
committerGeert Uytterhoeven <geert@linux-m68k.org>2013-04-18 13:10:25 +0200
commit1049b32166760bdc00106625e213d31a8fc60bad (patch)
tree4d24eff084ee4038fc0cddb6edc8c4a09bfa0c0b /hw
parent5c509c360d97bea78ef461596ab4b7bde69020ac (diff)
Xfbdev: Handle unset fix.line_length
Older frame buffer devices may not fill in fix.line_length, in which case it must be calculated by the application. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/fbdev/fbdev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c
index a8d36c6ac..7b29f42cd 100644
--- a/hw/kdrive/fbdev/fbdev.c
+++ b/hw/kdrive/fbdev/fbdev.c
@@ -206,6 +206,10 @@ fbdevScreenInitialize(KdScreenInfo * screen, FbdevScrPriv * scrpriv)
depth = priv->var.bits_per_pixel;
gray = priv->var.grayscale;
+ /* Calculate fix.line_length if it's zero */
+ if (!priv->fix.line_length)
+ priv->fix.line_length = (priv->var.xres_virtual * depth + 7) / 8;
+
switch (priv->fix.visual) {
case FB_VISUAL_PSEUDOCOLOR:
if (gray) {