From: munkyu.im Date: Mon, 26 Mar 2012 09:10:48 +0000 (+0900) Subject: [Title]round up when calculate width and height from dpi X-Git-Tag: 2.2.1_release^2~152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4466252d284ec9c3620710edba896d65f37fd71;p=sdk%2Femulator%2Femulator-kernel.git [Title]round up when calculate width and height from dpi [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- diff --git a/drivers/maru/maru_fb.c b/drivers/maru/maru_fb.c index 796c47221f05..5ab50ae8a733 100644 --- a/drivers/maru/maru_fb.c +++ b/drivers/maru/maru_fb.c @@ -309,9 +309,9 @@ static int my_atoi(const char *name) } extern char *saved_command_line; -#define DPI_DEF_VALUE 3160 -#define DPI_MIN_VALUE 1000 -#define DPI_MAX_VALUE 4800 +#define DPI_DEF_VALUE 316 +#define DPI_MIN_VALUE 100 +#define DPI_MAX_VALUE 480 static void uvesafb_setup_var(struct fb_var_screeninfo *var, struct fb_info *info, struct vbe_mode_ib *mode) @@ -333,16 +333,15 @@ static void uvesafb_setup_var(struct fb_var_screeninfo *var, ps += 4; strncpy(dpi_info, ps, 4); dpi = my_atoi(dpi_info); - dpi *= 10; if (dpi < DPI_MIN_VALUE || dpi > DPI_MAX_VALUE) dpi = DPI_DEF_VALUE; } - - var->height = var->yres * 254 / dpi; - var->width = var->xres * 254 / dpi; - printk(KERN_INFO "dpi value = %d\n", dpi); - printk(KERN_INFO "var->yres = %d, var->xres = %d\n", var->yres, var->xres); - printk(KERN_INFO "var->height = %d, var->width = %d\n", var->height, var->width); + /* round up */ + var->height = ((var->yres * 254 / dpi) + 5) / 10; + var->width = ((var->xres * 254 / dpi)+ 5) / 10; + //printk(KERN_INFO "dpi value = %d\n", dpi); + //printk(KERN_INFO "var->yres = %d, var->xres = %d\n", var->yres, var->xres); + //printk(KERN_INFO "var->height = %d, var->width = %d\n", var->height, var->width); var->xres_virtual = mode->x_res; var->yres_virtual = (par->ypan) ?