Module Name: src Committed By: reinoud Date: Fri Dec 30 11:32:57 UTC 2011
Modified Files: src/sys/arch/usermode/include: thunk.h src/sys/arch/usermode/usermode: thunk.c Log Message: Add RFB type flag to indicate what kind of request is waiting To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/arch/usermode/include/thunk.h cvs rdiff -u -r1.60 -r1.61 src/sys/arch/usermode/usermode/thunk.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/include/thunk.h diff -u src/sys/arch/usermode/include/thunk.h:1.48 src/sys/arch/usermode/include/thunk.h:1.49 --- src/sys/arch/usermode/include/thunk.h:1.48 Fri Dec 30 09:36:01 2011 +++ src/sys/arch/usermode/include/thunk.h Fri Dec 30 11:32:57 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: thunk.h,v 1.48 2011/12/30 09:36:01 jmcneill Exp $ */ +/* $NetBSD: thunk.h,v 1.49 2011/12/30 11:32:57 reinoud Exp $ */ /*- * Copyright (c) 2011 Jared D. McNeill <jmcne...@invisible.ca> @@ -190,9 +190,15 @@ typedef struct { } data; } thunk_rfb_event_t; + typedef struct { + uint8_t type; uint16_t x, y, w, h; + uint32_t colour; /* for RRE clear */ } thunk_rfb_update_t; +#define THUNK_RFB_TYPE_UPDATE 0 +#define THUNK_RFB_TYPE_COPYRECT 1 +#define THUNK_RFB_TYPE_RRE 2 /* rectangle fill */ #define THUNK_RFB_QUEUELEN 128 @@ -208,8 +214,10 @@ typedef struct { uint8_t depth; char name[64]; uint8_t *framebuf; - thunk_rfb_update_t update[THUNK_RFB_QUEUELEN]; + unsigned int nupdates; + unsigned int first_mergable; + thunk_rfb_update_t update[THUNK_RFB_QUEUELEN]; } thunk_rfb_t; int thunk_rfb_open(thunk_rfb_t *, uint16_t); Index: src/sys/arch/usermode/usermode/thunk.c diff -u src/sys/arch/usermode/usermode/thunk.c:1.60 src/sys/arch/usermode/usermode/thunk.c:1.61 --- src/sys/arch/usermode/usermode/thunk.c:1.60 Fri Dec 30 11:06:18 2011 +++ src/sys/arch/usermode/usermode/thunk.c Fri Dec 30 11:32:57 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: thunk.c,v 1.60 2011/12/30 11:06:18 jmcneill Exp $ */ +/* $NetBSD: thunk.c,v 1.61 2011/12/30 11:32:57 reinoud Exp $ */ /*- * Copyright (c) 2011 Jared D. McNeill <jmcne...@invisible.ca> @@ -28,7 +28,7 @@ #include <sys/cdefs.h> #ifdef __NetBSD__ -__RCSID("$NetBSD: thunk.c,v 1.60 2011/12/30 11:06:18 jmcneill Exp $"); +__RCSID("$NetBSD: thunk.c,v 1.61 2011/12/30 11:32:57 reinoud Exp $"); #endif #include <sys/types.h> @@ -76,6 +76,8 @@ __RCSID("$NetBSD: thunk.c,v 1.60 2011/12 #define MAP_ANON MAP_ANONYMOUS #endif +#define RFB_DEBUG + extern int boothowto; void @@ -1051,6 +1053,7 @@ thunk_rfb_send_pending(thunk_rfb_t *rfb) } rfb->nupdates = 0; + rfb->first_mergable = 0; return; @@ -1118,6 +1121,7 @@ thunk_rfb_poll(thunk_rfb_t *rfb, thunk_r } rfb->nupdates = 0; + rfb->first_mergable = 0; thunk_rfb_update(rfb, 0, 0, rfb->width, rfb->height); } @@ -1191,7 +1195,7 @@ thunk_rfb_update(thunk_rfb_t *rfb, int x return; /* no sense in queueing duplicate updates */ - for (n = 0; n < rfb->nupdates; n++) { + for (n = rfb->first_mergable; n < rfb->nupdates; n++) { if (rfb->update[n].x == x && rfb->update[n].y == y && rfb->update[n].w == w && rfb->update[n].h == h) return; @@ -1204,6 +1208,7 @@ thunk_rfb_update(thunk_rfb_t *rfb, int x /* add the update request to the queue */ update = &rfb->update[rfb->nupdates++]; + update->type = THUNK_RFB_TYPE_UPDATE; update->x = x; update->y = y; update->w = w;