aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/console/fonts.c
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2007-05-08 03:39:11 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:31 -0400
commit2d2699d984924890f6dac8cf51c3b6311f56816c (patch)
treebd8f50392ac6918589c6069177b89172f2263916 /drivers/video/console/fonts.c
parentbf26ad72a60c0009a99179b449a43daa6bf4b4f6 (diff)
fbcon: font setting should check limitation of driver
fbcon_set_font() will now check if the new font dimensions can be drawn by the driver (by checking pixmap.blit_x and blit_y). Similarly, add 2 new parameters to get_default_font(), font_w and font_h, to further aid in the font selection process. Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/console/fonts.c')
-rw-r--r--drivers/video/console/fonts.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/video/console/fonts.c b/drivers/video/console/fonts.c
index c960728b7e82..a6828d0a4c56 100644
--- a/drivers/video/console/fonts.c
+++ b/drivers/video/console/fonts.c
@@ -98,6 +98,8 @@ const struct font_desc *find_font(const char *name)
98 * get_default_font - get default font 98 * get_default_font - get default font
99 * @xres: screen size of X 99 * @xres: screen size of X
100 * @yres: screen size of Y 100 * @yres: screen size of Y
101 * @font_w: bit array of supported widths (1 - 32)
102 * @font_h: bit array of supported heights (1 - 32)
101 * 103 *
102 * Get the default font for a specified screen size. 104 * Get the default font for a specified screen size.
103 * Dimensions are in pixels. 105 * Dimensions are in pixels.
@@ -107,7 +109,8 @@ const struct font_desc *find_font(const char *name)
107 * 109 *
108 */ 110 */
109 111
110const struct font_desc *get_default_font(int xres, int yres) 112const struct font_desc *get_default_font(int xres, int yres, u32 font_w,
113 u32 font_h)
111{ 114{
112 int i, c, cc; 115 int i, c, cc;
113 const struct font_desc *f, *g; 116 const struct font_desc *f, *g;
@@ -129,6 +132,11 @@ const struct font_desc *get_default_font(int xres, int yres)
129#endif 132#endif
130 if ((yres < 400) == (f->height <= 8)) 133 if ((yres < 400) == (f->height <= 8))
131 c += 1000; 134 c += 1000;
135
136 if (!(font_w & (1 << (f->width - 1))) ||
137 !(font_w & (1 << (f->height - 1))))
138 c += 1000;
139
132 if (c > cc) { 140 if (c > cc) {
133 cc = c; 141 cc = c;
134 g = f; 142 g = f;