Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sbus support anti-aliased fonts



details:   https://anonhg.NetBSD.org/src/rev/581766a3e27d
branches:  trunk
changeset: 782244:581766a3e27d
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Oct 23 11:53:18 2012 +0000

description:
support anti-aliased fonts

diffstat:

 sys/dev/sbus/agten.c |  36 +++++++++++++++++++++++-------------
 1 files changed, 23 insertions(+), 13 deletions(-)

diffs (95 lines):

diff -r b5f237688cdb -r 581766a3e27d sys/dev/sbus/agten.c
--- a/sys/dev/sbus/agten.c      Tue Oct 23 01:59:18 2012 +0000
+++ b/sys/dev/sbus/agten.c      Tue Oct 23 11:53:18 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agten.c,v 1.29 2012/10/20 13:52:11 macallan Exp $ */
+/*     $NetBSD: agten.c,v 1.30 2012/10/23 11:53:18 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.29 2012/10/20 13:52:11 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.30 2012/10/23 11:53:18 macallan Exp $");
 
 /*
  * a driver for the Fujitsu AG-10e SBus framebuffer
@@ -136,6 +136,7 @@
 static int     agten_putpalreg(struct agten_softc *, uint8_t, uint8_t,
                            uint8_t, uint8_t);
 static void    agten_init(struct agten_softc *);
+static void    agten_init_cmap(struct agten_softc *, struct rasops_info *);
 static void    agten_gfx(struct agten_softc *);
 static void    agten_set_video(struct agten_softc *, int);
 static int     agten_get_video(struct agten_softc *);
@@ -360,6 +361,7 @@
        }
 
        /* Initialize the default color map. */
+       agten_init_cmap(sc, ri);
 
        aa.console = console;
        aa.scrdata = &sc->sc_screenlist;
@@ -434,6 +436,8 @@
                                        sc->sc_mode = new_mode;
                                        if(new_mode == WSDISPLAYIO_MODE_EMUL) {
                                                agten_init(sc);
+                                               agten_init_cmap(sc,
+                                                   &ms->scr_ri);
                                                vcons_redraw_screen(ms);
                                        } else {
                                                agten_gfx(sc);
@@ -501,7 +505,7 @@
        ri->ri_width = sc->sc_width;
        ri->ri_height = sc->sc_height;
        ri->ri_stride = sc->sc_stride;
-       ri->ri_flg = RI_CENTER | RI_FULLCLEAR;
+       ri->ri_flg = RI_CENTER | RI_FULLCLEAR | RI_8BIT_IS_RGB | RI_ENABLE_ALPHA;
 
        ri->ri_bits = (char *)sc->sc_fb.fb_pixels;
 
@@ -610,19 +614,10 @@
 static void
 agten_init(struct agten_softc *sc)
 {
-       int i, j;
+       int i;
        uint32_t src, srcw;
        volatile uint32_t junk;
 
-       /* first we set up the colour map */
-       j = 0;
-       for (i = 0; i < 256; i++) {
-
-               agten_putpalreg(sc, i, rasops_cmap[j], rasops_cmap[j + 1],
-                   rasops_cmap[j + 2]);
-               j += 3;
-       }
-
        /* then we set up a linear LUT for 24bit colour */
        agten_write_idx(sc, IBM561_CMAP_TABLE + 256);
        for (i = 0; i < 256; i++) {
@@ -695,6 +690,21 @@
 }
 
 static void
+agten_init_cmap(struct agten_softc *sc, struct rasops_info *ri)
+{
+       int i, j;
+       uint8_t cmap[768];
+
+       rasops_get_cmap(ri, cmap, 768);
+       j = 0;
+       for (i = 0; i < 256; i++) {
+
+               agten_putpalreg(sc, i, cmap[j], cmap[j + 1], cmap[j + 2]);
+               j += 3;
+       }
+}
+
+static void
 agten_gfx(struct agten_softc *sc)
 {
        /* enable overlay transparency on colour 0x00 */



Home | Main Index | Thread Index | Old Index