summaryrefslogtreecommitdiffstats
path: root/sys/dev/fb
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2005-09-28 14:54:07 +0000
committermarius <marius@FreeBSD.org>2005-09-28 14:54:07 +0000
commitfe0a34c8f15fa82e0fec35f34ee9c6efe4abdcc4 (patch)
treebb4b1851d014027e2b948702d0726e8539fa0e12 /sys/dev/fb
parent2d942f188d24ea6077fd2e56a8676851b448c161 (diff)
downloadFreeBSD-src-fe0a34c8f15fa82e0fec35f34ee9c6efe4abdcc4.zip
FreeBSD-src-fe0a34c8f15fa82e0fec35f34ee9c6efe4abdcc4.tar.gz
Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_t
and do some preparations for handling 12x22 fonts (currently lots of code implies and/or hardcodes a font width of 8 pixels). This will be required on sparc64 which uses a default font size of 12x22 in order to add font loading and saving support as well as to use a syscons(4)-supplied mouse pointer image. This API breakage is committed now so it can be MFC'ed in time for 6.0 and later on upcoming framebuffer drivers destined for use on sparc64 and which are expected to rely on using font loading internally and on a syscons(4)-supplied mouse pointer image can be easily MFC'ed to RELENG_6 rather than requiring a backport. Tested on: i386, sparc64, make universe MFC after: 1 week
Diffstat (limited to 'sys/dev/fb')
-rw-r--r--sys/dev/fb/creator.c10
-rw-r--r--sys/dev/fb/fbreg.h8
-rw-r--r--sys/dev/fb/gfb.c16
-rw-r--r--sys/dev/fb/machfb.c10
-rw-r--r--sys/dev/fb/s3_pci.c14
-rw-r--r--sys/dev/fb/tga.c2
-rw-r--r--sys/dev/fb/vga.c12
7 files changed, 37 insertions, 35 deletions
diff --git a/sys/dev/fb/creator.c b/sys/dev/fb/creator.c
index 3dbe351..288e4dd 100644
--- a/sys/dev/fb/creator.c
+++ b/sys/dev/fb/creator.c
@@ -443,16 +443,16 @@ creator_set_mode(video_adapter_t *adp, int mode)
}
static int
-creator_save_font(video_adapter_t *adp, int page, int size, u_char *data,
- int c, int count)
+creator_save_font(video_adapter_t *adp, int page, int size, int width,
+ u_char *data, int c, int count)
{
return (ENODEV);
}
static int
-creator_load_font(video_adapter_t *adp, int page, int size, u_char *data,
- int c, int count)
+creator_load_font(video_adapter_t *adp, int page, int size, int width,
+ u_char *data, int c, int count)
{
return (ENODEV);
@@ -738,7 +738,7 @@ creator_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len)
static int
creator_putm(video_adapter_t *adp, int x, int y, u_int8_t *pixel_image,
- u_int32_t pixel_mask, int size)
+ u_int32_t pixel_mask, int size, int width)
{
struct creator_softc *sc;
diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h
index 7db6315..1e82946 100644
--- a/sys/dev/fb/fbreg.h
+++ b/sys/dev/fb/fbreg.h
@@ -107,9 +107,9 @@ typedef int vi_init_t(int unit, video_adapter_t *adp, int flags);
typedef int vi_get_info_t(video_adapter_t *adp, int mode, video_info_t *info);
typedef int vi_query_mode_t(video_adapter_t *adp, video_info_t *info);
typedef int vi_set_mode_t(video_adapter_t *adp, int mode);
-typedef int vi_save_font_t(video_adapter_t *adp, int page, int size,
+typedef int vi_save_font_t(video_adapter_t *adp, int page, int size, int width,
u_char *data, int c, int count);
-typedef int vi_load_font_t(video_adapter_t *adp, int page, int size,
+typedef int vi_load_font_t(video_adapter_t *adp, int page, int size, int width,
u_char *data, int c, int count);
typedef int vi_show_font_t(video_adapter_t *adp, int page);
typedef int vi_save_palette_t(video_adapter_t *adp, u_char *palette);
@@ -148,8 +148,8 @@ typedef int vi_putc_t(video_adapter_t *adp, vm_offset_t off, u_int8_t c,
u_int8_t a);
typedef int vi_puts_t(video_adapter_t *adp, vm_offset_t off, u_int16_t *s,
int len);
-typedef int vi_putm_t(video_adapter_t *adp, int x, int y,
- u_int8_t *pixel_image, u_int32_t pixel_mask, int size);
+typedef int vi_putm_t(video_adapter_t *adp, int x, int y, u_int8_t *pixel_image,
+ u_int32_t pixel_mask, int size, int width);
typedef struct video_switch {
vi_probe_t *probe;
diff --git a/sys/dev/fb/gfb.c b/sys/dev/fb/gfb.c
index 6a14dca..c3c8ef9 100644
--- a/sys/dev/fb/gfb.c
+++ b/sys/dev/fb/gfb.c
@@ -161,7 +161,7 @@ gfb_init(int unit, video_adapter_t *adp, int flags)
/* Prepare the default font... */
(*vidsw[adp->va_index]->load_font)(adp, 0, bold8x16.height,
- bold8x16.data, 0, 256);
+ bold8x16.width, bold8x16.data, 0, 256);
adp->va_info.vi_cwidth = gfbc->fonts[0].width;
adp->va_info.vi_cheight = gfbc->fonts[0].height;
@@ -213,8 +213,8 @@ gfb_set_mode(video_adapter_t *adp, int mode)
}
int
-gfb_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+gfb_save_font(video_adapter_t *adp, int page, int fontsize, int fontwidth,
+ u_char *data, int ch, int count)
{
struct gfb_softc *sc;
int error;
@@ -225,7 +225,7 @@ gfb_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
/* Check the font information... */
if((sc->gfbc->fonts[page].height != fontsize) ||
- (sc->gfbc->fonts[page].width != 8))
+ (sc->gfbc->fonts[page].width != fontwidth))
error = EINVAL;
else
@@ -242,8 +242,8 @@ gfb_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
}
int
-gfb_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+gfb_load_font(video_adapter_t *adp, int page, int fontsize, int fontwidth,
+ u_char *data, int ch, int count)
{
struct gfb_softc *sc;
int error;
@@ -259,7 +259,7 @@ gfb_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
/* Save the font information... */
sc->gfbc->fonts[page].height = fontsize;
- sc->gfbc->fonts[page].width = 8;
+ sc->gfbc->fonts[page].width = fontwidth;
return(error);
}
@@ -912,7 +912,7 @@ gfb_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len)
int
gfb_putm(video_adapter_t *adp, int x, int y, u_int8_t *pixel_image,
- u_int32_t pixel_mask, int size)
+ u_int32_t pixel_mask, int size, int width)
{
vm_offset_t poff;
int i, pixel_size;
diff --git a/sys/dev/fb/machfb.c b/sys/dev/fb/machfb.c
index f97480b..31b22ab 100644
--- a/sys/dev/fb/machfb.c
+++ b/sys/dev/fb/machfb.c
@@ -702,16 +702,16 @@ machfb_set_mode(video_adapter_t *adp, int mode)
}
static int
-machfb_save_font(video_adapter_t *adp, int page, int size, u_char *data,
- int c, int count)
+machfb_save_font(video_adapter_t *adp, int page, int size, int width,
+ u_char *data, int c, int count)
{
return (ENODEV);
}
static int
-machfb_load_font(video_adapter_t *adp, int page, int size, u_char *data,
- int c, int count)
+machfb_load_font(video_adapter_t *adp, int page, int size, int width,
+ u_char *data, int c, int count)
{
return (ENODEV);
@@ -1124,7 +1124,7 @@ machfb_puts(video_adapter_t *adp, vm_offset_t off, uint16_t *s, int len)
static int
machfb_putm(video_adapter_t *adp, int x, int y, uint8_t *pixel_image,
- uint32_t pixel_mask, int size)
+ uint32_t pixel_mask, int size, int width)
{
struct machfb_softc *sc;
int error;
diff --git a/sys/dev/fb/s3_pci.c b/sys/dev/fb/s3_pci.c
index 854a685..9935b9e 100644
--- a/sys/dev/fb/s3_pci.c
+++ b/sys/dev/fb/s3_pci.c
@@ -305,17 +305,19 @@ s3lfb_set_mode(video_adapter_t *adp, int mode)
}
static int
-s3lfb_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+s3lfb_save_font(video_adapter_t *adp, int page, int fontsize, int fontwidth,
+ u_char *data, int ch, int count)
{
- return (*prevvidsw->save_font)(adp, page, fontsize, data, ch, count);
+ return (*prevvidsw->save_font)(adp, page, fontsize, fontwidth, data,
+ ch, count);
}
static int
-s3lfb_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+s3lfb_load_font(video_adapter_t *adp, int page, int fontsize, int fontwidth,
+ u_char *data, int ch, int count)
{
- return (*prevvidsw->load_font)(adp, page, fontsize, data, ch, count);
+ return (*prevvidsw->load_font)(adp, page, fontsize, fontwidth, data,
+ ch, count);
}
static int
diff --git a/sys/dev/fb/tga.c b/sys/dev/fb/tga.c
index 84923ef..bfd7ce4 100644
--- a/sys/dev/fb/tga.c
+++ b/sys/dev/fb/tga.c
@@ -1308,7 +1308,7 @@ tga_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len)
int
tga_putm(video_adapter_t *adp, int x, int y, u_int8_t *pixel_image,
- gfb_reg_t pixel_mask, int size)
+ gfb_reg_t pixel_mask, int size, int width)
{
gfb_reg_t gpxr;
gfb_reg_t gmor;
diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c
index b32625f..62ba235 100644
--- a/sys/dev/fb/vga.c
+++ b/sys/dev/fb/vga.c
@@ -1787,8 +1787,8 @@ set_normal_mode(video_adapter_t *adp, u_char *buf)
* EGA/VGA
*/
static int
-vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+vga_save_font(video_adapter_t *adp, int page, int fontsize, int fontwidth,
+ u_char *data, int ch, int count)
{
#ifndef VGA_NO_FONT_LOADING
u_char buf[PARAM_BUFSIZE];
@@ -1814,7 +1814,7 @@ vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
fontsize = 14;
}
- if (page < 0 || page >= 8)
+ if (page < 0 || page >= 8 || fontwidth != 8)
return EINVAL;
segment = FONT_BUF + 0x4000*page;
if (page > 3)
@@ -1867,8 +1867,8 @@ vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
* EGA/VGA
*/
static int
-vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+vga_load_font(video_adapter_t *adp, int page, int fontsize, int fontwidth,
+ u_char *data, int ch, int count)
{
#ifndef VGA_NO_FONT_LOADING
u_char buf[PARAM_BUFSIZE];
@@ -1894,7 +1894,7 @@ vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
fontsize = 14;
}
- if (page < 0 || page >= 8)
+ if (page < 0 || page >= 8 || fontwidth != 8)
return EINVAL;
segment = FONT_BUF + 0x4000*page;
if (page > 3)
OpenPOWER on IntegriCloud