[Title]round up when calculate width and height from dpi
authormunkyu.im <munkyu.im@samsung.com>
Mon, 26 Mar 2012 09:10:48 +0000 (18:10 +0900)
committermunkyu.im <munkyu.im@samsung.com>
Mon, 26 Mar 2012 09:10:48 +0000 (18:10 +0900)
[Type]
[Module]
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

drivers/maru/maru_fb.c

index 796c47221f054ae237d7532c8f81483de098d1d7..5ab50ae8a73342bbb7a659c020799c2638bee6b0 100644 (file)
@@ -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) ?