Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/usermode/dev send framebuffer updates for cursor ch...



details:   https://anonhg.NetBSD.org/src/rev/3cf70eae8155
branches:  trunk
changeset: 772328:3cf70eae8155
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Dec 30 08:49:53 2011 +0000

description:
send framebuffer updates for cursor changes too

diffstat:

 sys/arch/usermode/dev/vncfb.c |  32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diffs (80 lines):

diff -r 1ee1b7198fa6 -r 3cf70eae8155 sys/arch/usermode/dev/vncfb.c
--- a/sys/arch/usermode/dev/vncfb.c     Fri Dec 30 08:33:49 2011 +0000
+++ b/sys/arch/usermode/dev/vncfb.c     Fri Dec 30 08:49:53 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vncfb.c,v 1.1 2011/12/29 21:22:49 jmcneill Exp $ */
+/* $NetBSD: vncfb.c,v 1.2 2011/12/30 08:49:53 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -35,7 +35,7 @@
 #include "opt_wsemul.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vncfb.c,v 1.1 2011/12/29 21:22:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vncfb.c,v 1.2 2011/12/30 08:49:53 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -63,6 +63,7 @@
        void    (*copyrows)(void *, int, int, int);
        void    (*eraserows)(void *, int, int, long);
        void    (*putchar)(void *, int, int, u_int, long);
+       void    (*cursor)(void *, int, int, int);
 };
 
 struct vncfb_softc {
@@ -94,6 +95,7 @@
 static void    vncfb_erasecols(void *, int, int, int, long);
 static void    vncfb_copyrows(void *, int, int, int);
 static void    vncfb_eraserows(void *, int, int, long);
+static void    vncfb_cursor(void *, int, int, int);
 
 static int     vncfb_ioctl(void *, void *, u_long, void *, int, lwp_t *);
 static paddr_t vncfb_mmap(void *, void *, off_t, int);
@@ -269,12 +271,14 @@
        ops->eraserows = ri->ri_ops.eraserows;
        ops->copycols = ri->ri_ops.copycols;
        ops->erasecols = ri->ri_ops.erasecols;
+       ops->cursor = ri->ri_ops.cursor;
 
        ri->ri_ops.copyrows = vncfb_copyrows;
        ri->ri_ops.copycols = vncfb_copycols;
        ri->ri_ops.eraserows = vncfb_eraserows;
        ri->ri_ops.erasecols = vncfb_erasecols;
        ri->ri_ops.putchar = vncfb_putchar;
+       ri->ri_ops.cursor = vncfb_cursor;
 }
 
 static void
@@ -383,6 +387,30 @@
        vncfb_update(sc, x, y, w, h);
 }
 
+static void
+vncfb_cursor(void *priv, int on, int row, int col)
+{
+       struct rasops_info *ri = priv;
+       struct vcons_screen *scr = ri->ri_hw;
+       struct vncfb_softc *sc = scr->scr_cookie;
+       struct vncfb_fbops *ops = &sc->sc_ops;
+       int ox, oy, x, y, w, h;
+
+       w = ri->ri_font->fontwidth;
+       h = ri->ri_font->fontheight;
+
+       ox = ri->ri_ccol * w + ri->ri_xorigin;
+       oy = ri->ri_crow * h + ri->ri_yorigin;
+
+       ops->cursor(ri, on, row, col);
+
+       x = ri->ri_ccol * w + ri->ri_xorigin;
+       y = ri->ri_crow * h + ri->ri_yorigin;
+
+       vncfb_update(sc, ox, oy, w, h);
+       vncfb_update(sc, x, y, w, h);
+}
+
 static int
 vncfb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, lwp_t *l)
 {



Home | Main Index | Thread Index | Old Index