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>
This commit is contained in:
Geert Uytterhoeven 2013-03-12 14:19:25 +01:00
parent 5c509c360d
commit 1049b32166

View File

@ -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) {