]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/console/fonts.c
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / video / console / fonts.c
index c960728b7e82dd2fe6439f2a7364cabdcede9c43..d0c03fd7087141359d3d733791bbca2020de0de0 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#if defined(__mc68000__) || defined(CONFIG_APUS)
+#if defined(__mc68000__)
 #include <asm/setup.h>
 #endif
 #include <linux/font.h>
@@ -98,6 +98,8 @@ const struct font_desc *find_font(const char *name)
  *     get_default_font - get default font
  *     @xres: screen size of X
  *     @yres: screen size of Y
+ *      @font_w: bit array of supported widths (1 - 32)
+ *      @font_h: bit array of supported heights (1 - 32)
  *
  *     Get the default font for a specified screen size.
  *     Dimensions are in pixels.
@@ -107,7 +109,8 @@ const struct font_desc *find_font(const char *name)
  *
  */
 
-const struct font_desc *get_default_font(int xres, int yres)
+const struct font_desc *get_default_font(int xres, int yres, u32 font_w,
+                                        u32 font_h)
 {
     int i, c, cc;
     const struct font_desc *f, *g;
@@ -117,7 +120,7 @@ const struct font_desc *get_default_font(int xres, int yres)
     for(i=0; i<num_fonts; i++) {
        f = fonts[i];
        c = f->pref;
-#if defined(__mc68000__) || defined(CONFIG_APUS)
+#if defined(__mc68000__)
 #ifdef CONFIG_FONT_PEARL_8x8
        if (MACH_IS_AMIGA && f->idx == PEARL8x8_IDX)
            c = 100;
@@ -129,6 +132,11 @@ const struct font_desc *get_default_font(int xres, int yres)
 #endif
        if ((yres < 400) == (f->height <= 8))
            c += 1000;
+
+       if ((font_w & (1 << (f->width - 1))) &&
+           (font_h & (1 << (f->height - 1))))
+           c += 1000;
+
        if (c > cc) {
            cc = c;
            g = f;