]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - lib/fonts/fonts.c
Merge tag 'fbdev-for-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
[thirdparty/linux.git] / lib / fonts / fonts.c
index 973866438608870c06af198de3cfe28756ec7831..47e34950b665c3d4de0472ff0558601351701ca9 100644 (file)
@@ -96,18 +96,21 @@ EXPORT_SYMBOL(find_font);
  *     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)
+ *     @font_w: bit array of supported widths (1 - FB_MAX_BLIT_WIDTH)
+ *     @font_h: bit array of supported heights (1 - FB_MAX_BLIT_HEIGHT)
  *
  *     Get the default font for a specified screen size.
  *     Dimensions are in pixels.
  *
+ *     font_w or font_h being NULL means all values are supported.
+ *
  *     Returns %NULL if no font is found, or a pointer to the
  *     chosen font.
  *
  */
-const struct font_desc *get_default_font(int xres, int yres, u32 font_w,
-                                        u32 font_h)
+const struct font_desc *get_default_font(int xres, int yres,
+                                        unsigned long *font_w,
+                                        unsigned long *font_h)
 {
        int i, c, cc, res;
        const struct font_desc *f, *g;
@@ -135,8 +138,8 @@ const struct font_desc *get_default_font(int xres, int yres, u32 font_w,
                if (res > 20)
                        c += 20 - res;
 
-               if ((font_w & (1U << (f->width - 1))) &&
-                   (font_h & (1U << (f->height - 1))))
+               if ((!font_w || test_bit(f->width - 1, font_w)) &&
+                   (!font_h || test_bit(f->height - 1, font_h)))
                        c += 1000;
 
                if (c > cc) {