Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/usermode support wskbd bell
details: https://anonhg.NetBSD.org/src/rev/9478a94322ec
branches: trunk
changeset: 772342:9478a94322ec
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Fri Dec 30 12:54:41 2011 +0000
description:
support wskbd bell
diffstat:
sys/arch/usermode/dev/vncfb.c | 22 +++++++++++++++++++---
sys/arch/usermode/include/thunk.h | 4 +++-
sys/arch/usermode/usermode/thunk.c | 22 ++++++++++++++++++----
3 files changed, 40 insertions(+), 8 deletions(-)
diffs (154 lines):
diff -r fbc5de612fc6 -r 9478a94322ec sys/arch/usermode/dev/vncfb.c
--- a/sys/arch/usermode/dev/vncfb.c Fri Dec 30 12:47:37 2011 +0000
+++ b/sys/arch/usermode/dev/vncfb.c Fri Dec 30 12:54:41 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vncfb.c,v 1.4 2011/12/30 11:06:18 jmcneill Exp $ */
+/* $NetBSD: vncfb.c,v 1.5 2011/12/30 12:54:41 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.4 2011/12/30 11:06:18 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vncfb.c,v 1.5 2011/12/30 12:54:41 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -112,6 +112,7 @@
static void vncfb_kbd_cngetc(void *, u_int *, int *);
static void vncfb_kbd_cnpollc(void *, int);
+static void vncfb_kbd_bell(void *, u_int, u_int, u_int);
static struct vcons_screen vncfb_console_screen;
@@ -152,7 +153,7 @@
static const struct wskbd_consops vncfb_kbd_consops = {
vncfb_kbd_cngetc,
vncfb_kbd_cnpollc,
- NULL, /* bell */
+ vncfb_kbd_bell,
};
static int
@@ -506,10 +507,16 @@
static int
vncfb_kbd_ioctl(void *priv, u_long cmd, void *data, int flag, lwp_t *l)
{
+ struct wskbd_bell_data *bd;
+
switch (cmd) {
case WSKBDIO_GTYPE:
*(int *)data = WSKBD_TYPE_RFB;
return 0;
+ case WSKBDIO_COMPLEXBELL:
+ bd = data;
+ vncfb_kbd_bell(priv, bd->pitch, bd->period, bd->volume);
+ return 0;
default:
return EPASSTHROUGH;
}
@@ -524,3 +531,12 @@
vncfb_kbd_cnpollc(void *priv, int on)
{
}
+
+static void
+vncfb_kbd_bell(void *priv, u_int pitch, u_int period, u_int volume)
+{
+ struct vncfb_softc *sc = priv;
+
+ thunk_rfb_bell(&sc->sc_rfb);
+ softint_schedule(sc->sc_sih);
+}
diff -r fbc5de612fc6 -r 9478a94322ec sys/arch/usermode/include/thunk.h
--- a/sys/arch/usermode/include/thunk.h Fri Dec 30 12:47:37 2011 +0000
+++ b/sys/arch/usermode/include/thunk.h Fri Dec 30 12:54:41 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.h,v 1.50 2011/12/30 12:07:33 reinoud Exp $ */
+/* $NetBSD: thunk.h,v 1.51 2011/12/30 12:54:41 jmcneill Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -216,6 +216,7 @@
char name[64];
uint8_t *framebuf;
+ bool schedule_bell;
unsigned int nupdates;
unsigned int first_mergable;
thunk_rfb_update_t update[THUNK_RFB_QUEUELEN];
@@ -223,6 +224,7 @@
int thunk_rfb_open(thunk_rfb_t *, uint16_t);
int thunk_rfb_poll(thunk_rfb_t *, thunk_rfb_event_t *);
+void thunk_rfb_bell(thunk_rfb_t *);
void thunk_rfb_update(thunk_rfb_t *, int, int, int, int);
void thunk_rfb_copyrect(thunk_rfb_t *, int, int, int, int, int, int);
diff -r fbc5de612fc6 -r 9478a94322ec sys/arch/usermode/usermode/thunk.c
--- a/sys/arch/usermode/usermode/thunk.c Fri Dec 30 12:47:37 2011 +0000
+++ b/sys/arch/usermode/usermode/thunk.c Fri Dec 30 12:54:41 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.c,v 1.63 2011/12/30 12:13:31 jmcneill Exp $ */
+/* $NetBSD: thunk.c,v 1.64 2011/12/30 12:54:42 jmcneill Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifdef __NetBSD__
-__RCSID("$NetBSD: thunk.c,v 1.63 2011/12/30 12:13:31 jmcneill Exp $");
+__RCSID("$NetBSD: thunk.c,v 1.64 2011/12/30 12:54:42 jmcneill Exp $");
#endif
#include <sys/types.h>
@@ -76,8 +76,6 @@
#define MAP_ANON MAP_ANONYMOUS
#endif
-#define RFB_DEBUG
-
extern int boothowto;
void
@@ -1124,6 +1122,7 @@
return -1;
}
+ rfb->schedule_bell = false;
rfb->nupdates = 0;
rfb->first_mergable = 0;
thunk_rfb_update(rfb, 0, 0, rfb->width, rfb->height);
@@ -1133,6 +1132,12 @@
if (rfb->clientfd == -1)
return -1;
+ if (rfb->schedule_bell) {
+ uint8_t msg_type = 2; /* bell */
+ safe_send(rfb->clientfd, &msg_type, sizeof(msg_type));
+ rfb->schedule_bell = false;
+ }
+
error = ioctl(rfb->clientfd, FIONREAD, &len);
if (error) {
//printf("rfb: FIONREAD failed: %s\n", strerror(errno));
@@ -1225,6 +1230,15 @@
}
void
+thunk_rfb_bell(thunk_rfb_t *rfb)
+{
+#ifdef RFB_DEBUG
+ fprintf(stdout, "rfb: schedule bell\n");
+#endif
+ rfb->schedule_bell = true;
+}
+
+void
thunk_rfb_copyrect(thunk_rfb_t *rfb, int x, int y, int w, int h,
int srcx, int srcy)
{
Home |
Main Index |
Thread Index |
Old Index