diff options
-rw-r--r-- | packages/linux/linux-openmoko/glamo-report-vram-size-to-userspace.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/packages/linux/linux-openmoko/glamo-report-vram-size-to-userspace.patch b/packages/linux/linux-openmoko/glamo-report-vram-size-to-userspace.patch new file mode 100644 index 0000000000..563923e71c --- /dev/null +++ b/packages/linux/linux-openmoko/glamo-report-vram-size-to-userspace.patch @@ -0,0 +1,67 @@ +From ff1564e5100eeccd53ee6b007813ea722f8cf8b6 Mon Sep 17 00:00:00 2001 +From: Chia-I Wu <olv@openmoko.com> +Date: Mon, 1 Oct 2007 21:16:46 +0800 +Subject: [PATCH] glamo: report vram size to userspace + +Set fb_fix_screeninfo.smem_len to RESSIZE(fb_res). This is not the real +vram size, as it is a hardcoded value in glamo-core.c for now. +--- + drivers/video/glamo/glamo-fb.c | 13 +++++-------- + 1 files changed, 5 insertions(+), 8 deletions(-) + +diff --git a/drivers/video/glamo/glamo-fb.c b/drivers/video/glamo/glamo-fb.c +index 451de75..160a5b1 100644 +--- a/drivers/video/glamo/glamo-fb.c ++++ b/drivers/video/glamo/glamo-fb.c +@@ -54,8 +54,6 @@ + + #define RESSIZE(ressource) (((ressource)->end - (ressource)->start)+1) + +-#define GLAMO_FB_ALLOC (640*480*2) +- + struct glamofb_handle { + struct fb_info *fb; + struct device *dev; +@@ -224,7 +222,6 @@ static int glamofb_set_par(struct fb_info *info) + } + + glamo->fb->fix.line_length = (var->width * var->bits_per_pixel) / 8; +- glamo->fb->fix.smem_len = info->fix.line_length * var->yres_virtual; + + return 0; + } +@@ -453,7 +450,7 @@ static int __init glamofb_probe(struct platform_device *pdev) + } + + glamofb->fb_res = request_mem_region(glamofb->fb_res->start, +- GLAMO_FB_ALLOC, pdev->name); ++ RESSIZE(glamofb->fb_res), pdev->name); + if (!glamofb->fb_res) { + dev_err(&pdev->dev, "failed to request vram region\n"); + goto out_release_reg; +@@ -467,6 +464,7 @@ static int __init glamofb_probe(struct platform_device *pdev) + goto out_release_fb; + } + fbinfo->fix.smem_start = (unsigned long) glamofb->fb_res->start; ++ fbinfo->fix.smem_len = RESSIZE(glamofb->fb_res); + + fbinfo->screen_base = ioremap(glamofb->fb_res->start, + RESSIZE(glamofb->fb_res)); +@@ -522,11 +520,10 @@ static int __init glamofb_probe(struct platform_device *pdev) + fbinfo->var.green.length = 6; + fbinfo->var.blue.length = 5; + fbinfo->var.transp.length = 0; +- fbinfo->fix.smem_len = mach_info->xres.max * +- mach_info->yres.max * +- mach_info->bpp.max / 8; + +- memset(fbinfo->screen_base, 0, fbinfo->fix.smem_len); ++ memset(fbinfo->screen_base, 0, mach_info->xres.max * ++ mach_info->yres.max * ++ mach_info->bpp.max / 8); + + glamo_engine_enable(mach_info->glamo, GLAMO_ENGINE_LCD); + glamo_engine_reset(mach_info->glamo, GLAMO_ENGINE_LCD); +-- +1.5.3.1 + |