[PATCH 67/91] offb: Fix bug in calculating requested vram size

From: Willy Tarreau
Date: Sun Feb 05 2012 - 17:39:22 EST


2.6.27-longterm review patch. If anyone has any objections, please let us know.

------------------

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@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
drivers/video/offb.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

Index: longterm-2.6.27/drivers/video/offb.c
===================================================================
--- longterm-2.6.27.orig/drivers/video/offb.c 2012-02-05 22:34:44.268915456 +0100
+++ longterm-2.6.27/drivers/video/offb.c 2012-02-05 22:34:44.406915262 +0100
@@ -368,7 +368,7 @@
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;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/