|
@@ -988,7 +988,9 @@ static const char *fbcon_startup(void)
|
|
if (!p->fontdata) {
|
|
if (!p->fontdata) {
|
|
if (!fontname[0] || !(font = find_font(fontname)))
|
|
if (!fontname[0] || !(font = find_font(fontname)))
|
|
font = get_default_font(info->var.xres,
|
|
font = get_default_font(info->var.xres,
|
|
- info->var.yres);
|
|
|
|
|
|
+ info->var.yres,
|
|
|
|
+ info->pixmap.blit_x,
|
|
|
|
+ info->pixmap.blit_y);
|
|
vc->vc_font.width = font->width;
|
|
vc->vc_font.width = font->width;
|
|
vc->vc_font.height = font->height;
|
|
vc->vc_font.height = font->height;
|
|
vc->vc_font.data = (void *)(p->fontdata = font->data);
|
|
vc->vc_font.data = (void *)(p->fontdata = font->data);
|
|
@@ -1108,7 +1110,9 @@ static void fbcon_init(struct vc_data *vc, int init)
|
|
|
|
|
|
if (!fontname[0] || !(font = find_font(fontname)))
|
|
if (!fontname[0] || !(font = find_font(fontname)))
|
|
font = get_default_font(info->var.xres,
|
|
font = get_default_font(info->var.xres,
|
|
- info->var.yres);
|
|
|
|
|
|
+ info->var.yres,
|
|
|
|
+ info->pixmap.blit_x,
|
|
|
|
+ info->pixmap.blit_y);
|
|
vc->vc_font.width = font->width;
|
|
vc->vc_font.width = font->width;
|
|
vc->vc_font.height = font->height;
|
|
vc->vc_font.height = font->height;
|
|
vc->vc_font.data = (void *)(p->fontdata = font->data);
|
|
vc->vc_font.data = (void *)(p->fontdata = font->data);
|
|
@@ -2495,6 +2499,7 @@ static int fbcon_copy_font(struct vc_data *vc, int con)
|
|
|
|
|
|
static int fbcon_set_font(struct vc_data *vc, struct console_font *font, unsigned flags)
|
|
static int fbcon_set_font(struct vc_data *vc, struct console_font *font, unsigned flags)
|
|
{
|
|
{
|
|
|
|
+ struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
|
|
unsigned charcount = font->charcount;
|
|
unsigned charcount = font->charcount;
|
|
int w = font->width;
|
|
int w = font->width;
|
|
int h = font->height;
|
|
int h = font->height;
|
|
@@ -2508,6 +2513,11 @@ static int fbcon_set_font(struct vc_data *vc, struct console_font *font, unsigne
|
|
if (charcount != 256 && charcount != 512)
|
|
if (charcount != 256 && charcount != 512)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ /* Make sure drawing engine can handle the font */
|
|
|
|
+ if (!(info->pixmap.blit_x & (1 << (font->width - 1))) ||
|
|
|
|
+ !(info->pixmap.blit_y & (1 << (font->height - 1))))
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
size = h * pitch * charcount;
|
|
size = h * pitch * charcount;
|
|
|
|
|
|
new_data = kmalloc(FONT_EXTRA_WORDS * sizeof(int) + size, GFP_USER);
|
|
new_data = kmalloc(FONT_EXTRA_WORDS * sizeof(int) + size, GFP_USER);
|
|
@@ -2552,7 +2562,8 @@ static int fbcon_set_def_font(struct vc_data *vc, struct console_font *font, cha
|
|
const struct font_desc *f;
|
|
const struct font_desc *f;
|
|
|
|
|
|
if (!name)
|
|
if (!name)
|
|
- f = get_default_font(info->var.xres, info->var.yres);
|
|
|
|
|
|
+ f = get_default_font(info->var.xres, info->var.yres,
|
|
|
|
+ info->pixmap.blit_x, info->pixmap.blit_y);
|
|
else if (!(f = find_font(name)))
|
|
else if (!(f = find_font(name)))
|
|
return -ENOENT;
|
|
return -ENOENT;
|
|
|
|
|