summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-10-21 10:36:27 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-10-21 10:36:27 +0000
commit22a7a58bc34bd99e322e4e872add0cd82855128a (patch)
tree3571a1fe1f892c698c714629e9ccd90e1fc13156 /sys/arch/loongson
parentceead45789cad670a4e79b8e53502af204c5f1ad (diff)
Add load_font and list_font accessops to all rasops-based wsdisplay drivers.
Trivial except for tga(4) and gpx(4/vax) which need a bit more care setting up a new font.
Diffstat (limited to 'sys/arch/loongson')
-rw-r--r--sys/arch/loongson/dev/sisfb.c28
-rw-r--r--sys/arch/loongson/dev/smfb.c28
2 files changed, 50 insertions, 6 deletions
diff --git a/sys/arch/loongson/dev/sisfb.c b/sys/arch/loongson/dev/sisfb.c
index 8935efcf7c0..3093e71f072 100644
--- a/sys/arch/loongson/dev/sisfb.c
+++ b/sys/arch/loongson/dev/sisfb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sisfb.c,v 1.3 2013/10/20 20:07:23 miod Exp $ */
+/* $OpenBSD: sisfb.c,v 1.4 2013/10/21 10:36:14 miod Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
@@ -87,16 +87,20 @@ int sisfb_alloc_screen(void *, const struct wsscreen_descr *, void **, int *,
int *, long *);
void sisfb_free_screen(void *, void *);
int sisfb_ioctl(void *, u_long, caddr_t, int, struct proc *);
+int sisfb_list_font(void *, struct wsdisplay_font *);
+int sisfb_load_font(void *, void *, struct wsdisplay_font *);
+paddr_t sisfb_mmap(void *, off_t, int);
int sisfb_show_screen(void *, void *, int, void (*)(void *, int, int),
void *);
-paddr_t sisfb_mmap(void *, off_t, int);
struct wsdisplay_accessops sisfb_accessops = {
.ioctl = sisfb_ioctl,
.mmap = sisfb_mmap,
.alloc_screen = sisfb_alloc_screen,
.free_screen = sisfb_free_screen,
- .show_screen = sisfb_show_screen
+ .show_screen = sisfb_show_screen,
+ .load_font = sisfb_load_font,
+ .list_font = sisfb_list_font
};
int sisfb_getcmap(uint8_t *, struct wsdisplay_cmap *);
@@ -363,6 +367,24 @@ sisfb_mmap(void *v, off_t offset, int prot)
return XKPHYS_TO_PHYS((paddr_t)ri->ri_bits) + offset;
}
+int
+sisfb_load_font(void *v, void *emulcookie, struct wsdisplay_font *font)
+{
+ struct sisfb_softc *sc = (struct sisfb_softc *)v;
+ struct rasops_info *ri = &sc->sc_fb->ri;
+
+ return rasops_load_font(ri, emulcookie, font);
+}
+
+int
+sisfb_list_font(void *v, struct wsdisplay_font *font)
+{
+ struct sisfb_softc *sc = (struct sisfb_softc *)v;
+ struct rasops_info *ri = &sc->sc_fb->ri;
+
+ return rasops_list_font(ri, font);
+}
+
/*
* Frame buffer initialization.
*/
diff --git a/sys/arch/loongson/dev/smfb.c b/sys/arch/loongson/dev/smfb.c
index a0c7f83e931..e1ca7172356 100644
--- a/sys/arch/loongson/dev/smfb.c
+++ b/sys/arch/loongson/dev/smfb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smfb.c,v 1.15 2013/10/20 20:07:24 miod Exp $ */
+/* $OpenBSD: smfb.c,v 1.16 2013/10/21 10:36:14 miod Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
@@ -109,12 +109,14 @@ struct cfdriver smfb_cd = {
int smfb_alloc_screen(void *, const struct wsscreen_descr *, void **, int *,
int *, long *);
+void smfb_burner(void *, uint, uint);
void smfb_free_screen(void *, void *);
int smfb_ioctl(void *, u_long, caddr_t, int, struct proc *);
+int smfb_list_font(void *, struct wsdisplay_font *);
+int smfb_load_font(void *, void *, struct wsdisplay_font *);
+paddr_t smfb_mmap(void *, off_t, int);
int smfb_show_screen(void *, void *, int, void (*)(void *, int, int),
void *);
-paddr_t smfb_mmap(void *, off_t, int);
-void smfb_burner(void *, uint, uint);
struct wsdisplay_accessops smfb_accessops = {
.ioctl = smfb_ioctl,
@@ -122,6 +124,8 @@ struct wsdisplay_accessops smfb_accessops = {
.alloc_screen = smfb_alloc_screen,
.free_screen = smfb_free_screen,
.show_screen = smfb_show_screen,
+ .load_font = smfb_load_font,
+ .list_font = smfb_list_font,
.burn_screen = smfb_burner
};
@@ -311,6 +315,24 @@ smfb_mmap(void *v, off_t offset, int prot)
return XKPHYS_TO_PHYS((paddr_t)ri->ri_bits) + offset;
}
+int
+smfb_load_font(void *v, void *emulcookie, struct wsdisplay_font *font)
+{
+ struct smfb_softc *sc = (struct smfb_softc *)v;
+ struct rasops_info *ri = &sc->sc_fb->ri;
+
+ return rasops_load_font(ri, emulcookie, font);
+}
+
+int
+smfb_list_font(void *v, struct wsdisplay_font *font)
+{
+ struct smfb_softc *sc = (struct smfb_softc *)v;
+ struct rasops_info *ri = &sc->sc_fb->ri;
+
+ return rasops_list_font(ri, font);
+}
+
void
smfb_burner(void *v, uint on, uint flg)
{