Fonts: Add charcount field to font_desc

Subsystems are hard-coding the number of characters of our built-in fonts
as 256. Include that information in our kernel font descriptor, `struct
font_desc`.

Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/65952296d1d9486093bd955d1536f7dcd11112c6.1605169912.git.yepeilin.cs@gmail.com
This commit is contained in:
Peilin Ye 2020-11-12 07:13:34 -05:00 committed by Daniel Vetter
parent 259a252c1f
commit 4ee573086b
14 changed files with 14 additions and 0 deletions

View File

@ -17,6 +17,7 @@ struct font_desc {
int idx; int idx;
const char *name; const char *name;
unsigned int width, height; unsigned int width, height;
unsigned int charcount;
const void *data; const void *data;
int pref; int pref;
}; };

View File

@ -5137,6 +5137,7 @@ const struct font_desc font_10x18 = {
.name = "10x18", .name = "10x18",
.width = 10, .width = 10,
.height = 18, .height = 18,
.charcount = 256,
.data = fontdata_10x18.data, .data = fontdata_10x18.data,
#ifdef __sparc__ #ifdef __sparc__
.pref = 5, .pref = 5,

View File

@ -3083,6 +3083,7 @@ const struct font_desc font_6x10 = {
.name = "6x10", .name = "6x10",
.width = 6, .width = 6,
.height = 10, .height = 10,
.charcount = 256,
.data = fontdata_6x10.data, .data = fontdata_6x10.data,
.pref = 0, .pref = 0,
}; };

View File

@ -3346,6 +3346,7 @@ const struct font_desc font_vga_6x11 = {
.name = "ProFont6x11", .name = "ProFont6x11",
.width = 6, .width = 6,
.height = 11, .height = 11,
.charcount = 256,
.data = fontdata_6x11.data, .data = fontdata_6x11.data,
/* Try avoiding this font if possible unless on MAC */ /* Try avoiding this font if possible unless on MAC */
.pref = -2000, .pref = -2000,

View File

@ -2571,6 +2571,7 @@ const struct font_desc font_6x8 = {
.name = "6x8", .name = "6x8",
.width = 6, .width = 6,
.height = 8, .height = 8,
.charcount = 256,
.data = fontdata_6x8.data, .data = fontdata_6x8.data,
.pref = 0, .pref = 0,
}; };

View File

@ -4113,6 +4113,7 @@ const struct font_desc font_7x14 = {
.name = "7x14", .name = "7x14",
.width = 7, .width = 7,
.height = 14, .height = 14,
.charcount = 256,
.data = fontdata_7x14.data, .data = fontdata_7x14.data,
.pref = 0, .pref = 0,
}; };

View File

@ -4627,6 +4627,7 @@ const struct font_desc font_vga_8x16 = {
.name = "VGA8x16", .name = "VGA8x16",
.width = 8, .width = 8,
.height = 16, .height = 16,
.charcount = 256,
.data = fontdata_8x16.data, .data = fontdata_8x16.data,
.pref = 0, .pref = 0,
}; };

View File

@ -2578,6 +2578,7 @@ const struct font_desc font_vga_8x8 = {
.name = "VGA8x8", .name = "VGA8x8",
.width = 8, .width = 8,
.height = 8, .height = 8,
.charcount = 256,
.data = fontdata_8x8.data, .data = fontdata_8x8.data,
.pref = 0, .pref = 0,
}; };

View File

@ -270,6 +270,7 @@ const struct font_desc font_acorn_8x8 = {
.name = "Acorn8x8", .name = "Acorn8x8",
.width = 8, .width = 8,
.height = 8, .height = 8,
.charcount = 256,
.data = acorndata_8x8.data, .data = acorndata_8x8.data,
#ifdef CONFIG_ARCH_ACORN #ifdef CONFIG_ARCH_ACORN
.pref = 20, .pref = 20,

View File

@ -2152,6 +2152,7 @@ const struct font_desc font_mini_4x6 = {
.name = "MINI4x6", .name = "MINI4x6",
.width = 4, .width = 4,
.height = 6, .height = 6,
.charcount = 256,
.data = fontdata_mini_4x6.data, .data = fontdata_mini_4x6.data,
.pref = 3, .pref = 3,
}; };

View File

@ -2582,6 +2582,7 @@ const struct font_desc font_pearl_8x8 = {
.name = "PEARL8x8", .name = "PEARL8x8",
.width = 8, .width = 8,
.height = 8, .height = 8,
.charcount = 256,
.data = fontdata_pearl8x8.data, .data = fontdata_pearl8x8.data,
.pref = 2, .pref = 2,
}; };

View File

@ -6156,6 +6156,7 @@ const struct font_desc font_sun_12x22 = {
.name = "SUN12x22", .name = "SUN12x22",
.width = 12, .width = 12,
.height = 22, .height = 22,
.charcount = 256,
.data = fontdata_sun12x22.data, .data = fontdata_sun12x22.data,
#ifdef __sparc__ #ifdef __sparc__
.pref = 5, .pref = 5,

View File

@ -268,6 +268,7 @@ const struct font_desc font_sun_8x16 = {
.name = "SUN8x16", .name = "SUN8x16",
.width = 8, .width = 8,
.height = 16, .height = 16,
.charcount = 256,
.data = fontdata_sun8x16.data, .data = fontdata_sun8x16.data,
#ifdef __sparc__ #ifdef __sparc__
.pref = 10, .pref = 10,

View File

@ -2062,6 +2062,7 @@ const struct font_desc font_ter_16x32 = {
.name = "TER16x32", .name = "TER16x32",
.width = 16, .width = 16,
.height = 32, .height = 32,
.charcount = 256,
.data = fontdata_ter16x32.data, .data = fontdata_ter16x32.data,
#ifdef __sparc__ #ifdef __sparc__
.pref = 5, .pref = 5,