Older frame buffer devices may not fill in var.bits_per_pixel, in which
case it must be calculated by the application.

Signed-off-by: Geert Uytterhoeven <ge...@linux-m68k.org>
---
 hw/kdrive/fbdev/fbdev.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c
index a8d36c6..7b29f42 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) {
-- 
1.7.0.4


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/1364390451-9656-8-git-send-email-ge...@linux-m68k.org

Reply via email to