Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6
[powerpc.git] / drivers / video / console / fonts.c
index 0cc1bfd..a6828d0 100644 (file)
@@ -12,7 +12,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -99,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.
@@ -108,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;
@@ -130,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_w & (1 << (f->height - 1))))
+           c += 1000;
+
        if (c > cc) {
            cc = c;
            g = f;