Module Name: src
Committed By: jmcneill
Date: Fri Dec 30 08:49:53 UTC 2011
Modified Files:
src/sys/arch/usermode/dev: vncfb.c
Log Message:
send framebuffer updates for cursor changes too
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/usermode/dev/vncfb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/usermode/dev/vncfb.c
diff -u src/sys/arch/usermode/dev/vncfb.c:1.1 src/sys/arch/usermode/dev/vncfb.c:1.2
--- src/sys/arch/usermode/dev/vncfb.c:1.1 Thu Dec 29 21:22:49 2011
+++ src/sys/arch/usermode/dev/vncfb.c Fri Dec 30 08:49:53 2011
@@ -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 <[email protected]>
@@ -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 @@ struct vncfb_fbops {
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_copycols(void *, int,
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 @@ vncfb_init_screen(void *priv, struct vco
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_eraserows(void *priv, int row, int
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)
{