From: Benjamin Herrenschmidt Date: Tue, 3 Jan 2012 01:09:15 +0000 (+1100) Subject: offb: Fix bug in calculating requested vram size X-Git-Tag: firefly_0821_release~7541^2~2007 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=68530d7210025a1e395819b774fcffaf943dd8f3;p=firefly-linux-kernel-4.4.55.git offb: Fix bug in calculating requested vram size 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/video/offb.c b/drivers/video/offb.c index 24e1fc6b5658..3251a0236d56 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c @@ -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;