]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
offb: Fix bug in calculating requested vram size
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 3 Jan 2012 01:09:15 +0000 (12:09 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Jan 2012 19:40:01 +0000 (11:40 -0800)
commit c055fe0797b7bd8f6f21a13598a55a16d5c13ae7 upstream.

We used to try to request 8 times more vram than needed, which would
fail if the card has a too small BAR (observed with qemu & kvm).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/video/offb.c

index f1e900343ff445a9a306a6d1ffadbcbca73710ad..dbc8274281e8e259998152eb627d233f54e68e77 100644 (file)
@@ -377,7 +377,7 @@ static void __init offb_init_fb(const char *name, const char *full_name,
                                int pitch, unsigned long address,
                                int foreign_endian, struct device_node *dp)
 {
-       unsigned long res_size = pitch * height * (depth + 7) / 8;
+       unsigned long res_size = pitch * height;
        struct offb_par *par = &default_par;
        unsigned long res_start = address;
        struct fb_fix_screeninfo *fix;