summaryrefslogtreecommitdiffstats
path: root/sys/dev/fb/machfb.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2007-06-16 21:48:50 +0000
committermarius <marius@FreeBSD.org>2007-06-16 21:48:50 +0000
commit9dc384d0c45a6842645cbbd69b5525ebe511113b (patch)
treedecad5965d6db2cacd4ccebf69b20e196c3aa005 /sys/dev/fb/machfb.c
parent35bd1c241b112d60f389db6efa33c707fa549ad0 (diff)
downloadFreeBSD-src-9dc384d0c45a6842645cbbd69b5525ebe511113b.zip
FreeBSD-src-9dc384d0c45a6842645cbbd69b5525ebe511113b.tar.gz
Move the gallant 12 x 22 font data from a .h to a .c so it doesn't need
to be compiled into every driver making use of it. Use a const instance of struct gfb_font for this as the font isn't intended to be changed at run-time and in order to accompany the font data with height and width info.
Diffstat (limited to 'sys/dev/fb/machfb.c')
-rw-r--r--sys/dev/fb/machfb.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/fb/machfb.c b/sys/dev/fb/machfb.c
index 31b22ab..eb128eb 100644
--- a/sys/dev/fb/machfb.c
+++ b/sys/dev/fb/machfb.c
@@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$");
#include <sys/rman.h>
#include <dev/fb/fbreg.h>
-#include <dev/fb/gallant12x22.h>
+#include <dev/fb/gfb.h>
#include <dev/fb/machfbreg.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
@@ -135,7 +135,7 @@ struct machfb_softc {
int sc_mclk_post_div;
int sc_mclk_fb_div;
- u_char *sc_font;
+ const u_char *sc_font;
int sc_cbwidth;
vm_offset_t sc_curoff;
@@ -253,6 +253,8 @@ static const char *machfb_memtype_names[] = {
"(unknown type)"
};
+extern const struct gfb_font gallant12x22;
+
static struct machfb_softc machfb_softc;
static struct bus_space_tag machfb_bst_store[1];
@@ -587,13 +589,13 @@ machfb_init(int unit, video_adapter_t *adp, int flags)
if (OF_getprop(options, "screen-#columns", buf, sizeof(buf)) == -1)
return (ENXIO);
vi->vi_width = strtol(buf, NULL, 10);
- vi->vi_cwidth = 12;
- vi->vi_cheight = 22;
+ vi->vi_cwidth = gallant12x22.width;
+ vi->vi_cheight = gallant12x22.height;
vi->vi_flags = V_INFO_COLOR;
vi->vi_mem_model = V_INFO_MM_OTHER;
- sc->sc_font = gallant12x22_data;
- sc->sc_cbwidth = howmany(vi->vi_cwidth, 8); /* width in bytes */
+ sc->sc_font = gallant12x22.data;
+ sc->sc_cbwidth = howmany(vi->vi_cwidth, NBBY); /* width in bytes */
sc->sc_xmargin = (sc->sc_width - (vi->vi_width * vi->vi_cwidth)) / 2;
sc->sc_ymargin = (sc->sc_height - (vi->vi_height * vi->vi_cheight)) / 2;
@@ -1027,7 +1029,7 @@ static int
machfb_putc(video_adapter_t *adp, vm_offset_t off, uint8_t c, uint8_t a)
{
struct machfb_softc *sc;
- uint8_t *p;
+ const uint8_t *p;
int i;
sc = (struct machfb_softc *)adp;
OpenPOWER on IntegriCloud