CVS commit: src/sys/dev/wscons
Module Name:src Committed By: macallan Date: Tue Feb 20 09:53:16 UTC 2024 Modified Files: src/sys/dev/wscons: wsdisplay_glyphcache.c Log Message: remove check for unused bits in attr2idx() - this really wasn't helpful To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/wscons/wsdisplay_glyphcache.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/dev/wscons/wsdisplay_glyphcache.c diff -u src/sys/dev/wscons/wsdisplay_glyphcache.c:1.12 src/sys/dev/wscons/wsdisplay_glyphcache.c:1.13 --- src/sys/dev/wscons/wsdisplay_glyphcache.c:1.12 Thu Jun 8 05:48:41 2023 +++ src/sys/dev/wscons/wsdisplay_glyphcache.c Tue Feb 20 09:53:16 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_glyphcache.c,v 1.12 2023/06/08 05:48:41 macallan Exp $ */ +/* $NetBSD: wsdisplay_glyphcache.c,v 1.13 2024/02/20 09:53:16 macallan Exp $ */ /* * Copyright (c) 2012 Michael Lorenz @@ -53,9 +53,6 @@ static inline int attr2idx(long attr) { - if ((attr & 0xf0f00ff8) != 0) - return -1; - return (((attr >> 16) & 0x0f) | ((attr >> 20) & 0xf0)); }
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: macallan Date: Tue Feb 20 09:53:16 UTC 2024 Modified Files: src/sys/dev/wscons: wsdisplay_glyphcache.c Log Message: remove check for unused bits in attr2idx() - this really wasn't helpful To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/wscons/wsdisplay_glyphcache.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: jmcneill Date: Sat Jan 20 00:23:13 UTC 2024 Modified Files: src/sys/dev/wscons: wsconsio.h Log Message: wscons: Add HOLLYWOOD display and YUY2 pixel format types To generate a diff of this commit: cvs rdiff -u -r1.126 -r1.127 src/sys/dev/wscons/wsconsio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/wscons/wsconsio.h diff -u src/sys/dev/wscons/wsconsio.h:1.126 src/sys/dev/wscons/wsconsio.h:1.127 --- src/sys/dev/wscons/wsconsio.h:1.126 Tue Sep 28 06:14:27 2021 +++ src/sys/dev/wscons/wsconsio.h Sat Jan 20 00:23:12 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: wsconsio.h,v 1.126 2021/09/28 06:14:27 nia Exp $ */ +/* $NetBSD: wsconsio.h,v 1.127 2024/01/20 00:23:12 jmcneill Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -366,6 +366,7 @@ struct wsmouse_parameters { #define WSDISPLAY_TYPE_PLATINUM 64 /* onboard fb in PowerMac 7200 */ #define WSDISPLAY_TYPE_PLFB 65 /* ARM PrimeCell PL11x */ #define WSDISPLAY_TYPE_SSDFB 66 /* ssdfb(4) */ +#define WSDISPLAY_TYPE_HOLLYWOOD 67 /* Nintendo Wii "Hollywood" SoC */ /* Basic display information. Not applicable to all display types. */ struct wsdisplay_fbinfo { @@ -649,6 +650,7 @@ struct wsdisplayio_edid_info { #define WSFB_CI 1 /* colour indexed, see subtype */ #define WSFB_GREYSCALE 2 #define WSFB_YUV 3 +#define WSFB_YUY2 4 struct wsdisplayio_fbinfo { uint64_t fbi_fbsize; /* framebuffer size in bytes */
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: jmcneill Date: Sat Jan 20 00:23:13 UTC 2024 Modified Files: src/sys/dev/wscons: wsconsio.h Log Message: wscons: Add HOLLYWOOD display and YUY2 pixel format types To generate a diff of this commit: cvs rdiff -u -r1.126 -r1.127 src/sys/dev/wscons/wsconsio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: mlelstv Date: Mon Dec 11 13:38:13 UTC 2023 Modified Files: src/sys/dev/wscons: wsksymdef.h Log Message: Adjust next key value (it's not used anywhere). To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/dev/wscons/wsksymdef.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/wscons/wsksymdef.h diff -u src/sys/dev/wscons/wsksymdef.h:1.77 src/sys/dev/wscons/wsksymdef.h:1.78 --- src/sys/dev/wscons/wsksymdef.h:1.77 Wed Sep 22 17:37:32 2021 +++ src/sys/dev/wscons/wsksymdef.h Mon Dec 11 13:38:13 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsksymdef.h,v 1.77 2021/09/22 17:37:32 nia Exp $ */ +/* $NetBSD: wsksymdef.h,v 1.78 2023/12/11 13:38:13 mlelstv Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -687,7 +687,7 @@ action(KB_UA, 0, 0x1200, "ua", , "Ukrain /* Define all the KB_xx numeric values using above table */ #define KBF_ENUM(tag, tagf, value, cc, ccf, country) tag=value, -enum { KB_ENC_FUN(KBF_ENUM) KB_NEXT=0x1d00 }; +enum { KB_ENC_FUN(KBF_ENUM) KB_NEXT=0x2200 }; /* Define list of KB_xxx and country codes for array initialisation */ #define KBF_ENCTAB(tag, tagf, value, cc, ccf, country) { tag, cc },
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: mlelstv Date: Mon Dec 11 13:38:13 UTC 2023 Modified Files: src/sys/dev/wscons: wsksymdef.h Log Message: Adjust next key value (it's not used anywhere). To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/dev/wscons/wsksymdef.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Thu Aug 3 22:11:41 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: fix comment - CPR is not DSR DSRs (device status report) are 'n', but cursor position report is 'R' To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/dev/wscons/wsemul_vt100_subr.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/dev/wscons/wsemul_vt100_subr.c diff -u src/sys/dev/wscons/wsemul_vt100_subr.c:1.33 src/sys/dev/wscons/wsemul_vt100_subr.c:1.34 --- src/sys/dev/wscons/wsemul_vt100_subr.c:1.33 Thu Aug 3 02:25:09 2023 +++ src/sys/dev/wscons/wsemul_vt100_subr.c Thu Aug 3 22:11:41 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100_subr.c,v 1.33 2023/08/03 02:25:09 uwe Exp $ */ +/* $NetBSD: wsemul_vt100_subr.c,v 1.34 2023/08/03 22:11:41 uwe Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.33 2023/08/03 02:25:09 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.34 2023/08/03 22:11:41 uwe Exp $"); #include #include @@ -612,7 +612,7 @@ wsemul_vt100_handle_csi(struct vt100base /* 0 = OK, 3 = malfunction */ wsdisplay_emulinput(vd->cbcookie, "\033[0n", 4); break; - case 6: { /* DSR cursor position report */ + case 6: { /* CPR cursor position report */ char buf[20]; int row; if (vd->flags & VTFL_DECOM)
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Thu Aug 3 22:11:41 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: fix comment - CPR is not DSR DSRs (device status report) are 'n', but cursor position report is 'R' To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/dev/wscons/wsemul_vt100_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Thu Aug 3 02:25:09 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: fix IL/DL to match specified behavior Acoording to DEC manuals: "The cursor is reset to the first column. This sequence is ignored when the cursor is outside the scrolling region." To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/dev/wscons/wsemul_vt100_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Thu Aug 3 02:25:09 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: fix IL/DL to match specified behavior Acoording to DEC manuals: "The cursor is reset to the first column. This sequence is ignored when the cursor is outside the scrolling region." To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/dev/wscons/wsemul_vt100_subr.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/dev/wscons/wsemul_vt100_subr.c diff -u src/sys/dev/wscons/wsemul_vt100_subr.c:1.32 src/sys/dev/wscons/wsemul_vt100_subr.c:1.33 --- src/sys/dev/wscons/wsemul_vt100_subr.c:1.32 Thu Aug 3 02:04:17 2023 +++ src/sys/dev/wscons/wsemul_vt100_subr.c Thu Aug 3 02:25:09 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100_subr.c,v 1.32 2023/08/03 02:04:17 uwe Exp $ */ +/* $NetBSD: wsemul_vt100_subr.c,v 1.33 2023/08/03 02:25:09 uwe Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.32 2023/08/03 02:04:17 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.33 2023/08/03 02:25:09 uwe Exp $"); #include #include @@ -436,6 +436,10 @@ wsemul_vt100_handle_csi(struct vt100base break; case 'L': /* IL insert line */ case 'M': /* DL delete line */ + /* ignored when the cursor is outside the scrolling region */ + if (vd->crow < vd->scrreg_startrow + || vd->scrreg_startrow + vd->scrreg_nrows <= vd->crow) + break; n = uimin(DEF1_ARG(vd, 0), ROWS_BELOW(vd) + 1); { int savscrstartrow, savscrnrows; @@ -450,6 +454,7 @@ wsemul_vt100_handle_csi(struct vt100base vd->scrreg_startrow = savscrstartrow; vd->scrreg_nrows = savscrnrows; } + vd->ccol = 0; break; case 'P': /* DCH delete character */ n = uimin(DEF1_ARG(vd, 0), COLS_LEFT(vd) + 1);
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Thu Aug 3 02:04:17 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: properly clamp CUU/CUD parameter If the cursor is outside of the scrolling region the movement should stop at the screen border. Reported by David Leadbeater. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/dev/wscons/wsemul_vt100_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Thu Aug 3 02:04:17 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: properly clamp CUU/CUD parameter If the cursor is outside of the scrolling region the movement should stop at the screen border. Reported by David Leadbeater. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/dev/wscons/wsemul_vt100_subr.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/dev/wscons/wsemul_vt100_subr.c diff -u src/sys/dev/wscons/wsemul_vt100_subr.c:1.31 src/sys/dev/wscons/wsemul_vt100_subr.c:1.32 --- src/sys/dev/wscons/wsemul_vt100_subr.c:1.31 Wed Jul 26 10:46:01 2023 +++ src/sys/dev/wscons/wsemul_vt100_subr.c Thu Aug 3 02:04:17 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100_subr.c,v 1.31 2023/07/26 10:46:01 uwe Exp $ */ +/* $NetBSD: wsemul_vt100_subr.c,v 1.32 2023/08/03 02:04:17 uwe Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.31 2023/07/26 10:46:01 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.32 2023/08/03 02:04:17 uwe Exp $"); #include #include @@ -396,11 +396,21 @@ wsemul_vt100_handle_csi(struct vt100base ERASECOLS(vd, vd->ccol, n, vd->bkgdattr); break; case 'A': /* CUU */ - vd->crow -= uimin(DEF1_ARG(vd, 0), ROWS_ABOVE(vd)); + /* stop at the top scroll margin */ + m = vd->scrreg_startrow; + if (vd->crow < m)/* but if already above the margin */ + m = 0; /* then at the screen top */ + help = vd->crow - m; /* rows above */ + vd->crow -= uimin(DEF1_ARG(vd, 0), help); CHECK_DW(vd); break; case 'B': /* CUD */ - vd->crow += uimin(DEF1_ARG(vd, 0), ROWS_BELOW(vd)); + /* stop at the bottom scroll margin */ + m = vd->scrreg_startrow + vd->scrreg_nrows - 1; + if (vd->crow > m) /* but if already below the margin */ + m = vd->nrows - 1; /* then at the screen bottom */ + help = m - vd->crow; /* rows below */ + vd->crow += uimin(DEF1_ARG(vd, 0), help); CHECK_DW(vd); break; case 'C': /* CUF */
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Wed Aug 2 22:37:02 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100.c Log Message: wsemul_vt100: fix RI to not scroll outside of scroll region This is the inverse (scroll down) of the problem reported and fixed for IND (scroll up) in PR kern/11827 back in 2000. We only have one call site for this, but still move this bit of code into a separate wsemul_vt100_prevline function to make it symmetric with wsemul_vt100_nextline. While here, make both take vt100base_data. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/wscons/wsemul_vt100.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/dev/wscons/wsemul_vt100.c diff -u src/sys/dev/wscons/wsemul_vt100.c:1.51 src/sys/dev/wscons/wsemul_vt100.c:1.52 --- src/sys/dev/wscons/wsemul_vt100.c:1.51 Sun Jul 16 17:43:50 2023 +++ src/sys/dev/wscons/wsemul_vt100.c Wed Aug 2 22:37:02 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100.c,v 1.51 2023/07/16 17:43:50 christos Exp $ */ +/* $NetBSD: wsemul_vt100.c,v 1.52 2023/08/02 22:37:02 uwe Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100.c,v 1.51 2023/07/16 17:43:50 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100.c,v 1.52 2023/08/02 22:37:02 uwe Exp $"); #ifdef _KERNEL_OPT #include "opt_wsmsgattrs.h" @@ -88,7 +88,10 @@ static void wsemul_vt100_output_normal(s u_char, int); static void wsemul_vt100_output_c0c1(struct wsemul_vt100_emuldata *, u_char, int); -static void wsemul_vt100_nextline(struct wsemul_vt100_emuldata *); + +static void wsemul_vt100_nextline(struct vt100base_data *); /* IND */ +static void wsemul_vt100_prevline(struct vt100base_data *); /* RI */ + typedef u_int vt100_handler(struct wsemul_vt100_emuldata *, u_char); static vt100_handler @@ -364,14 +367,15 @@ wsemul_vt100_reset(struct wsemul_vt100_e */ /* - * Move the cursor to the next line if possible. If the cursor is at - * the bottom of the scroll area, then scroll it up. If the cursor is + * New line (including autowrap), index (IND). + * + * Move the cursor to the next line if possible. If the cursor is at + * the bottom of the scroll area, then scroll it up. If the cursor is * at the bottom of the screen then don't move it down. */ static void -wsemul_vt100_nextline(struct wsemul_vt100_emuldata *edp) +wsemul_vt100_nextline(struct vt100base_data *vd) { - struct vt100base_data *vd = &edp->bd; if (ROWS_BELOW(vd) == 0) { /* Bottom of the scroll region. */ @@ -384,6 +388,26 @@ wsemul_vt100_nextline(struct wsemul_vt10 } } +/* + * Reverse index (RI). + * + * Inverse of wsemul_vt100_nextline. Move up, scroll down. + */ +static void +wsemul_vt100_prevline(struct vt100base_data *vd) +{ + + if (ROWS_ABOVE(vd) == 0) { + /* Top of the scroll region. */ + wsemul_vt100_scrolldown(vd, 1); + } else { + if (vd->crow > 0) + /* Cursor not at the top of the screen. */ + vd->crow--; + CHECK_DW(vd); + } +} + static void wsemul_vt100_output_normal(struct wsemul_vt100_emuldata *edp, u_char c, int kernel) @@ -393,7 +417,7 @@ wsemul_vt100_output_normal(struct wsemul if ((vd->flags & (VTFL_LASTCHAR | VTFL_DECAWM)) == (VTFL_LASTCHAR | VTFL_DECAWM)) { - wsemul_vt100_nextline(edp); + wsemul_vt100_nextline(vd); vd->ccol = 0; vd->flags &= ~VTFL_LASTCHAR; } @@ -509,7 +533,7 @@ wsemul_vt100_output_c0c1(struct wsemul_v case ASCII_LF: case ASCII_VT: case ASCII_FF: - wsemul_vt100_nextline(edp); + wsemul_vt100_nextline(vd); break; } } @@ -565,7 +589,7 @@ wsemul_vt100_output_esc(struct wsemul_vt vd->ccol = 0; /* FALLTHRU */ case 'D': /* IND */ - wsemul_vt100_nextline(edp); + wsemul_vt100_nextline(vd); break; case 'H': /* HTS */ KASSERT(vd->tabs != 0); @@ -593,12 +617,7 @@ wsemul_vt100_output_esc(struct wsemul_vt edp->sschartab = 3; break; case 'M': /* RI */ - if (ROWS_ABOVE(vd) > 0) { - vd->crow--; - CHECK_DW(vd); - break; - } - wsemul_vt100_scrolldown(vd, 1); + wsemul_vt100_prevline(vd); break; case 'P': /* DCS */ vd->nargs = 0;
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Wed Aug 2 22:37:02 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100.c Log Message: wsemul_vt100: fix RI to not scroll outside of scroll region This is the inverse (scroll down) of the problem reported and fixed for IND (scroll up) in PR kern/11827 back in 2000. We only have one call site for this, but still move this bit of code into a separate wsemul_vt100_prevline function to make it symmetric with wsemul_vt100_nextline. While here, make both take vt100base_data. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/wscons/wsemul_vt100.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 30 10:45:11 UTC 2023 Modified Files: src/sys/dev/wscons: wsmouse.c Log Message: wsmouse(4): Make wsmouse_input safe to call from MP-safe interrupts. XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sys/dev/wscons/wsmouse.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/dev/wscons/wsmouse.c diff -u src/sys/dev/wscons/wsmouse.c:1.72 src/sys/dev/wscons/wsmouse.c:1.73 --- src/sys/dev/wscons/wsmouse.c:1.72 Sun Jul 17 11:44:30 2022 +++ src/sys/dev/wscons/wsmouse.c Sun Jul 30 10:45:11 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsmouse.c,v 1.72 2022/07/17 11:44:30 riastradh Exp $ */ +/* $NetBSD: wsmouse.c,v 1.73 2023/07/30 10:45:11 riastradh Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -104,7 +104,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.72 2022/07/17 11:44:30 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.73 2023/07/30 10:45:11 riastradh Exp $"); #include "wsmouse.h" #include "wsdisplay.h" @@ -372,17 +372,19 @@ wsmouse_input(device_t wsmousedev, u_int /* one for each dimension (4) + a bit for each button */ struct wscons_event events[4 + sizeof(d) * 8]; + KERNEL_LOCK(1, NULL); + /* * Discard input if not open. */ evar = sc->sc_base.me_evp; if (evar == NULL) - return; + goto out; #ifdef DIAGNOSTIC if (evar->q == NULL) { printf("wsmouse_input: evar->q=NULL\n"); - return; + goto out; } #endif @@ -528,6 +530,8 @@ wsmouse_input(device_t wsmousedev, u_int device_xname(sc->sc_base.me_dv), evar)); #endif } + +out: KERNEL_UNLOCK_ONE(NULL); } void
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 30 10:45:11 UTC 2023 Modified Files: src/sys/dev/wscons: wsmouse.c Log Message: wsmouse(4): Make wsmouse_input safe to call from MP-safe interrupts. XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sys/dev/wscons/wsmouse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Wed Jul 26 10:46:01 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: complete the refactoring from 2010 In 1.20 refactoring, functions in this file were changed to accept a pointer to the new base class instead of the full emuldata: -wsemul_vt100_foo(struct wsemul_vt100_emuldata *edp, ...) +wsemul_vt100_foo(struct vt100base_data *edp, ...) but the argument name was not changed. While this saved on the diff churn back then, it created a rather unfortunate situation where the same emulation state variables are referred to differently in this file and other vt100 emulation files. Complete that old change by renaming the base class arguments to match the variable name used for it in other files. Same object code is generated. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/dev/wscons/wsemul_vt100_subr.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/dev/wscons/wsemul_vt100_subr.c diff -u src/sys/dev/wscons/wsemul_vt100_subr.c:1.30 src/sys/dev/wscons/wsemul_vt100_subr.c:1.31 --- src/sys/dev/wscons/wsemul_vt100_subr.c:1.30 Sun Feb 26 14:00:42 2023 +++ src/sys/dev/wscons/wsemul_vt100_subr.c Wed Jul 26 10:46:01 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100_subr.c,v 1.30 2023/02/26 14:00:42 uwe Exp $ */ +/* $NetBSD: wsemul_vt100_subr.c,v 1.31 2023/07/26 10:46:01 uwe Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.30 2023/02/26 14:00:42 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.31 2023/07/26 10:46:01 uwe Exp $"); #include #include @@ -54,98 +54,98 @@ static int vt100_decmode(struct vt100bas * scroll up within scrolling region */ void -wsemul_vt100_scrollup(struct vt100base_data *edp, int n) +wsemul_vt100_scrollup(struct vt100base_data *vd, int n) { int help; - if (n > edp->scrreg_nrows) - n = edp->scrreg_nrows; + if (n > vd->scrreg_nrows) + n = vd->scrreg_nrows; - help = edp->scrreg_nrows - n; + help = vd->scrreg_nrows - n; if (help > 0) { - (*edp->emulops->copyrows)(edp->emulcookie, - edp->scrreg_startrow + n, - edp->scrreg_startrow, + (*vd->emulops->copyrows)(vd->emulcookie, + vd->scrreg_startrow + n, + vd->scrreg_startrow, help); - if (edp->dblwid) - memmove(&edp->dblwid[edp->scrreg_startrow], -&edp->dblwid[edp->scrreg_startrow + n], + if (vd->dblwid) + memmove(&vd->dblwid[vd->scrreg_startrow], +&vd->dblwid[vd->scrreg_startrow + n], help); } - (*edp->emulops->eraserows)(edp->emulcookie, - edp->scrreg_startrow + help, n, - edp->bkgdattr); - if (edp->dblwid) - memset(&edp->dblwid[edp->scrreg_startrow + help], 0, n); - CHECK_DW(edp); + (*vd->emulops->eraserows)(vd->emulcookie, + vd->scrreg_startrow + help, n, + vd->bkgdattr); + if (vd->dblwid) + memset(&vd->dblwid[vd->scrreg_startrow + help], 0, n); + CHECK_DW(vd); } /* * scroll down within scrolling region */ void -wsemul_vt100_scrolldown(struct vt100base_data *edp, int n) +wsemul_vt100_scrolldown(struct vt100base_data *vd, int n) { int help; - if (n > edp->scrreg_nrows) - n = edp->scrreg_nrows; + if (n > vd->scrreg_nrows) + n = vd->scrreg_nrows; - help = edp->scrreg_nrows - n; + help = vd->scrreg_nrows - n; if (help > 0) { - (*edp->emulops->copyrows)(edp->emulcookie, - edp->scrreg_startrow, - edp->scrreg_startrow + n, + (*vd->emulops->copyrows)(vd->emulcookie, + vd->scrreg_startrow, + vd->scrreg_startrow + n, help); - if (edp->dblwid) - memmove(&edp->dblwid[edp->scrreg_startrow + n], -&edp->dblwid[edp->scrreg_startrow], + if (vd->dblwid) + memmove(&vd->dblwid[vd->scrreg_startrow + n], +&vd->dblwid[vd->scrreg_startrow], help); } - (*edp->emulops->eraserows)(edp->emulcookie, - edp->scrreg_startrow, n, - edp->bkgdattr); - if (edp->dblwid) - memset(&edp->dblwid[edp->scrreg_startrow], 0, n); - CHECK_DW(edp); + (*vd->emulops->eraserows)(vd->emulcookie, + vd->scrreg_startrow, n, + vd->bkgdattr); + if (vd->dblwid) + memset(&vd->dblwid[vd->scrreg_startrow], 0, n); + CHECK_DW(vd); } /* * erase in display */ void -wsemul_vt100_ed(struct vt100base_data *edp, int arg) +wsemul_vt100_ed(struct vt100base_data *vd, int arg) { int n; switch (arg) { case 0: /* cursor to end */ - ERASECOLS(edp, edp->ccol, COLS_LEFT(edp) + 1, edp->bkgdattr); - n = edp->nrows - edp->crow - 1; + ERASECOLS(vd, vd->ccol, COLS_LEFT(vd) + 1, vd->bkgdattr); + n = vd->nrows - vd->crow - 1; if (n > 0) { - (*edp->emulops->eraserows)(edp->emulcookie, - edp->crow + 1, n, - edp->bkgdattr); - if (edp->dblwid) -memset(&edp->dblwid[edp->crow + 1], 0, n); + (*vd->emulops->eraserows)(vd->emulcookie, + vd->crow + 1
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Wed Jul 26 10:46:01 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: complete the refactoring from 2010 In 1.20 refactoring, functions in this file were changed to accept a pointer to the new base class instead of the full emuldata: -wsemul_vt100_foo(struct wsemul_vt100_emuldata *edp, ...) +wsemul_vt100_foo(struct vt100base_data *edp, ...) but the argument name was not changed. While this saved on the diff churn back then, it created a rather unfortunate situation where the same emulation state variables are referred to differently in this file and other vt100 emulation files. Complete that old change by renaming the base class arguments to match the variable name used for it in other files. Same object code is generated. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/dev/wscons/wsemul_vt100_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: christos Date: Sun Jul 16 17:43:50 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100.c Log Message: Avoid overflow with too many ';' (David Leadbeater) Prefix all messages with the method name To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/dev/wscons/wsemul_vt100.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/dev/wscons/wsemul_vt100.c diff -u src/sys/dev/wscons/wsemul_vt100.c:1.50 src/sys/dev/wscons/wsemul_vt100.c:1.51 --- src/sys/dev/wscons/wsemul_vt100.c:1.50 Wed Feb 22 21:48:06 2023 +++ src/sys/dev/wscons/wsemul_vt100.c Sun Jul 16 13:43:50 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100.c,v 1.50 2023/02/23 02:48:06 riastradh Exp $ */ +/* $NetBSD: wsemul_vt100.c,v 1.51 2023/07/16 17:43:50 christos Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100.c,v 1.50 2023/02/23 02:48:06 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100.c,v 1.51 2023/07/16 17:43:50 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_wsmsgattrs.h" @@ -628,7 +628,7 @@ wsemul_vt100_output_esc(struct wsemul_vt break; default: #ifdef VT100_PRINTUNKNOWN - printf("ESC%c unknown\n", c); + printf("%s: ESC%c unknown\n", __func__, c); #endif break; } @@ -659,7 +659,8 @@ wsemul_vt100_output_scs94(struct wsemul_ break; default: #ifdef VT100_PRINTUNKNOWN - printf("ESC%c%c unknown\n", edp->designating + '(', c); + printf("%s: ESC%c%c unknown\n", __func__, + edp->designating + '(', c); #endif break; } @@ -676,7 +677,8 @@ wsemul_vt100_output_scs94_percent(struct break; default: #ifdef VT100_PRINTUNKNOWN - printf("ESC%c%%%c unknown\n", edp->designating + '(', c); + printf("%s: ESC%c%%%c unknown\n", + __func__, edp->designating + '(', c); #endif break; } @@ -728,7 +730,8 @@ setnrc: break; default: #ifdef VT100_PRINTUNKNOWN - printf("ESC%c%c unknown\n", edp->designating + '-' - 1, c); + printf("%s: ESC%c%c unknown\n", + __func__, edp->designating + '-' - 1, c); #endif break; } @@ -744,7 +747,8 @@ wsemul_vt100_output_scs96_percent(struct break; default: #ifdef VT100_PRINTUNKNOWN - printf("ESC%c%%%c unknown\n", edp->designating + '-', c); + printf("%s: ESC%c%%%c unknown\n", + __func__, edp->designating + '-', c); #endif break; } @@ -759,12 +763,12 @@ wsemul_vt100_output_esc_spc(struct wsemu case 'F': /* 7-bit controls */ case 'G': /* 8-bit controls */ #ifdef VT100_PRINTNOTIMPL - printf("ESC%c ignored\n", c); + printf("%s: ESC%c ignored\n", __func__, c); #endif break; default: #ifdef VT100_PRINTUNKNOWN - printf("ESC%c unknown\n", c); + printf("%s: ESC%c unknown\n", __func__, c); #endif break; } @@ -807,17 +811,16 @@ wsemul_vt100_output_dcs(struct wsemul_vt vd->args[vd->nargs] = (vd->args[vd->nargs] * 10) + (c - '0'); break; - case ';': /* argument terminator */ - vd->nargs++; - break; default: vd->nargs++; if (vd->nargs > VT100_EMUL_NARGS) { #ifdef VT100_DEBUG - printf("vt100: too many arguments\n"); + printf("%s: too many arguments\n", __func__); #endif vd->nargs = VT100_EMUL_NARGS; } + if (c == ';') /* argument terminator */ + break; switch (c) { case '$': return VT100_EMUL_STATE_DCS_DOLLAR; @@ -826,12 +829,13 @@ wsemul_vt100_output_dcs(struct wsemul_vt /* 'u' must follow - need another state */ case '|': /* DECUDK program F6..F20 */ #ifdef VT100_PRINTNOTIMPL - printf("DCS%c ignored\n", c); + printf("%s: DCS%c ignored\n", __func__, c); #endif break; default: #ifdef VT100_PRINTUNKNOWN - printf("DCS%c (%d, %d) unknown\n", c, ARG(vd, 0), ARG(vd, 1)); + printf("%s: DCS%c (%d, %d) unknown\n", + __func__, c, ARG(vd, 0), ARG(vd, 1)); #endif break; } @@ -850,7 +854,7 @@ wsemul_vt100_output_dcs_dollar(struct ws case 'p': /* DECRSTS terminal state restore */ case 'q': /* DECRQSS control function request */ #ifdef VT100_PRINTNOTIMPL - printf("DCS$%c ignored\n", c); + printf("%s: DCS$%c ignored\n", __func__, c); #endif break; case 't': /* DECRSPS restore presentation state */ @@ -859,7 +863,7 @@ wsemul_vt100_output_dcs_dollar(struct ws break; case 1: /* cursor information restore */ #ifdef VT100_PRINTNOTIMPL - printf("DCS1$t ignored\n"); + printf("%s: DCS1$t ignored\n", __func__); #endif break; case 2: /* tab stop restore */ @@ -868,14 +872,15 @@ wsemul_vt100_output_dcs_dollar(struct ws break; default: #ifdef VT100_PRINTUNKNOWN - printf("DCS%d$t unknown\n", ARG(vd, 0)); + printf("%s: DCS%d$t unknown\n", __func__, ARG(vd, 0)); #endif break; } break; default: #ifdef VT100_PRINTUNKNOWN - printf("DCS$%c (%d, %d) unknown\n", c, ARG(vd, 0), ARG(vd, 1)); + printf("%s: DCS$%c (%d, %d) unknown\n", + __func__, c, ARG(vd, 0), ARG(vd, 1)); #endif br
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: christos Date: Sun Jul 16 17:43:50 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100.c Log Message: Avoid overflow with too many ';' (David Leadbeater) Prefix all messages with the method name To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/dev/wscons/wsemul_vt100.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: macallan Date: Thu Jun 8 05:48:41 UTC 2023 Modified Files: src/sys/dev/wscons: wsdisplay_glyphcache.c wsdisplay_glyphcachevar.h Log Message: allow drivers to specify horizontal alignment of glyph cache cells for things like SX which have alignment restrictions To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/wscons/wsdisplay_glyphcache.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/wscons/wsdisplay_glyphcachevar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/wscons/wsdisplay_glyphcache.c diff -u src/sys/dev/wscons/wsdisplay_glyphcache.c:1.11 src/sys/dev/wscons/wsdisplay_glyphcache.c:1.12 --- src/sys/dev/wscons/wsdisplay_glyphcache.c:1.11 Mon Sep 3 16:29:34 2018 +++ src/sys/dev/wscons/wsdisplay_glyphcache.c Thu Jun 8 05:48:41 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_glyphcache.c,v 1.11 2018/09/03 16:29:34 riastradh Exp $ */ +/* $NetBSD: wsdisplay_glyphcache.c,v 1.12 2023/06/08 05:48:41 macallan Exp $ */ /* * Copyright (c) 2012 Michael Lorenz @@ -53,17 +53,24 @@ static inline int attr2idx(long attr) { - if ((attr & 0xf0f0fff8) != 0) + if ((attr & 0xf0f00ff8) != 0) return -1; return (((attr >> 16) & 0x0f) | ((attr >> 20) & 0xf0)); } -/* first line, lines, width, attr */ int glyphcache_init(glyphcache *gc, int first, int lines, int width, int cellwidth, int cellheight, long attr) { + return glyphcache_init_align(gc, first, lines, width, cellwidth, cellheight, + attr, 0); +} + +int +glyphcache_init_align(glyphcache *gc, int first, int lines, int width, +int cellwidth, int cellheight, long attr, int alignment) +{ /* first the geometry stuff */ if (lines < 0) lines = 0; @@ -72,6 +79,7 @@ glyphcache_init(glyphcache *gc, int firs gc->gc_cellheight = -1; gc->gc_firstline = first; gc->gc_lines = lines; + gc->gc_cellalign = alignment; gc->gc_buckets = NULL; gc->gc_numbuckets = 0; // XXX: Never free? @@ -97,9 +105,16 @@ glyphcache_reconfig(glyphcache *gc, int } gc->gc_cellwidth = cellwidth; + if (gc->gc_cellalign != 0) { + /* alignment in bytes */ + gc->gc_cellstride = + (gc->gc_cellwidth + gc->gc_cellalign - 1) & + ~(gc->gc_cellalign - 1); + } else + gc->gc_cellstride = cellwidth; gc->gc_cellheight = cellheight; - gc->gc_cellsperline = gc->gc_width / cellwidth; + gc->gc_cellsperline = gc->gc_width / gc->gc_cellstride; cache_lines = gc->gc_lines / cellheight; gc->gc_numcells = cache_lines * gc->gc_cellsperline; @@ -144,6 +159,8 @@ glyphcache_reconfig(glyphcache *gc, int glyphcache_wipe(gc); DPRINTF("%s: using %d cells total, from %d width %d\n", __func__, gc->gc_numcells, gc->gc_firstline, gc->gc_cellsperline); + DPRINTF("%s: cell size %d x %d, stride %d\n", __func__, + gc->gc_cellwidth, gc->gc_cellheight, gc->gc_cellstride); return 0; } @@ -209,7 +226,7 @@ glyphcache_add(glyphcache *gc, int c, in cell += b->gb_firstcell; cy = gc->gc_firstline + (cell / gc->gc_cellsperline) * gc->gc_cellheight; - cx = (cell % gc->gc_cellsperline) * gc->gc_cellwidth; + cx = (cell % gc->gc_cellsperline) * gc->gc_cellstride; b->gb_map[c - 33] = (cx << 16) | cy; gc->gc_bitblt(gc->gc_blitcookie, x, y, cx, cy, gc->gc_cellwidth, gc->gc_cellheight, gc->gc_rop); Index: src/sys/dev/wscons/wsdisplay_glyphcachevar.h diff -u src/sys/dev/wscons/wsdisplay_glyphcachevar.h:1.5 src/sys/dev/wscons/wsdisplay_glyphcachevar.h:1.6 --- src/sys/dev/wscons/wsdisplay_glyphcachevar.h:1.5 Fri Jun 2 19:30:10 2017 +++ src/sys/dev/wscons/wsdisplay_glyphcachevar.h Thu Jun 8 05:48:41 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_glyphcachevar.h,v 1.5 2017/06/02 19:30:10 macallan Exp $ */ +/* $NetBSD: wsdisplay_glyphcachevar.h,v 1.6 2023/06/08 05:48:41 macallan Exp $ */ /* * Copyright (c) 2012 Michael Lorenz @@ -45,6 +45,8 @@ typedef struct _glyphcache { /* geometry */ int gc_numcells; int gc_cellwidth; + int gc_cellstride; + int gc_cellalign; int gc_cellheight; int gc_cellsperline; int gc_firstline; /* first line in vram to use for glyphs */ @@ -71,6 +73,9 @@ typedef struct _glyphcache { /* first line, lines, width, cellwidth, cellheight, attr */ int glyphcache_init(glyphcache *, int, int, int, int, int, long); +/* first line, lines, width, cellwidth, cellheight, attr, alignment */ +int glyphcache_init_align(glyphcache *, int, int, int, int, int, long, int); + /* adapt to changed font */ int glyphcache_reconfig(glyphcache *, int, int, long);
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: macallan Date: Thu Jun 8 05:48:41 UTC 2023 Modified Files: src/sys/dev/wscons: wsdisplay_glyphcache.c wsdisplay_glyphcachevar.h Log Message: allow drivers to specify horizontal alignment of glyph cache cells for things like SX which have alignment restrictions To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/wscons/wsdisplay_glyphcache.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/wscons/wsdisplay_glyphcachevar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Sun Feb 26 14:00:42 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: spell edp->tabs assertion with NULL To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/dev/wscons/wsemul_vt100_subr.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/dev/wscons/wsemul_vt100_subr.c diff -u src/sys/dev/wscons/wsemul_vt100_subr.c:1.29 src/sys/dev/wscons/wsemul_vt100_subr.c:1.30 --- src/sys/dev/wscons/wsemul_vt100_subr.c:1.29 Sun Feb 26 13:57:56 2023 +++ src/sys/dev/wscons/wsemul_vt100_subr.c Sun Feb 26 14:00:42 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100_subr.c,v 1.29 2023/02/26 13:57:56 uwe Exp $ */ +/* $NetBSD: wsemul_vt100_subr.c,v 1.30 2023/02/26 14:00:42 uwe Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.29 2023/02/26 13:57:56 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.30 2023/02/26 14:00:42 uwe Exp $"); #include #include @@ -331,7 +331,7 @@ wsemul_vt100_handle_csi(struct vt100base { int i, j, ps = 0; char buf[20]; - KASSERT(edp->tabs != 0); + KASSERT(edp->tabs != NULL); wsdisplay_emulinput(edp->cbcookie, "\033P2$u", 5); for (i = 0; i < edp->ncols; i++) if (edp->tabs[i]) { @@ -483,7 +483,7 @@ wsemul_vt100_handle_csi(struct vt100base edp->crow = uimin(DEF1_ARG(edp, 0) - 1, edp->nrows - 1); break; case 'g': /* TBC */ - KASSERT(edp->tabs != 0); + KASSERT(edp->tabs != NULL); switch (ARG(edp, 0)) { case 0: edp->tabs[edp->ccol] = 0; @@ -766,7 +766,7 @@ wsemul_vt100_handle_dcs(struct vt100base case 0: /* not handled */ return; case DCSTYPE_TABRESTORE: - KASSERT(edp->tabs != 0); + KASSERT(edp->tabs != NULL); KASSERT(edp->ncols <= 1024); memset(edp->tabs, 0, edp->ncols); pos = 0;
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Sun Feb 26 14:00:42 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: spell edp->tabs assertion with NULL To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/dev/wscons/wsemul_vt100_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Sun Feb 26 13:57:56 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: don't assert unsigned ncols >= 0 To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/wscons/wsemul_vt100_subr.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/dev/wscons/wsemul_vt100_subr.c diff -u src/sys/dev/wscons/wsemul_vt100_subr.c:1.28 src/sys/dev/wscons/wsemul_vt100_subr.c:1.29 --- src/sys/dev/wscons/wsemul_vt100_subr.c:1.28 Thu Feb 23 02:48:06 2023 +++ src/sys/dev/wscons/wsemul_vt100_subr.c Sun Feb 26 13:57:56 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100_subr.c,v 1.28 2023/02/23 02:48:06 riastradh Exp $ */ +/* $NetBSD: wsemul_vt100_subr.c,v 1.29 2023/02/26 13:57:56 uwe Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.28 2023/02/23 02:48:06 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.29 2023/02/26 13:57:56 uwe Exp $"); #include #include @@ -767,7 +767,6 @@ wsemul_vt100_handle_dcs(struct vt100base return; case DCSTYPE_TABRESTORE: KASSERT(edp->tabs != 0); - KASSERT(edp->ncols >= 0); KASSERT(edp->ncols <= 1024); memset(edp->tabs, 0, edp->ncols); pos = 0;
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Sun Feb 26 13:57:56 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wsemul_vt100_subr: don't assert unsigned ncols >= 0 To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/wscons/wsemul_vt100_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Thu Feb 23 02:48:07 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100.c wsemul_vt100_subr.c Log Message: wscons(4): Paranoia: Clamp numbers of rows and columns. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/dev/wscons/wsemul_vt100.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/wscons/wsemul_vt100_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Thu Feb 23 02:48:07 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100.c wsemul_vt100_subr.c Log Message: wscons(4): Paranoia: Clamp numbers of rows and columns. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/dev/wscons/wsemul_vt100.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/wscons/wsemul_vt100_subr.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/dev/wscons/wsemul_vt100.c diff -u src/sys/dev/wscons/wsemul_vt100.c:1.49 src/sys/dev/wscons/wsemul_vt100.c:1.50 --- src/sys/dev/wscons/wsemul_vt100.c:1.49 Sun Jan 2 23:46:21 2022 +++ src/sys/dev/wscons/wsemul_vt100.c Thu Feb 23 02:48:06 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100.c,v 1.49 2022/01/02 23:46:21 uwe Exp $ */ +/* $NetBSD: wsemul_vt100.c,v 1.50 2023/02/23 02:48:06 riastradh Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100.c,v 1.49 2022/01/02 23:46:21 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100.c,v 1.50 2023/02/23 02:48:06 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_wsmsgattrs.h" @@ -293,8 +293,14 @@ wsemul_vt100_resize(void * cookie, const { struct wsemul_vt100_emuldata *edp = cookie; - edp->bd.nrows = type->nrows; - edp->bd.ncols = type->ncols; + /* XXX match malloc size in wsemul_vt100_attach */ + KASSERT(type->nrows >= 0); + KASSERT(type->ncols >= 0); + KASSERT(type->nrows <= 1024); + KASSERT(type->ncols <= 1024); + + edp->bd.nrows = MAX(0, MIN(type->nrows, 1024)); + edp->bd.ncols = MAX(0, MIN(type->ncols, 1024)); wsemul_vt100_reset(edp); wsemul_vt100_resetop(cookie, WSEMUL_CLEARSCREEN); } Index: src/sys/dev/wscons/wsemul_vt100_subr.c diff -u src/sys/dev/wscons/wsemul_vt100_subr.c:1.27 src/sys/dev/wscons/wsemul_vt100_subr.c:1.28 --- src/sys/dev/wscons/wsemul_vt100_subr.c:1.27 Thu Feb 23 02:47:52 2023 +++ src/sys/dev/wscons/wsemul_vt100_subr.c Thu Feb 23 02:48:06 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100_subr.c,v 1.27 2023/02/23 02:47:52 riastradh Exp $ */ +/* $NetBSD: wsemul_vt100_subr.c,v 1.28 2023/02/23 02:48:06 riastradh Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.27 2023/02/23 02:47:52 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.28 2023/02/23 02:48:06 riastradh Exp $"); #include #include @@ -767,6 +767,8 @@ wsemul_vt100_handle_dcs(struct vt100base return; case DCSTYPE_TABRESTORE: KASSERT(edp->tabs != 0); + KASSERT(edp->ncols >= 0); + KASSERT(edp->ncols <= 1024); memset(edp->tabs, 0, edp->ncols); pos = 0; for (i = 0; i < edp->dcspos; i++) {
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Thu Feb 23 02:47:52 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wscons(4): Ignore nonsense tab stops in vt100 emulation. XXX pullup-8 XXX pullup-9 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/dev/wscons/wsemul_vt100_subr.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/dev/wscons/wsemul_vt100_subr.c diff -u src/sys/dev/wscons/wsemul_vt100_subr.c:1.26 src/sys/dev/wscons/wsemul_vt100_subr.c:1.27 --- src/sys/dev/wscons/wsemul_vt100_subr.c:1.26 Wed Jan 18 17:02:17 2023 +++ src/sys/dev/wscons/wsemul_vt100_subr.c Thu Feb 23 02:47:52 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100_subr.c,v 1.26 2023/01/18 17:02:17 christos Exp $ */ +/* $NetBSD: wsemul_vt100_subr.c,v 1.27 2023/02/23 02:47:52 riastradh Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.26 2023/01/18 17:02:17 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.27 2023/02/23 02:47:52 riastradh Exp $"); #include #include @@ -773,12 +773,22 @@ wsemul_vt100_handle_dcs(struct vt100base char c = edp->dcsarg[i]; switch (c) { case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': -pos = pos * 10 + (edp->dcsarg[i] - '0'); + case '5': case '6': case '7': case '8': case '9': { +const int c0 = c - '0'; +if (pos < 0 || +pos > INT_MAX/10 || +pos * 10 > edp->ncols - c0) { + pos = -1; + break; +} +pos = pos * 10 + c0; break; + } case '/': -if (pos > 0) +if (pos > 0) { + KASSERT(pos <= edp->ncols); edp->tabs[pos - 1] = 1; +} pos = 0; break; default: @@ -788,8 +798,10 @@ wsemul_vt100_handle_dcs(struct vt100base break; } } - if (pos > 0) + if (pos > 0) { + KASSERT(pos <= edp->ncols); edp->tabs[pos - 1] = 1; + } break; default: panic("wsemul_vt100_handle_dcs: bad type %d", edp->dcstype);
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Thu Feb 23 02:47:52 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: wscons(4): Ignore nonsense tab stops in vt100 emulation. XXX pullup-8 XXX pullup-9 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/dev/wscons/wsemul_vt100_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Wed Feb 15 13:19:13 UTC 2023 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: dev/wscons/wsdisplay_vcons.c: Sprinkle KNF. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Wed Feb 15 13:19:13 UTC 2023 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: dev/wscons/wsdisplay_vcons.c: Sprinkle KNF. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.66 src/sys/dev/wscons/wsdisplay_vcons.c:1.67 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.66 Tue Feb 14 08:22:02 2023 +++ src/sys/dev/wscons/wsdisplay_vcons.c Wed Feb 15 13:19:13 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.66 2023/02/14 08:22:02 macallan Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.67 2023/02/15 13:19:13 riastradh Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.66 2023/02/14 08:22:02 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.67 2023/02/15 13:19:13 riastradh Exp $"); #include #include @@ -354,8 +354,10 @@ vcons_alloc_buffers(struct vcons_data *v #ifdef VCONS_DRAW_INTR size = ri->ri_cols * ri->ri_rows; if (size > vdp->cells) { - if (vdp->chars != NULL) free(vdp->chars, M_DEVBUF); - if (vdp->attrs != NULL) free(vdp->attrs, M_DEVBUF); + if (vdp->chars != NULL) + free(vdp->chars, M_DEVBUF); + if (vdp->attrs != NULL) + free(vdp->attrs, M_DEVBUF); vdp->cells = size; vdp->chars = malloc(size * sizeof(uint32_t), M_DEVBUF, M_WAITOK|M_ZERO); @@ -1253,7 +1255,7 @@ vcons_putchar_buffer(void *cookie, int r int pos, ret = 0; if ((row >= 0) && (row < ri->ri_rows) && (col >= 0) && - (col < ri->ri_cols)) { + (col < ri->ri_cols)) { pos = col + row * ri->ri_cols; ret = (scr->scr_attrs[pos + offset] != attr) || (scr->scr_chars[pos + offset] != c); @@ -1261,7 +1263,8 @@ vcons_putchar_buffer(void *cookie, int r scr->scr_chars[pos + offset] = c; } - if (ret) vcons_dirty(scr); + if (ret) + vcons_dirty(scr); return ret; } @@ -1293,7 +1296,7 @@ vcons_putchar(void *cookie, int row, int struct rasops_info *ri = cookie; struct vcons_screen *scr = ri->ri_hw; int need_draw; - + need_draw = vcons_putchar_buffer(cookie, row, col, c, attr); if (vcons_use_intr(scr)) @@ -1302,7 +1305,8 @@ vcons_putchar(void *cookie, int row, int vcons_lock(scr); if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) { #ifdef VCONS_DRAW_INTR - if (need_draw) vcons_putchar_cached(cookie, row, col, c, attr); + if (need_draw) + vcons_putchar_cached(cookie, row, col, c, attr); #else if (row == ri->ri_crow && col == ri->ri_ccol) { ri->ri_flg &= ~RI_CURSOR;
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: macallan Date: Tue Feb 14 08:22:02 UTC 2023 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c wsdisplay_vconsvar.h Log Message: add flags for drivers to requesr R2L bit/byte-ordered fonts, default to L2R, chack them in vcons_load_font() instead of just trusting that we'd get what we need To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/dev/wscons/wsdisplay_vcons.c cvs rdiff -u -r1.33 -r1.34 src/sys/dev/wscons/wsdisplay_vconsvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.65 src/sys/dev/wscons/wsdisplay_vcons.c:1.66 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.65 Tue Feb 14 08:14:02 2023 +++ src/sys/dev/wscons/wsdisplay_vcons.c Tue Feb 14 08:22:02 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.65 2023/02/14 08:14:02 macallan Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.66 2023/02/14 08:22:02 macallan Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.65 2023/02/14 08:14:02 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.66 2023/02/14 08:22:02 macallan Exp $"); #include #include @@ -478,7 +478,14 @@ vcons_load_font(void *v, void *cookie, s flags |= WSFONT_FIND_ALPHA; } - fcookie = wsfont_find(f->name, 0, 0, 0, 0, 0, flags); + fcookie = wsfont_find(f->name, 0, 0, 0, + /* bitorder */ + scr->scr_flags & VCONS_FONT_BITS_R2L ? + WSDISPLAY_FONTORDER_R2L : WSDISPLAY_FONTORDER_L2R, + /* byteorder */ + scr->scr_flags & VCONS_FONT_BYTES_R2L ? + WSDISPLAY_FONTORDER_R2L : WSDISPLAY_FONTORDER_L2R, + flags); if (fcookie == -1) return EINVAL; Index: src/sys/dev/wscons/wsdisplay_vconsvar.h diff -u src/sys/dev/wscons/wsdisplay_vconsvar.h:1.33 src/sys/dev/wscons/wsdisplay_vconsvar.h:1.34 --- src/sys/dev/wscons/wsdisplay_vconsvar.h:1.33 Sun Jul 17 20:23:17 2022 +++ src/sys/dev/wscons/wsdisplay_vconsvar.h Tue Feb 14 08:22:02 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vconsvar.h,v 1.33 2022/07/17 20:23:17 riastradh Exp $ */ +/* $NetBSD: wsdisplay_vconsvar.h,v 1.34 2023/02/14 08:22:02 macallan Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -70,6 +70,11 @@ struct vcons_screen { #define VCONS_LOADFONT 0x40 /* driver can load_font() */ #define VCONS_NO_CURSOR 0x80 /* use putchar() based cursor(), to * avoid fb reads */ +#define VCONS_FONT_BITS_R2L 0x100 /* request right-to-left bitorder in + * wsfont_find() */ +#define VCONS_FONT_BYTES_R2L 0x200 /* request right-to-left byteorder in + * wsfont_find() */ + /* status flags used by vcons */ uint32_t scr_status; #define VCONS_IS_VISIBLE 1 /* this screen is currently visible */
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: macallan Date: Tue Feb 14 08:22:02 UTC 2023 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c wsdisplay_vconsvar.h Log Message: add flags for drivers to requesr R2L bit/byte-ordered fonts, default to L2R, chack them in vcons_load_font() instead of just trusting that we'd get what we need To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/dev/wscons/wsdisplay_vcons.c cvs rdiff -u -r1.33 -r1.34 src/sys/dev/wscons/wsdisplay_vconsvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: macallan Date: Tue Feb 14 08:14:02 UTC 2023 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: make vcons_putchar_buffer() return a flag indicating if anything actually changed, skip the actual drawing op if nothing did To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: macallan Date: Tue Feb 14 08:14:02 UTC 2023 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: make vcons_putchar_buffer() return a flag indicating if anything actually changed, skip the actual drawing op if nothing did To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.64 src/sys/dev/wscons/wsdisplay_vcons.c:1.65 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.64 Mon Jul 18 11:09:22 2022 +++ src/sys/dev/wscons/wsdisplay_vcons.c Tue Feb 14 08:14:02 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.64 2022/07/18 11:09:22 martin Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.65 2023/02/14 08:14:02 macallan Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.64 2022/07/18 11:09:22 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.65 2023/02/14 08:14:02 macallan Exp $"); #include #include @@ -121,7 +121,7 @@ static void vcons_copycols_buffer(void * static void vcons_erasecols_buffer(void *, int, int, int, long); static void vcons_copyrows_buffer(void *, int, int, int); static void vcons_eraserows_buffer(void *, int, int, long); -static void vcons_putchar_buffer(void *, int, int, u_int, long); +static int vcons_putchar_buffer(void *, int, int, u_int, long); /* * actual wrapper methods which call both the _buffer ones above and the @@ -1237,22 +1237,25 @@ vcons_eraserows(void *cookie, int row, i vcons_unlock(scr); } -static void +static int vcons_putchar_buffer(void *cookie, int row, int col, u_int c, long attr) { struct rasops_info *ri = cookie; struct vcons_screen *scr = ri->ri_hw; int offset = vcons_offset_to_zero(scr); - int pos; + int pos, ret = 0; if ((row >= 0) && (row < ri->ri_rows) && (col >= 0) && (col < ri->ri_cols)) { pos = col + row * ri->ri_cols; + ret = (scr->scr_attrs[pos + offset] != attr) || + (scr->scr_chars[pos + offset] != c); scr->scr_attrs[pos + offset] = attr; scr->scr_chars[pos + offset] = c; } - vcons_dirty(scr); + if (ret) vcons_dirty(scr); + return ret; } #ifdef VCONS_DRAW_INTR @@ -1282,8 +1285,9 @@ vcons_putchar(void *cookie, int row, int { struct rasops_info *ri = cookie; struct vcons_screen *scr = ri->ri_hw; - - vcons_putchar_buffer(cookie, row, col, c, attr); + int need_draw; + + need_draw = vcons_putchar_buffer(cookie, row, col, c, attr); if (vcons_use_intr(scr)) return; @@ -1291,12 +1295,13 @@ vcons_putchar(void *cookie, int row, int vcons_lock(scr); if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) { #ifdef VCONS_DRAW_INTR - vcons_putchar_cached(cookie, row, col, c, attr); + if (need_draw) vcons_putchar_cached(cookie, row, col, c, attr); #else if (row == ri->ri_crow && col == ri->ri_ccol) { ri->ri_flg &= ~RI_CURSOR; - } - scr->putchar(cookie, row, col, c, attr); + scr->putchar(cookie, row, col, c, attr); + } else if (need_draw) + scr->putchar(cookie, row, col, c, attr); #endif } vcons_unlock(scr);
Re: CVS commit: src/sys/dev/wscons
Date:Tue, 24 Jan 2023 14:51:03 - (UTC) From:chris...@astron.com (Christos Zoulas) Message-ID: | Once we add them older kernels will break, I doubt that they'd break any kernels - curses using programs using these sequences with an old kernel might break though. But I don't think they need to be added in any case - the point of them existing is so that when using some remote system, with a terminfo/termcap database that doesn't include wsvt25 (which probably means anything that isn't BSD based) it is possible to set TERM=xterm (which is likely to exist everywhere) and get reasonable performance, rather than TERM=vt100 (also likely to exist, but with poor performance). There's no real need for the new ones to be known for local use, they weren't added because anyone was demanding them for any other reason. kre
Re: CVS commit: src/sys/dev/wscons
On Tue, 24 Jan 2023 at 14:51, Christos Zoulas wrote: > > In article , > Valery Ushakov wrote: > >On Wed, Jan 18, 2023 at 12:02:17 -0500, Christos Zoulas wrote: > > > >> Module Name: src > >> Committed By:christos > >> Date:Wed Jan 18 17:02:17 UTC 2023 > >> > >> Modified Files: > >> src/sys/dev/wscons: wsemul_vt100_subr.c > >> > >> Log Message: > >> Add rin, indn, vpa, hpa, and cbt terminfo capabilities (Crystal Kolipe) > > > >They probably need to be added to the terminfo description too. > > I guess :-) Once we add them older kernels will break, but it is unlikely > that older kernels will have new terminfo. There would need to be a new terminfo entry (whether the capabilities are added to wsvt25, and an older compat added, or a new wsvt25plus entry added), as otherwise a remote session from a newer system into an older will have issues due to missing capabilities. Maybe just update the manpage to note when the new capabilities were added and leave it for a release or so :) David
Re: CVS commit: src/sys/dev/wscons
In article , Valery Ushakov wrote: >On Wed, Jan 18, 2023 at 12:02:17 -0500, Christos Zoulas wrote: > >> Module Name: src >> Committed By:christos >> Date:Wed Jan 18 17:02:17 UTC 2023 >> >> Modified Files: >> src/sys/dev/wscons: wsemul_vt100_subr.c >> >> Log Message: >> Add rin, indn, vpa, hpa, and cbt terminfo capabilities (Crystal Kolipe) > >They probably need to be added to the terminfo description too. I guess :-) Once we add them older kernels will break, but it is unlikely that older kernels will have new terminfo. christos
Re: CVS commit: src/sys/dev/wscons
On Wed, Jan 18, 2023 at 12:02:17 -0500, Christos Zoulas wrote: > Module Name: src > Committed By: christos > Date: Wed Jan 18 17:02:17 UTC 2023 > > Modified Files: > src/sys/dev/wscons: wsemul_vt100_subr.c > > Log Message: > Add rin, indn, vpa, hpa, and cbt terminfo capabilities (Crystal Kolipe) They probably need to be added to the terminfo description too. -uwe
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: christos Date: Wed Jan 18 17:02:17 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: Add rin, indn, vpa, hpa, and cbt terminfo capabilities (Crystal Kolipe) To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/dev/wscons/wsemul_vt100_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: christos Date: Wed Jan 18 17:02:17 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: Add rin, indn, vpa, hpa, and cbt terminfo capabilities (Crystal Kolipe) To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/dev/wscons/wsemul_vt100_subr.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/dev/wscons/wsemul_vt100_subr.c diff -u src/sys/dev/wscons/wsemul_vt100_subr.c:1.25 src/sys/dev/wscons/wsemul_vt100_subr.c:1.26 --- src/sys/dev/wscons/wsemul_vt100_subr.c:1.25 Mon Jan 9 16:53:44 2023 +++ src/sys/dev/wscons/wsemul_vt100_subr.c Wed Jan 18 12:02:17 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100_subr.c,v 1.25 2023/01/09 21:53:44 christos Exp $ */ +/* $NetBSD: wsemul_vt100_subr.c,v 1.26 2023/01/18 17:02:17 christos Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.25 2023/01/09 21:53:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.26 2023/01/18 17:02:17 christos Exp $"); #include #include @@ -188,7 +188,7 @@ wsemul_vt100_el(struct vt100base_data *e void wsemul_vt100_handle_csi(struct vt100base_data *edp, u_char c) { - int n, help, flags, fgcol, bgcol; + int n, m, help, flags, fgcol, bgcol; long attr, bkgdattr; #define A3(a, b, c) (((a) << 16) | ((b) << 8) | (c)) @@ -410,6 +410,9 @@ wsemul_vt100_handle_csi(struct vt100base edp->ccol -= uimin(DEF1_ARG(edp, 0), edp->ccol); edp->flags &= ~VTFL_LASTCHAR; break; + case 'G': /* CHA */ + edp->ccol = uimin(DEF1_ARG(edp, 0) - 1, edp->ncols -1); + break; case 'H': /* CUP */ case 'f': /* HVP */ if (edp->flags & VTFL_DECOM) @@ -445,15 +448,40 @@ wsemul_vt100_handle_csi(struct vt100base COPYCOLS(edp, edp->ccol + n, edp->ccol, help); ERASECOLS(edp, NCOLS(edp) - n, n, edp->bkgdattr); break; + case 'S': /* SU */ + wsemul_vt100_scrollup(edp, DEF1_ARG(edp, 0)); + break; + case 'T': /* SD */ + wsemul_vt100_scrolldown(edp, DEF1_ARG(edp, 0)); + break; case 'X': /* ECH erase character */ n = uimin(DEF1_ARG(edp, 0), COLS_LEFT(edp) + 1); ERASECOLS(edp, edp->ccol, n, edp->bkgdattr); break; + case 'Z': /* CBT */ + if (edp->ccol == 0) + break; + for (m = 0; m < DEF1_ARG(edp, 0); m++) { + if (edp->tabs) { +for (n = edp->ccol - 1; n > 0; n--) { + if (edp->tabs[n]) + break; +} + } else +n = (edp->ccol - 1) & ~7; + edp->ccol = n; + if (n == 0) +break; + } + break; case 'c': /* DA primary */ if (ARG(edp, 0) == 0) wsdisplay_emulinput(edp->cbcookie, WSEMUL_VT_ID1, sizeof(WSEMUL_VT_ID1) - 1); break; + case 'd': /* VPA */ + edp->crow = uimin(DEF1_ARG(edp, 0) - 1, edp->nrows - 1); + break; case 'g': /* TBC */ KASSERT(edp->tabs != 0); switch (ARG(edp, 0)) {
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: christos Date: Mon Jan 9 21:53:44 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: Fix off by one (Crystal Kolipe in tech-kern@) To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/dev/wscons/wsemul_vt100_subr.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/dev/wscons/wsemul_vt100_subr.c diff -u src/sys/dev/wscons/wsemul_vt100_subr.c:1.24 src/sys/dev/wscons/wsemul_vt100_subr.c:1.25 --- src/sys/dev/wscons/wsemul_vt100_subr.c:1.24 Wed Dec 5 20:42:20 2018 +++ src/sys/dev/wscons/wsemul_vt100_subr.c Mon Jan 9 16:53:44 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100_subr.c,v 1.24 2018/12/06 01:42:20 uwe Exp $ */ +/* $NetBSD: wsemul_vt100_subr.c,v 1.25 2023/01/09 21:53:44 christos Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.24 2018/12/06 01:42:20 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_subr.c,v 1.25 2023/01/09 21:53:44 christos Exp $"); #include #include @@ -195,7 +195,7 @@ wsemul_vt100_handle_csi(struct vt100base switch (A3(edp->modif1, edp->modif2, c)) { case A3('>', '\0', 'c'): /* DA secondary */ wsdisplay_emulinput(edp->cbcookie, WSEMUL_VT_ID2, -sizeof(WSEMUL_VT_ID2)); +sizeof(WSEMUL_VT_ID2) - 1); break; case A3('\0', '\0', 'J'): /* ED selective erase in display */ @@ -452,7 +452,7 @@ wsemul_vt100_handle_csi(struct vt100base case 'c': /* DA primary */ if (ARG(edp, 0) == 0) wsdisplay_emulinput(edp->cbcookie, WSEMUL_VT_ID1, - sizeof(WSEMUL_VT_ID1)); + sizeof(WSEMUL_VT_ID1) - 1); break; case 'g': /* TBC */ KASSERT(edp->tabs != 0);
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: christos Date: Mon Jan 9 21:53:44 UTC 2023 Modified Files: src/sys/dev/wscons: wsemul_vt100_subr.c Log Message: Fix off by one (Crystal Kolipe in tech-kern@) To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/dev/wscons/wsemul_vt100_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Fri Sep 23 19:04:04 UTC 2022 Modified Files: src/sys/dev/wscons: wskbdvar.h Log Message: wskbd(4): Add include guards. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/dev/wscons/wskbdvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/wscons/wskbdvar.h diff -u src/sys/dev/wscons/wskbdvar.h:1.19 src/sys/dev/wscons/wskbdvar.h:1.20 --- src/sys/dev/wscons/wskbdvar.h:1.19 Sun Sep 2 21:14:56 2012 +++ src/sys/dev/wscons/wskbdvar.h Fri Sep 23 19:04:04 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wskbdvar.h,v 1.19 2012/09/02 21:14:56 he Exp $ */ +/* $NetBSD: wskbdvar.h,v 1.20 2022/09/23 19:04:04 riastradh Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -30,6 +30,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _DEV_WSCONS_WSKBDVAR_H_ +#define _DEV_WSCONS_WSKBDVAR_H_ + /* * WSKBD interfaces. */ @@ -116,3 +119,5 @@ void wskbd_set_evtrans(device_t, keysym_ int wskbd_cngetc(dev_t); void wskbd_cnpollc(dev_t, int); void wskbd_cnbell(dev_t, u_int, u_int, u_int); + +#endif /* _DEV_WSCONS_WSKBDVAR_H_ */
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Fri Sep 23 19:04:04 UTC 2022 Modified Files: src/sys/dev/wscons: wskbdvar.h Log Message: wskbd(4): Add include guards. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/dev/wscons/wskbdvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: martin Date: Mon Jul 18 11:09:22 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: Make it compile w/o warnings for !VCONS_DRAW_INTR To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.63 src/sys/dev/wscons/wsdisplay_vcons.c:1.64 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.63 Sun Jul 17 20:23:17 2022 +++ src/sys/dev/wscons/wsdisplay_vcons.c Mon Jul 18 11:09:22 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.63 2022/07/17 20:23:17 riastradh Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.64 2022/07/18 11:09:22 martin Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.63 2022/07/17 20:23:17 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.64 2022/07/18 11:09:22 martin Exp $"); #include #include @@ -1618,10 +1618,11 @@ vcons_init_thread(void *cookie) void vcons_enable_polling(struct vcons_data *vd) { - struct vcons_data_private *vdp = vd->private; struct vcons_screen *scr = vd->active; #ifdef VCONS_DRAW_INTR + struct vcons_data_private *vdp = vd->private; + vdp->use_intr = 0; #endif
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: martin Date: Mon Jul 18 11:09:22 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: Make it compile w/o warnings for !VCONS_DRAW_INTR To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:44:30 UTC 2022 Modified Files: src/sys/dev/wscons: wsmouse.c Log Message: wsmouse(4): Nix trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sys/dev/wscons/wsmouse.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/dev/wscons/wsmouse.c diff -u src/sys/dev/wscons/wsmouse.c:1.71 src/sys/dev/wscons/wsmouse.c:1.72 --- src/sys/dev/wscons/wsmouse.c:1.71 Sun Jul 17 11:42:55 2022 +++ src/sys/dev/wscons/wsmouse.c Sun Jul 17 11:44:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsmouse.c,v 1.71 2022/07/17 11:42:55 riastradh Exp $ */ +/* $NetBSD: wsmouse.c,v 1.72 2022/07/17 11:44:30 riastradh Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -104,7 +104,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.71 2022/07/17 11:42:55 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.72 2022/07/17 11:44:30 riastradh Exp $"); #include "wsmouse.h" #include "wsdisplay.h" @@ -622,7 +622,7 @@ wsmouse_set_params(struct wsmouse_softc size_t i = 0; for (i = 0; i < nparams; ++i) { - switch (buf[i].key) { + switch (buf[i].key) { case WSMOUSECFG_REVERSE_SCROLLING: sc->sc_reverse_scroll = (buf[i].value != 0); break; @@ -644,7 +644,7 @@ wsmouse_get_params(struct wsmouse_softc size_t i = 0; for (i = 0; i < nparams; ++i) { - switch (buf[i].key) { + switch (buf[i].key) { case WSMOUSECFG_REVERSE_SCROLLING: buf[i].value = sc->sc_reverse_scroll; break;
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:44:30 UTC 2022 Modified Files: src/sys/dev/wscons: wsmouse.c Log Message: wsmouse(4): Nix trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sys/dev/wscons/wsmouse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:43:39 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay.c wsdisplay_vcons.c Log Message: wsdisplay(4): KNF: return foo, not return (foo) No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.164 -r1.165 src/sys/dev/wscons/wsdisplay.c cvs rdiff -u -r1.61 -r1.62 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay.c diff -u src/sys/dev/wscons/wsdisplay.c:1.164 src/sys/dev/wscons/wsdisplay.c:1.165 --- src/sys/dev/wscons/wsdisplay.c:1.164 Sun Jul 17 11:43:11 2022 +++ src/sys/dev/wscons/wsdisplay.c Sun Jul 17 11:43:39 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay.c,v 1.164 2022/07/17 11:43:11 riastradh Exp $ */ +/* $NetBSD: wsdisplay.c,v 1.165 2022/07/17 11:43:39 riastradh Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.164 2022/07/17 11:43:11 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.165 2022/07/17 11:43:39 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_wsdisplay_compat.h" @@ -339,7 +339,7 @@ wsscreen_attach(struct wsdisplay_softc * if (dconf->wsemul == NULL) { free(dconf, M_DEVBUF); free(scr, M_DEVBUF); -return (NULL); +return NULL; } dconf->wsemulcookie = (*dconf->wsemul->attach)(0, type, cookie, @@ -370,7 +370,7 @@ wsscreen_attach(struct wsdisplay_softc * if (console) callout_schedule(&scr->scr_getc_ch, mstohz(10)); #endif - return (scr); + return scr; } static void @@ -405,15 +405,15 @@ wsdisplay_screentype_pick(const struct w KASSERT(scrdata->nscreens > 0); if (name == NULL) - return (scrdata->screens[0]); + return scrdata->screens[0]; for (i = 0; i < scrdata->nscreens; i++) { scr = scrdata->screens[i]; if (!strcmp(name, scr->name)) - return (scr); + return scr; } - return (0); + return 0; } /* @@ -447,12 +447,12 @@ wsdisplay_addscreen(struct wsdisplay_sof int s; if (idx < 0 || idx >= WSDISPLAY_MAXSCREEN) - return (EINVAL); + return EINVAL; if (sc->sc_scr[idx] != NULL) - return (EBUSY); + return EBUSY; scrdesc = wsdisplay_screentype_pick(sc->sc_scrdata, screentype); if (!scrdesc) - return (ENXIO); + return ENXIO; /* * if this screen can resize we need to copy the descr so each screen @@ -469,14 +469,14 @@ wsdisplay_addscreen(struct wsdisplay_sof error = (*sc->sc_accessops->alloc_screen)(sc->sc_accesscookie, scrdesc, &cookie, &ccol, &crow, &defattr); if (error) - return (error); + return error; scr = wsscreen_attach(sc, 0, emul, scrdesc, cookie, ccol, crow, defattr); if (scr == NULL) { (*sc->sc_accessops->free_screen)(sc->sc_accesscookie, cookie); - return (ENXIO); + return ENXIO; } sc->sc_scr[idx] = scr; @@ -491,7 +491,7 @@ wsdisplay_addscreen(struct wsdisplay_sof sc->sc_focus = scr; } splx(s); - return (0); + return 0; } static void @@ -560,14 +560,14 @@ wsdisplay_delscreen(struct wsdisplay_sof void *cookie; if (idx < 0 || idx >= WSDISPLAY_MAXSCREEN) - return (EINVAL); + return EINVAL; if ((scr = sc->sc_scr[idx]) == NULL) - return (ENXIO); + return ENXIO; if (scr->scr_dconf == &wsdisplay_console_conf || scr->scr_syncops || ((scr->scr_flags & SCR_OPEN) && !(flags & WSDISPLAY_DELSCR_FORCE))) - return(EBUSY); + return EBUSY; wsdisplay_closescreen(sc, scr); @@ -602,7 +602,7 @@ wsdisplay_delscreen(struct wsdisplay_sof cookie); aprint_verbose_dev(sc->sc_dev, "screen %d deleted\n", idx); - return (0); + return 0; } /* @@ -621,13 +621,13 @@ wsdisplay_emul_match(device_t parent, cf */ if (match->cf_loc[WSEMULDISPLAYDEVCF_CONSOLE] != 0 && ap->console != 0) - return (10); + return 10; else - return (0); + return 0; } /* If console-ness unspecified, it wins. */ - return (1); + return 1; } void @@ -671,7 +671,7 @@ wsemuldisplaydevprint(void *aux, const c aprint_normal(" console %d", ap->console); #endif - return (UNCONF); + return UNCONF; } int @@ -701,7 +701,7 @@ wsdisplay_noemul_match(device_t parent, #endif /* Always match. */ - return (1); + return 1; } void @@ -756,11 +756,11 @@ wsdisplay_dosync(struct wsdisplay_softc cv_wait_sig(&sc->sc_flagscv, &sc->sc_flagsmtx); mutex_exit(&sc->sc_flagsmtx); if (sc->sc_flags & SC_SWITCHERROR) - return (EIO); /* XXX pass real error */ + return EIO; /* XXX pass real error */ } else { sc->sc_flags &= ~SC_SWITCHPENDING; if (res) - return (res); + return res; } if (attach) sc->sc_flags |= SC_XATTACHED; @@ -781,9 +781,9 @@ wsdisplay_handlex(int resume) continue; res = wsdisplay_dosync(device_private(dv), resume); if (res) - return (res); + return res; } - r
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:43:39 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay.c wsdisplay_vcons.c Log Message: wsdisplay(4): KNF: return foo, not return (foo) No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.164 -r1.165 src/sys/dev/wscons/wsdisplay.c cvs rdiff -u -r1.61 -r1.62 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:43:11 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay.c wsdisplay_vcons.c Log Message: wsdisplay(4): KASSERT(a && b) -> KASSERT(a); KASSERT(b) Better diagnostics this way. No other functional change. Omit needless #ifdef DIAGNOSTIC while here; the compiler can optimize the dead code away. To generate a diff of this commit: cvs rdiff -u -r1.163 -r1.164 src/sys/dev/wscons/wsdisplay.c cvs rdiff -u -r1.60 -r1.61 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay.c diff -u src/sys/dev/wscons/wsdisplay.c:1.163 src/sys/dev/wscons/wsdisplay.c:1.164 --- src/sys/dev/wscons/wsdisplay.c:1.163 Fri Dec 31 14:19:57 2021 +++ src/sys/dev/wscons/wsdisplay.c Sun Jul 17 11:43:11 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay.c,v 1.163 2021/12/31 14:19:57 riastradh Exp $ */ +/* $NetBSD: wsdisplay.c,v 1.164 2022/07/17 11:43:11 riastradh Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.163 2021/12/31 14:19:57 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.164 2022/07/17 11:43:11 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_wsdisplay_compat.h" @@ -790,12 +790,13 @@ static bool wsdisplay_suspend(device_t dv, const pmf_qual_t *qual) { struct wsdisplay_softc *sc = device_private(dv); -#ifdef DIAGNOSTIC struct wsscreen *scr = sc->sc_focus; + if (sc->sc_flags & SC_XATTACHED) { - KASSERT(scr && scr->scr_syncops); + KASSERT(scr); + KASSERT(scr->scr_syncops); } -#endif + #if 1 /* * XXX X servers should have been detached earlier. Index: src/sys/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.60 src/sys/dev/wscons/wsdisplay_vcons.c:1.61 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.60 Sun Jul 17 11:31:47 2022 +++ src/sys/dev/wscons/wsdisplay_vcons.c Sun Jul 17 11:43:11 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.60 2022/07/17 11:31:47 riastradh Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.61 2022/07/17 11:43:11 riastradh Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.60 2022/07/17 11:31:47 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.61 2022/07/17 11:43:11 riastradh Exp $"); #include #include @@ -1317,7 +1317,8 @@ vcons_putwschar(struct vcons_screen *scr struct rasops_info *ri; int error; - KASSERT(scr != NULL && wsc != NULL); + KASSERT(scr != NULL); + KASSERT(wsc != NULL); ri = &scr->scr_ri; @@ -1356,7 +1357,8 @@ vcons_getwschar(struct vcons_screen *scr struct rasops_info *ri; int fg, bg, ul; - KASSERT(scr != NULL && wsc != NULL); + KASSERT(scr != NULL); + KASSERT(wsc != NULL); ri = &scr->scr_ri;
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:43:11 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay.c wsdisplay_vcons.c Log Message: wsdisplay(4): KASSERT(a && b) -> KASSERT(a); KASSERT(b) Better diagnostics this way. No other functional change. Omit needless #ifdef DIAGNOSTIC while here; the compiler can optimize the dead code away. To generate a diff of this commit: cvs rdiff -u -r1.163 -r1.164 src/sys/dev/wscons/wsdisplay.c cvs rdiff -u -r1.60 -r1.61 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:42:55 UTC 2022 Modified Files: src/sys/dev/wscons: wsmouse.c Log Message: wsmouse(4): KASSERT(a && b) -> KASSERT(a); KASSERT(b) Better diagnostics. No other functional change. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/dev/wscons/wsmouse.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/dev/wscons/wsmouse.c diff -u src/sys/dev/wscons/wsmouse.c:1.70 src/sys/dev/wscons/wsmouse.c:1.71 --- src/sys/dev/wscons/wsmouse.c:1.70 Tue Sep 28 06:14:27 2021 +++ src/sys/dev/wscons/wsmouse.c Sun Jul 17 11:42:55 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsmouse.c,v 1.70 2021/09/28 06:14:27 nia Exp $ */ +/* $NetBSD: wsmouse.c,v 1.71 2022/07/17 11:42:55 riastradh Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -104,7 +104,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.70 2021/09/28 06:14:27 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.71 2022/07/17 11:42:55 riastradh Exp $"); #include "wsmouse.h" #include "wsdisplay.h" @@ -602,8 +602,8 @@ wsmouse_repeat(void *v) newdelay = sc->sc_repeat.wr_delay_minimum; else if (newdelay > sc->sc_repeat.wr_delay_minimum) newdelay -= sc->sc_repeat.wr_delay_decrement; - KASSERT(newdelay >= sc->sc_repeat.wr_delay_minimum && - newdelay <= sc->sc_repeat.wr_delay_first); + KASSERT(newdelay >= sc->sc_repeat.wr_delay_minimum); + KASSERT(newdelay <= sc->sc_repeat.wr_delay_first); } /*
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:42:55 UTC 2022 Modified Files: src/sys/dev/wscons: wsmouse.c Log Message: wsmouse(4): KASSERT(a && b) -> KASSERT(a); KASSERT(b) Better diagnostics. No other functional change. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/dev/wscons/wsmouse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:31:47 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: wsdisplay(4): Use DPRINTF; reduce #ifdefs. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.59 src/sys/dev/wscons/wsdisplay_vcons.c:1.60 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.59 Sun Jul 17 11:31:07 2022 +++ src/sys/dev/wscons/wsdisplay_vcons.c Sun Jul 17 11:31:47 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.59 2022/07/17 11:31:07 riastradh Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.60 2022/07/17 11:31:47 riastradh Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.59 2022/07/17 11:31:07 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.60 2022/07/17 11:31:47 riastradh Exp $"); #include #include @@ -1343,10 +1343,8 @@ vcons_putwschar(struct vcons_screen *scr if (error) return error; vcons_putchar(ri, wsc->row, wsc->col, wsc->letter, attr); -#ifdef VCONS_DEBUG - printf("vcons_putwschar(%d, %d, %x, %lx\n", wsc->row, wsc->col, + DPRINTF("vcons_putwschar(%d, %d, %x, %lx\n", wsc->row, wsc->col, wsc->letter, attr); -#endif return 0; } @@ -1384,10 +1382,8 @@ vcons_getwschar(struct vcons_screen *scr wsc->letter = scr->scr_chars[offset]; attr = scr->scr_attrs[offset]; -#ifdef VCONS_DEBUG - printf("vcons_getwschar: %d, %d, %x, %lx\n", wsc->row, + DPRINTF("vcons_getwschar: %d, %d, %x, %lx\n", wsc->row, wsc->col, wsc->letter, attr); -#endif /* * this is ugly. We need to break up an attribute into colours and
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:31:47 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: wsdisplay(4): Use DPRINTF; reduce #ifdefs. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:31:07 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: wsdisplay(4): Insert memory barriers for scr_dirty synchronization. Otherwise vcons_update_screen in vcons_softintr might attempt to draw stale data from the buffers on the screen. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.58 src/sys/dev/wscons/wsdisplay_vcons.c:1.59 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.58 Sun Jul 17 11:30:27 2022 +++ src/sys/dev/wscons/wsdisplay_vcons.c Sun Jul 17 11:31:07 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.58 2022/07/17 11:30:27 riastradh Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.59 2022/07/17 11:31:07 riastradh Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.58 2022/07/17 11:30:27 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.59 2022/07/17 11:31:07 riastradh Exp $"); #include #include @@ -139,6 +139,7 @@ static inline void vcons_dirty(struct vcons_screen *scr) { #ifdef VCONS_DRAW_INTR + membar_release(); atomic_inc_uint(&scr->scr_dirty); #endif } @@ -1520,6 +1521,7 @@ vcons_softintr(void *cookie) if (scr && vd->use_intr) { if (!SCREEN_IS_BUSY(scr)) { dirty = atomic_swap_uint(&scr->scr_dirty, 0); + membar_acquire(); if (vd->use_intr == 2) { if ((scr->scr_flags & VCONS_NO_REDRAW) == 0) { vd->use_intr = 1;
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:31:07 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: wsdisplay(4): Insert memory barriers for scr_dirty synchronization. Otherwise vcons_update_screen in vcons_softintr might attempt to draw stale data from the buffers on the screen. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:30:27 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: wsdisplay(4): Factor out scr_dirty setting. Reduces #ifdefs. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.57 src/sys/dev/wscons/wsdisplay_vcons.c:1.58 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.57 Sun Jul 17 11:20:04 2022 +++ src/sys/dev/wscons/wsdisplay_vcons.c Sun Jul 17 11:30:27 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.57 2022/07/17 11:20:04 riastradh Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.58 2022/07/17 11:30:27 riastradh Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.57 2022/07/17 11:20:04 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.58 2022/07/17 11:30:27 riastradh Exp $"); #include #include @@ -135,6 +135,14 @@ vcons_use_intr(const struct vcons_screen #endif } +static inline void +vcons_dirty(struct vcons_screen *scr) +{ +#ifdef VCONS_DRAW_INTR + atomic_inc_uint(&scr->scr_dirty); +#endif +} + static int vcons_init_common(struct vcons_data *vd, void *cookie, struct wsscreen_descr *def, struct wsdisplay_accessops *ao, @@ -895,9 +903,7 @@ vcons_copycols_buffer(void *cookie, int memmove(&scr->scr_chars[offset + to], &scr->scr_chars[offset + from], ncols * sizeof(uint32_t)); -#ifdef VCONS_DRAW_INTR - atomic_inc_uint(&scr->scr_dirty); -#endif + vcons_dirty(scr); } static void @@ -979,9 +985,7 @@ vcons_erasecols_buffer(void *cookie, int scr->scr_chars[offset + i] = 0x20; } -#ifdef VCONS_DRAW_INTR - atomic_inc_uint(&scr->scr_dirty); -#endif + vcons_dirty(scr); } #ifdef VCONS_DRAW_INTR @@ -1051,9 +1055,7 @@ vcons_copyrows_buffer(void *cookie, int memmove(&scr->scr_chars[to], &scr->scr_chars[from], len * sizeof(uint32_t)); -#ifdef VCONS_DRAW_INTR - atomic_inc_uint(&scr->scr_dirty); -#endif + vcons_dirty(scr); } static void @@ -1137,9 +1139,7 @@ vcons_eraserows_buffer(void *cookie, int scr->scr_chars[i] = 0x20; } -#ifdef VCONS_DRAW_INTR - atomic_inc_uint(&scr->scr_dirty); -#endif + vcons_dirty(scr); } #ifdef VCONS_DRAW_INTR @@ -1196,9 +1196,7 @@ vcons_putchar_buffer(void *cookie, int r scr->scr_chars[pos + offset] = c; } -#ifdef VCONS_DRAW_INTR - atomic_inc_uint(&scr->scr_dirty); -#endif + vcons_dirty(scr); } #ifdef VCONS_DRAW_INTR @@ -1258,9 +1256,7 @@ vcons_cursor(void *cookie, int on, int r if (scr->scr_ri.ri_crow != row || scr->scr_ri.ri_ccol != col) { scr->scr_ri.ri_crow = row; scr->scr_ri.ri_ccol = col; -#if defined(VCONS_DRAW_INTR) - atomic_inc_uint(&scr->scr_dirty); -#endif + vcons_dirty(scr); } vcons_unlock(scr); return; @@ -1576,7 +1572,7 @@ vcons_disable_polling(struct vcons_data vd->use_intr = 2; if (scr) - atomic_inc_uint(&scr->scr_dirty); + vcons_dirty(scr); #endif }
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:30:27 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: wsdisplay(4): Factor out scr_dirty setting. Reduces #ifdefs. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:20:04 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: wsdisplay(4): Factor out use_intr tests. Nix a lot of #ifdefs this way. Compiler can take care of dead code if appropriate. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.56 src/sys/dev/wscons/wsdisplay_vcons.c:1.57 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.56 Sun Jul 17 10:28:09 2022 +++ src/sys/dev/wscons/wsdisplay_vcons.c Sun Jul 17 11:20:04 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.56 2022/07/17 10:28:09 riastradh Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.57 2022/07/17 11:20:04 riastradh Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.56 2022/07/17 10:28:09 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.57 2022/07/17 11:20:04 riastradh Exp $"); #include #include @@ -125,6 +125,16 @@ static void vcons_softintr(void *); static void vcons_init_thread(void *); #endif +static inline bool +vcons_use_intr(const struct vcons_screen *scr) +{ +#ifdef VCONS_DRAW_INTR + return scr->scr_vd->use_intr; +#else + return false; +#endif +} + static int vcons_init_common(struct vcons_data *vd, void *cookie, struct wsscreen_descr *def, struct wsdisplay_accessops *ao, @@ -898,10 +908,8 @@ vcons_copycols(void *cookie, int row, in vcons_copycols_buffer(cookie, row, srccol, dstcol, ncols); -#if defined(VCONS_DRAW_INTR) - if (scr->scr_vd->use_intr) + if (vcons_use_intr(scr)) return; -#endif vcons_lock(scr); if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) { @@ -1001,10 +1009,8 @@ vcons_erasecols(void *cookie, int row, i vcons_erasecols_buffer(cookie, row, startcol, ncols, fillattr); -#if defined(VCONS_DRAW_INTR) - if (scr->scr_vd->use_intr) + if (vcons_use_intr(scr)) return; -#endif vcons_lock(scr); if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) { @@ -1058,10 +1064,8 @@ vcons_copyrows(void *cookie, int srcrow, vcons_copyrows_buffer(cookie, srcrow, dstrow, nrows); -#if defined(VCONS_DRAW_INTR) - if (scr->scr_vd->use_intr) + if (vcons_use_intr(scr)) return; -#endif vcons_lock(scr); if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) { @@ -1163,10 +1167,8 @@ vcons_eraserows(void *cookie, int row, i vcons_eraserows_buffer(cookie, row, nrows, fillattr); -#if defined(VCONS_DRAW_INTR) - if (scr->scr_vd->use_intr) + if (vcons_use_intr(scr)) return; -#endif vcons_lock(scr); if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) { @@ -1228,10 +1230,8 @@ vcons_putchar(void *cookie, int row, int vcons_putchar_buffer(cookie, row, col, c, attr); -#if defined(VCONS_DRAW_INTR) - if (scr->scr_vd->use_intr) + if (vcons_use_intr(scr)) return; -#endif vcons_lock(scr); if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) { @@ -1253,19 +1253,18 @@ vcons_cursor(void *cookie, int on, int r struct rasops_info *ri = cookie; struct vcons_screen *scr = ri->ri_hw; - -#if defined(VCONS_DRAW_INTR) - if (scr->scr_vd->use_intr) { + if (vcons_use_intr(scr)) { vcons_lock(scr); if (scr->scr_ri.ri_crow != row || scr->scr_ri.ri_ccol != col) { scr->scr_ri.ri_crow = row; scr->scr_ri.ri_ccol = col; +#if defined(VCONS_DRAW_INTR) atomic_inc_uint(&scr->scr_dirty); +#endif } vcons_unlock(scr); return; } -#endif vcons_lock(scr);
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 11:20:04 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: wsdisplay(4): Factor out use_intr tests. Nix a lot of #ifdefs this way. Compiler can take care of dead code if appropriate. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 10:27:45 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: wsdisplay(4): Nix trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: riastradh Date: Sun Jul 17 10:27:45 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: wsdisplay(4): Nix trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.54 src/sys/dev/wscons/wsdisplay_vcons.c:1.55 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.54 Sat Jul 16 10:57:59 2022 +++ src/sys/dev/wscons/wsdisplay_vcons.c Sun Jul 17 10:27:45 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.54 2022/07/16 10:57:59 mlelstv Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.55 2022/07/17 10:27:45 riastradh Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.54 2022/07/16 10:57:59 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.55 2022/07/17 10:27:45 riastradh Exp $"); #include #include @@ -63,11 +63,11 @@ __KERNEL_RCSID(0, "$NetBSD: wsdisplay_vc #define DPRINTF if (0) printf #endif -static void vcons_dummy_init_screen(void *, struct vcons_screen *, int, +static void vcons_dummy_init_screen(void *, struct vcons_screen *, int, long *); static int vcons_ioctl(void *, void *, u_long, void *, int, struct lwp *); -static int vcons_alloc_screen(void *, const struct wsscreen_descr *, void **, +static int vcons_alloc_screen(void *, const struct wsscreen_descr *, void **, int *, int *, long *); static void vcons_free_screen(void *, void *); static int vcons_show_screen(void *, void *, int, void (*)(void *, int, int), @@ -259,9 +259,9 @@ vcons_alloc_buffers(struct vcons_data *v int size; #endif - /* - * we allocate both chars and attributes in one chunk, attributes first - * because they have the (potentially) bigger alignment + /* + * we allocate both chars and attributes in one chunk, attributes first + * because they have the (potentially) bigger alignment */ #ifdef WSDISPLAY_SCROLLSUPPORT cnt = (ri->ri_rows + WSDISPLAY_SCROLLBACK_LINES) * ri->ri_cols; @@ -273,15 +273,15 @@ vcons_alloc_buffers(struct vcons_data *v #else cnt = ri->ri_rows * ri->ri_cols; #endif - scr->scr_attrs = malloc(cnt * (sizeof(long) + + scr->scr_attrs = malloc(cnt * (sizeof(long) + sizeof(uint32_t)), M_DEVBUF, M_WAITOK); if (scr->scr_attrs == NULL) return ENOMEM; scr->scr_chars = (uint32_t *)&scr->scr_attrs[cnt]; - /* - * fill the attribute buffer with *defattr, chars with 0x20 + /* + * fill the attribute buffer with *defattr, chars with 0x20 * since we don't know if the driver tries to mimic firmware output or * reset everything we do nothing to VRAM here, any driver that feels * the need to clear screen or something will have to do it on its own @@ -323,15 +323,15 @@ vcons_init_screen(struct vcons_data *vd, if (scr->scr_type == NULL) scr->scr_type = vd->defaulttype; - + /* * call the driver-supplied init_screen function which is expected * to set up rasops_info, override cursor() and probably others */ vd->init_screen(vd->cookie, scr, existing, defattr); - /* - * save the non virtual console aware rasops and replace them with + /* + * save the non virtual console aware rasops and replace them with * our wrappers */ vd->eraserows = ri->ri_ops.eraserows; @@ -356,8 +356,8 @@ vcons_init_screen(struct vcons_data *vd, vd->cursor = ri->ri_ops.cursor; } - ri->ri_ops.eraserows = vcons_eraserows; - ri->ri_ops.erasecols = vcons_erasecols; + ri->ri_ops.eraserows = vcons_eraserows; + ri->ri_ops.erasecols = vcons_erasecols; ri->ri_ops.putchar = vcons_putchar; ri->ri_ops.cursor= vcons_cursor; ri->ri_ops.copycols = vcons_copycols; @@ -381,14 +381,14 @@ vcons_init_screen(struct vcons_data *vd, vd->active = scr; SCREEN_VISIBLE(scr); } - + if (existing) { SCREEN_VISIBLE(scr); vd->active = scr; } else { SCREEN_INVISIBLE(scr); } - + LIST_INSERT_HEAD(&vd->screens, scr, next); return 0; } @@ -453,8 +453,8 @@ vcons_load_font(void *v, void *cookie, s free(scr->scr_attrs, M_DEVBUF); /* allocate new buffers */ vcons_alloc_buffers(vd, scr); - - /* save the potentially changed ri_ops */ + + /* save the potentially changed ri_ops */ vd->eraserows = ri->ri_ops.eraserows; vd->erasecols = ri->ri_ops.erasecols; scr->putchar = ri->ri_ops.putchar; @@ -479,8 +479,8 @@ vcons_load_font(void *v, void *cookie, s } /* and put our wrappers back */ - ri->ri_ops.eraserows = vcons_eraserows; - ri->ri_ops.erasecols = vcons_erasecols; + ri->ri_ops.eraserows = vcons_eraserows; + ri->ri_ops.erasecols = vcons_erasecols; ri->ri_ops.putchar = vcons_putchar; ri->ri_ops.cursor= vcons_cursor; ri->ri_ops.copycols = vcons_copy
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: mlelstv Date: Sat Jul 16 10:57:59 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: modify screen before updating cache. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.53 src/sys/dev/wscons/wsdisplay_vcons.c:1.54 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.53 Sun May 16 08:46:38 2021 +++ src/sys/dev/wscons/wsdisplay_vcons.c Sat Jul 16 10:57:59 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.53 2021/05/16 08:46:38 mlelstv Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.54 2022/07/16 10:57:59 mlelstv Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.53 2021/05/16 08:46:38 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.54 2022/07/16 10:57:59 mlelstv Exp $"); #include #include @@ -1003,11 +1003,11 @@ vcons_erasecols_cached(void *cookie, int struct vcons_data *vd = scr->scr_vd; int i, pos = row * ri->ri_cols + startcol; + vd->erasecols(cookie, row, startcol, ncols, fillattr); for (i = pos; i < ncols; i++) { - vd->chars[i] = 0x20; - vd->attrs[i] = fillattr; + vd->chars[i] = scr->scr_chars[i]; + vd->attrs[i] = scr->scr_attrs[i]; } - vd->erasecols(cookie, row, startcol, ncols, fillattr); } #endif
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: mlelstv Date: Sat Jul 16 10:57:59 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: modify screen before updating cache. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Sat Jan 29 01:19:30 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplayvar.h Log Message: Default WSDISPLAY_BORDER_COLOR to WS_DEFAULT_BG. Avoids black overscan area when WS_DEFAULT_BG is set. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/dev/wscons/wsdisplayvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Sat Jan 29 01:19:30 UTC 2022 Modified Files: src/sys/dev/wscons: wsdisplayvar.h Log Message: Default WSDISPLAY_BORDER_COLOR to WS_DEFAULT_BG. Avoids black overscan area when WS_DEFAULT_BG is set. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/dev/wscons/wsdisplayvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/wscons/wsdisplayvar.h diff -u src/sys/dev/wscons/wsdisplayvar.h:1.55 src/sys/dev/wscons/wsdisplayvar.h:1.56 --- src/sys/dev/wscons/wsdisplayvar.h:1.55 Wed Jan 30 11:24:48 2019 +++ src/sys/dev/wscons/wsdisplayvar.h Sat Jan 29 01:19:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplayvar.h,v 1.55 2019/01/30 11:24:48 jmcneill Exp $ */ +/* $NetBSD: wsdisplayvar.h,v 1.56 2022/01/29 01:19:30 uwe Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -277,7 +277,7 @@ const struct wsscreen_descr *wsdisplay_s #define WS_KERNEL_MONOATTR WS_DEFAULT_MONOATTR # endif # if !defined(WSDISPLAY_BORDER_COLOR) -#define WSDISPLAY_BORDER_COLOR WSCOL_BLACK +#define WSDISPLAY_BORDER_COLOR WS_DEFAULT_BG # endif #endif /* _KERNEL */
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Sun Jan 2 23:46:21 UTC 2022 Modified Files: src/sys/dev/wscons: wsemul_vt100.c Log Message: wsemul_vt100.c - make static everything that can be static Externally, wsdisplay only needs wsemul_vt100_ops. Internally (as vt100 emulation is split into several files) wsemul_vt100_subr.c needs wsemul_vt100_reset(). To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/dev/wscons/wsemul_vt100.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/dev/wscons/wsemul_vt100.c diff -u src/sys/dev/wscons/wsemul_vt100.c:1.48 src/sys/dev/wscons/wsemul_vt100.c:1.49 --- src/sys/dev/wscons/wsemul_vt100.c:1.48 Mon Jun 7 16:37:34 2021 +++ src/sys/dev/wscons/wsemul_vt100.c Sun Jan 2 23:46:21 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_vt100.c,v 1.48 2021/06/07 16:37:34 christos Exp $ */ +/* $NetBSD: wsemul_vt100.c,v 1.49 2022/01/02 23:46:21 uwe Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100.c,v 1.48 2021/06/07 16:37:34 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100.c,v 1.49 2022/01/02 23:46:21 uwe Exp $"); #ifdef _KERNEL_OPT #include "opt_wsmsgattrs.h" @@ -45,13 +45,14 @@ __KERNEL_RCSID(0, "$NetBSD: wsemul_vt100 #include #include -void *wsemul_vt100_cnattach(const struct wsscreen_descr *, void *, - int, int, long); -void *wsemul_vt100_attach(int console, const struct wsscreen_descr *, - void *, int, int, void *, long); -void wsemul_vt100_output(void *cookie, const u_char *data, u_int count, int); -void wsemul_vt100_detach(void *cookie, u_int *crowp, u_int *ccolp); -void wsemul_vt100_resetop(void *, enum wsemul_resetops); +static void *wsemul_vt100_cnattach(const struct wsscreen_descr *, void *, + int, int, long); +static void *wsemul_vt100_attach(int console, const struct wsscreen_descr *, + void *, int, int, void *, long); +static void wsemul_vt100_output(void *cookie, const u_char *data, u_int count, +int kernel); +static void wsemul_vt100_detach(void *cookie, u_int *crowp, u_int *ccolp); +static void wsemul_vt100_resetop(void *, enum wsemul_resetops); #ifdef WSDISPLAY_CUSTOM_OUTPUT static void wsemul_vt100_getmsgattrs(void *, struct wsdisplay_msgattrs *); static void wsemul_vt100_setmsgattrs(void *, const struct wsscreen_descr *, @@ -77,7 +78,7 @@ const struct wsemul_ops wsemul_vt100_ops .resize = wsemul_vt100_resize }; -struct wsemul_vt100_emuldata wsemul_vt100_console_emuldata; +static struct wsemul_vt100_emuldata wsemul_vt100_console_emuldata; static void wsemul_vt100_init(struct wsemul_vt100_emuldata *, const struct wsscreen_descr *, @@ -118,7 +119,7 @@ wsemul_vt100_output_dcs_dollar; #define VT100_EMUL_STATE_DCS 11 /* got DCS (ESC P) */ #define VT100_EMUL_STATE_DCS_DOLLAR 12 /* got DCS$ */ -vt100_handler *vt100_output[] = { +static vt100_handler *vt100_output[] = { wsemul_vt100_output_esc, wsemul_vt100_output_csi, wsemul_vt100_output_scs94, @@ -208,7 +209,7 @@ wsemul_vt100_init(struct wsemul_vt100_em edp->kernattr = vd->defattr; } -void * +static void * wsemul_vt100_cnattach(const struct wsscreen_descr *type, void *cookie, int ccol, int crow, long defattr) { @@ -233,7 +234,7 @@ wsemul_vt100_cnattach(const struct wsscr return edp; } -void * +static void * wsemul_vt100_attach(int console, const struct wsscreen_descr *type, void *cookie, int ccol, int crow, void *cbcookie, long defattr) { @@ -266,7 +267,7 @@ wsemul_vt100_attach(int console, const s return edp; } -void +static void wsemul_vt100_detach(void *cookie, u_int *crowp, u_int *ccolp) { struct wsemul_vt100_emuldata *edp = cookie; @@ -298,7 +299,7 @@ wsemul_vt100_resize(void * cookie, const wsemul_vt100_resetop(cookie, WSEMUL_CLEARSCREEN); } -void +static void wsemul_vt100_resetop(void *cookie, enum wsemul_resetops op) { struct wsemul_vt100_emuldata *edp = cookie; @@ -972,7 +973,7 @@ wsemul_vt100_output_csi(struct wsemul_vt return VT100_EMUL_STATE_CSI; } -void +static void wsemul_vt100_output(void *cookie, const u_char *data, u_int count, int kernel) { struct wsemul_vt100_emuldata *edp = cookie;
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: uwe Date: Sun Jan 2 23:46:21 UTC 2022 Modified Files: src/sys/dev/wscons: wsemul_vt100.c Log Message: wsemul_vt100.c - make static everything that can be static Externally, wsdisplay only needs wsemul_vt100_ops. Internally (as vt100 emulation is split into several files) wsemul_vt100_subr.c needs wsemul_vt100_reset(). To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/dev/wscons/wsemul_vt100.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: hannken Date: Sat Jan 1 11:57:44 UTC 2022 Modified Files: src/sys/dev/wscons: wsemul_sun.c Log Message: Protect KASSERT() with "#ifdef DIAGNOSTIC" as its expression is undefined otherwise. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/dev/wscons/wsemul_sun.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/dev/wscons/wsemul_sun.c diff -u src/sys/dev/wscons/wsemul_sun.c:1.33 src/sys/dev/wscons/wsemul_sun.c:1.34 --- src/sys/dev/wscons/wsemul_sun.c:1.33 Mon Sep 3 16:29:34 2018 +++ src/sys/dev/wscons/wsemul_sun.c Sat Jan 1 11:57:44 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_sun.c,v 1.33 2018/09/03 16:29:34 riastradh Exp $ */ +/* $NetBSD: wsemul_sun.c,v 1.34 2022/01/01 11:57:44 hannken Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -33,7 +33,7 @@ /* XXX DESCRIPTION/SOURCE OF INFORMATION */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_sun.c,v 1.33 2018/09/03 16:29:34 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_sun.c,v 1.34 2022/01/01 11:57:44 hannken Exp $"); #include #include @@ -176,7 +176,9 @@ wsemul_sun_attach(int console, const str if (console) { edp = &wsemul_sun_console_emuldata; +#ifdef DIAGNOSTIC KASSERT(edp->console == 1); +#endif } else { edp = malloc(sizeof *edp, M_DEVBUF, M_WAITOK);
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: hannken Date: Sat Jan 1 11:57:44 UTC 2022 Modified Files: src/sys/dev/wscons: wsemul_sun.c Log Message: Protect KASSERT() with "#ifdef DIAGNOSTIC" as its expression is undefined otherwise. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/dev/wscons/wsemul_sun.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: msaitoh Date: Wed Nov 10 16:57:39 UTC 2021 Modified Files: src/sys/dev/wscons: wsmux.c Log Message: s/configuraiton/configuration/ in comment. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/dev/wscons/wsmux.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/dev/wscons/wsmux.c diff -u src/sys/dev/wscons/wsmux.c:1.64 src/sys/dev/wscons/wsmux.c:1.65 --- src/sys/dev/wscons/wsmux.c:1.64 Sun Nov 10 21:16:38 2019 +++ src/sys/dev/wscons/wsmux.c Wed Nov 10 16:57:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: wsmux.c,v 1.64 2019/11/10 21:16:38 chs Exp $ */ +/* $NetBSD: wsmux.c,v 1.65 2021/11/10 16:57:39 msaitoh Exp $ */ /* * Copyright (c) 1998, 2005 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsmux.c,v 1.64 2019/11/10 21:16:38 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsmux.c,v 1.65 2021/11/10 16:57:39 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -650,7 +650,7 @@ wsmux_create(const char *name, int unit) { struct wsmux_softc *sc; - /* XXX This is wrong -- should use autoconfiguraiton framework */ + /* XXX This is wrong -- should use autoconfiguration framework */ DPRINTF(("wsmux_create: allocating\n")); sc = malloc(sizeof *sc, M_DEVBUF, M_WAITOK|M_ZERO);
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: msaitoh Date: Wed Nov 10 16:57:39 UTC 2021 Modified Files: src/sys/dev/wscons: wsmux.c Log Message: s/configuraiton/configuration/ in comment. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/dev/wscons/wsmux.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/dev/wscons
On Sun, Oct 10, 2021 at 10:44:03PM +0900, Izumi Tsutsui wrote: > > Module Name:src > > Committed By: nia > > Date: Tue Sep 28 06:14:28 UTC 2021 > > > > Modified Files: > > src/sys/dev/wscons: wsconsio.h wsmouse.c wsmousevar.h > > > > Log Message: > > wsmouse: add support for "precision scrolling" events and (GET|SET)PARAMS > > Could you please also update wsmouse(4) and wsmouse(9) man pages? > Even the current version lacks various info (especially about ioctl(2)) > but no reason to make it worse. > > Thanks, > --- > Izumi Tsutsui Sure, I had been meaning to anyway but I clearly forgot to commit those files...
Re: CVS commit: src/sys/dev/wscons
> Module Name: src > Committed By: nia > Date: Tue Sep 28 06:14:28 UTC 2021 > > Modified Files: > src/sys/dev/wscons: wsconsio.h wsmouse.c wsmousevar.h > > Log Message: > wsmouse: add support for "precision scrolling" events and (GET|SET)PARAMS Could you please also update wsmouse(4) and wsmouse(9) man pages? Even the current version lacks various info (especially about ioctl(2)) but no reason to make it worse. Thanks, --- Izumi Tsutsui
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: nia Date: Tue Sep 28 06:14:28 UTC 2021 Modified Files: src/sys/dev/wscons: wsconsio.h wsmouse.c wsmousevar.h Log Message: wsmouse: add support for "precision scrolling" events and (GET|SET)PARAMS WSCONS_EVENT_HSCROLL and WSCONS_EVENT_VSCROLL are two new wscons event types that allow scrolling with a higher precision ("smoothness") than an emulated scroll wheel, and are useful for touch input drivers. WSMOUSEIO_GETPARAMS and WSMOUSEIO_SETPARAMS are two new ioctls that allow the speed and direction of precision scrolling to be configured. both features were originally implemented in OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.125 -r1.126 src/sys/dev/wscons/wsconsio.h cvs rdiff -u -r1.69 -r1.70 src/sys/dev/wscons/wsmouse.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/wscons/wsmousevar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/wscons/wsconsio.h diff -u src/sys/dev/wscons/wsconsio.h:1.125 src/sys/dev/wscons/wsconsio.h:1.126 --- src/sys/dev/wscons/wsconsio.h:1.125 Sat Apr 24 00:15:37 2021 +++ src/sys/dev/wscons/wsconsio.h Tue Sep 28 06:14:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: wsconsio.h,v 1.125 2021/04/24 00:15:37 macallan Exp $ */ +/* $NetBSD: wsconsio.h,v 1.126 2021/09/28 06:14:27 nia Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -76,7 +76,8 @@ struct wscons_event { #define WSCONS_EVENT_ASCII 13 /* key code is already ascii */ #define WSCONS_EVENT_MOUSE_DELTA_W 14 /* W delta amount */ #define WSCONS_EVENT_MOUSE_ABSOLUTE_W 15 /* W location */ - +#define WSCONS_EVENT_HSCROLL 16 /* X axis precision scrolling */ +#define WSCONS_EVENT_VSCROLL 17 /* Y axis precision scrolling */ /* * Keyboard ioctls (0 - 31) @@ -270,6 +271,28 @@ struct wsmouse_repeat { #define WSMOUSEIO_SETVERSION _IOW('W', 41, int) #define WSMOUSE_EVENT_VERSION WSEVENT_VERSION +enum wsmousecfg { + WSMOUSECFG_REVERSE_SCROLLING = 0, + /* Touchpad parameters */ + WSMOUSECFG_HORIZSCROLLDIST, + WSMOUSECFG_VERTSCROLLDIST +}; + +struct wsmouse_param { + enum wsmousecfg key; + int value; +}; + +struct wsmouse_parameters { + struct wsmouse_param *params; + unsigned int nparams; +}; + +#define WSMOUSECFG_MAX (128) /* maximum number of wsmouse_params */ + +#define WSMOUSEIO_GETPARAMS _IOW('W', 42, struct wsmouse_parameters) +#define WSMOUSEIO_SETPARAMS _IOW('W', 43, struct wsmouse_parameters) + /* * Display ioctls (64 - 95) */ Index: src/sys/dev/wscons/wsmouse.c diff -u src/sys/dev/wscons/wsmouse.c:1.69 src/sys/dev/wscons/wsmouse.c:1.70 --- src/sys/dev/wscons/wsmouse.c:1.69 Sun Dec 27 16:09:33 2020 +++ src/sys/dev/wscons/wsmouse.c Tue Sep 28 06:14:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: wsmouse.c,v 1.69 2020/12/27 16:09:33 tsutsui Exp $ */ +/* $NetBSD: wsmouse.c,v 1.70 2021/09/28 06:14:27 nia Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -104,7 +104,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.69 2020/12/27 16:09:33 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.70 2021/09/28 06:14:27 nia Exp $"); #include "wsmouse.h" #include "wsdisplay.h" @@ -170,6 +170,10 @@ struct wsmouse_softc { int sc_repeat_button; callout_t sc_repeat_callout; unsigned int sc_repeat_delay; + + int sc_reverse_scroll; + int sc_horiz_scroll_dist; + int sc_vert_scroll_dist; }; static int wsmouse_match(device_t, cfdata_t, void *); @@ -177,6 +181,13 @@ static void wsmouse_attach(device_t, dev static int wsmouse_detach(device_t, int); static int wsmouse_activate(device_t, enum devact); +static int wsmouse_set_params(struct wsmouse_softc *, + struct wsmouse_param *, size_t); +static int wsmouse_get_params(struct wsmouse_softc *, + struct wsmouse_param *, size_t); +static int wsmouse_handle_params(struct wsmouse_softc *, + struct wsmouse_parameters *, bool); + static int wsmouse_do_ioctl(struct wsmouse_softc *, u_long, void *, int, struct lwp *); @@ -258,6 +269,9 @@ wsmouse_attach(device_t parent, device_t memset(&sc->sc_repeat, 0, sizeof(sc->sc_repeat)); sc->sc_repeat_button = -1; sc->sc_repeat_delay = 0; + sc->sc_reverse_scroll = 0; + sc->sc_horiz_scroll_dist = WSMOUSE_DEFAULT_SCROLL_DIST; + sc->sc_vert_scroll_dist = WSMOUSE_DEFAULT_SCROLL_DIST; callout_init(&sc->sc_repeat_callout, 0); callout_setfunc(&sc->sc_repeat_callout, wsmouse_repeat, sc); @@ -516,6 +530,41 @@ wsmouse_input(device_t wsmousedev, u_int } } +void +wsmouse_precision_scroll(device_t wsmousedev, int x, int y) +{ + struct wsmouse_softc *sc = device_private(wsmousedev); + struct wseventvar *evar; + struct wscons_event events[2]; + int nevents = 0; + + evar = sc->sc_base.me_evp; + if (evar == NULL) + return; + + if (sc->sc_reverse_scroll) { + x = -x; + y = -y; + } + + x = (x * 4096) / sc->sc_horiz_scroll_dist; + y = (y * 4096) / sc->sc_vert
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: nia Date: Tue Sep 28 06:14:28 UTC 2021 Modified Files: src/sys/dev/wscons: wsconsio.h wsmouse.c wsmousevar.h Log Message: wsmouse: add support for "precision scrolling" events and (GET|SET)PARAMS WSCONS_EVENT_HSCROLL and WSCONS_EVENT_VSCROLL are two new wscons event types that allow scrolling with a higher precision ("smoothness") than an emulated scroll wheel, and are useful for touch input drivers. WSMOUSEIO_GETPARAMS and WSMOUSEIO_SETPARAMS are two new ioctls that allow the speed and direction of precision scrolling to be configured. both features were originally implemented in OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.125 -r1.126 src/sys/dev/wscons/wsconsio.h cvs rdiff -u -r1.69 -r1.70 src/sys/dev/wscons/wsmouse.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/wscons/wsmousevar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/dev/wscons
The change isn't wrong, but I booted the wrong kernel and it does not fix the aarch64 issue I am seeing. On Sun, 17 Jan 2021, Jared D. McNeill wrote: Module Name:src Committed By: jmcneill Date: Sun Jan 17 15:13:15 UTC 2021 Modified Files: src/sys/dev/wscons: wsdisplay_vconsvar.h Log Message: Add appropriate memory barriers around sc_busy accesses. Fixes an issue where character cells are sometimes not erased properly on aarch64 at boot. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/wscons/wsdisplay_vconsvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: rin Date: Wed Jul 31 14:29:54 UTC 2019 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: When font is switched, not only putchar, but also other ri_ops can be changed by backend driver, e.g., see rasops1.c: https://nxr.netbsd.org/xref/src/sys/dev/rasops/rasops1.c#58 To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/dev/wscons/wsdisplay_vcons.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/dev/wscons/wsdisplay_vcons.c diff -u src/sys/dev/wscons/wsdisplay_vcons.c:1.39 src/sys/dev/wscons/wsdisplay_vcons.c:1.40 --- src/sys/dev/wscons/wsdisplay_vcons.c:1.39 Sat Dec 1 00:28:45 2018 +++ src/sys/dev/wscons/wsdisplay_vcons.c Wed Jul 31 14:29:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.39 2018/12/01 00:28:45 msaitoh Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.40 2019/07/31 14:29:54 rin Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.39 2018/12/01 00:28:45 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.40 2019/07/31 14:29:54 rin Exp $"); #include #include @@ -430,8 +430,23 @@ vcons_load_font(void *v, void *cookie, s /* allocate new buffers */ vcons_alloc_buffers(vd, scr); - /* save the potentially changed putchar */ + /* save the potentially changed ri_ops */ + vd->eraserows = ri->ri_ops.eraserows; + vd->erasecols = ri->ri_ops.erasecols; scr->putchar = ri->ri_ops.putchar; + vd->cursor= ri->ri_ops.cursor; + + if (scr->scr_flags & VCONS_NO_COPYCOLS) { + vd->copycols = vcons_copycols_noread; + } else { + vd->copycols = ri->ri_ops.copycols; + } + + if (scr->scr_flags & VCONS_NO_COPYROWS) { + vd->copyrows = vcons_copyrows_noread; + } else { + vd->copyrows = ri->ri_ops.copyrows; + } /* and put our wrappers back */ ri->ri_ops.eraserows = vcons_eraserows;
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: rin Date: Wed Jul 31 14:29:54 UTC 2019 Modified Files: src/sys/dev/wscons: wsdisplay_vcons.c Log Message: When font is switched, not only putchar, but also other ri_ops can be changed by backend driver, e.g., see rasops1.c: https://nxr.netbsd.org/xref/src/sys/dev/rasops/rasops1.c#58 To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/dev/wscons/wsdisplay_vcons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: jmcneill Date: Thu Jul 25 20:26:39 UTC 2019 Modified Files: src/sys/dev/wscons: wsdisplay.c Log Message: Halt the old console on both cnattach and preattach To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158 src/sys/dev/wscons/wsdisplay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: jmcneill Date: Thu Jul 25 20:26:39 UTC 2019 Modified Files: src/sys/dev/wscons: wsdisplay.c Log Message: Halt the old console on both cnattach and preattach To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158 src/sys/dev/wscons/wsdisplay.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/dev/wscons/wsdisplay.c diff -u src/sys/dev/wscons/wsdisplay.c:1.157 src/sys/dev/wscons/wsdisplay.c:1.158 --- src/sys/dev/wscons/wsdisplay.c:1.157 Wed Jul 24 19:40:55 2019 +++ src/sys/dev/wscons/wsdisplay.c Thu Jul 25 20:26:39 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay.c,v 1.157 2019/07/24 19:40:55 jmcneill Exp $ */ +/* $NetBSD: wsdisplay.c,v 1.158 2019/07/25 20:26:39 jmcneill Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.157 2019/07/24 19:40:55 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.158 2019/07/25 20:26:39 jmcneill Exp $"); #ifdef _KERNEL_OPT #include "opt_wsdisplay_compat.h" @@ -943,11 +943,12 @@ wsdisplay_cnattach(const struct wsscreen ccol, crow, defattr); - if (cn_tab != &wsdisplay_cons) { - if (cn_tab != NULL && cn_tab->cn_halt != NULL) - cn_tab->cn_halt(cn_tab->cn_dev); + if (cn_tab != &wsdisplay_cons) wsdisplay_ocn = cn_tab; - } + + if (wsdisplay_ocn != NULL && wsdisplay_ocn->cn_halt != NULL) + wsdisplay_ocn->cn_halt(wsdisplay_ocn->cn_dev); + cn_tab = &wsdisplay_cons; wsdisplay_console_initted = 2; } @@ -974,11 +975,12 @@ wsdisplay_preattach(const struct wsscree ccol, crow, defattr); - if (cn_tab != &wsdisplay_cons) { - if (cn_tab != NULL && cn_tab->cn_halt != NULL) - cn_tab->cn_halt(cn_tab->cn_dev); + if (cn_tab != &wsdisplay_cons) wsdisplay_ocn = cn_tab; - } + + if (wsdisplay_ocn != NULL && wsdisplay_ocn->cn_halt != NULL) + wsdisplay_ocn->cn_halt(wsdisplay_ocn->cn_dev); + cn_tab = &wsdisplay_cons; wsdisplay_console_initted = 1; }
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: jmcneill Date: Wed Jul 24 19:40:56 UTC 2019 Modified Files: src/sys/dev/wscons: wsdisplay.c Log Message: Call cn_halt for old console in wsdisplay_preattach too To generate a diff of this commit: cvs rdiff -u -r1.156 -r1.157 src/sys/dev/wscons/wsdisplay.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/dev/wscons/wsdisplay.c diff -u src/sys/dev/wscons/wsdisplay.c:1.156 src/sys/dev/wscons/wsdisplay.c:1.157 --- src/sys/dev/wscons/wsdisplay.c:1.156 Tue Jul 23 17:39:36 2019 +++ src/sys/dev/wscons/wsdisplay.c Wed Jul 24 19:40:55 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay.c,v 1.156 2019/07/23 17:39:36 rin Exp $ */ +/* $NetBSD: wsdisplay.c,v 1.157 2019/07/24 19:40:55 jmcneill Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.156 2019/07/23 17:39:36 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.157 2019/07/24 19:40:55 jmcneill Exp $"); #ifdef _KERNEL_OPT #include "opt_wsdisplay_compat.h" @@ -974,8 +974,11 @@ wsdisplay_preattach(const struct wsscree ccol, crow, defattr); - if (cn_tab != &wsdisplay_cons) + if (cn_tab != &wsdisplay_cons) { + if (cn_tab != NULL && cn_tab->cn_halt != NULL) + cn_tab->cn_halt(cn_tab->cn_dev); wsdisplay_ocn = cn_tab; + } cn_tab = &wsdisplay_cons; wsdisplay_console_initted = 1; }
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: jmcneill Date: Wed Jul 24 19:40:56 UTC 2019 Modified Files: src/sys/dev/wscons: wsdisplay.c Log Message: Call cn_halt for old console in wsdisplay_preattach too To generate a diff of this commit: cvs rdiff -u -r1.156 -r1.157 src/sys/dev/wscons/wsdisplay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: jmcneill Date: Tue Jul 23 15:55:49 UTC 2019 Modified Files: src/sys/dev/wscons: wsdisplay.c Log Message: Call cn_halt on the old console device To generate a diff of this commit: cvs rdiff -u -r1.154 -r1.155 src/sys/dev/wscons/wsdisplay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: jmcneill Date: Tue Jul 23 15:55:49 UTC 2019 Modified Files: src/sys/dev/wscons: wsdisplay.c Log Message: Call cn_halt on the old console device To generate a diff of this commit: cvs rdiff -u -r1.154 -r1.155 src/sys/dev/wscons/wsdisplay.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/dev/wscons/wsdisplay.c diff -u src/sys/dev/wscons/wsdisplay.c:1.154 src/sys/dev/wscons/wsdisplay.c:1.155 --- src/sys/dev/wscons/wsdisplay.c:1.154 Thu Feb 7 06:10:29 2019 +++ src/sys/dev/wscons/wsdisplay.c Tue Jul 23 15:55:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay.c,v 1.154 2019/02/07 06:10:29 mlelstv Exp $ */ +/* $NetBSD: wsdisplay.c,v 1.155 2019/07/23 15:55:49 jmcneill Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.154 2019/02/07 06:10:29 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.155 2019/07/23 15:55:49 jmcneill Exp $"); #ifdef _KERNEL_OPT #include "opt_wsdisplay_compat.h" @@ -930,8 +930,11 @@ wsdisplay_cnattach(const struct wsscreen ccol, crow, defattr); - if (cn_tab != &wsdisplay_cons) + if (cn_tab != &wsdisplay_cons) { + if (cn_tab != NULL && cn_tab->cn_halt != NULL) + cn_tab->cn_halt(cn_tab->cn_dev); wsdisplay_ocn = cn_tab; + } cn_tab = &wsdisplay_cons; wsdisplay_console_initted = 2; }
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: ryoon Date: Tue Jul 9 12:55:46 UTC 2019 Modified Files: src/sys/dev/wscons: tpcalib.c Log Message: Do not overflow int64_t on HP Spectre x360 13-inch ae019TU The machine has pen touch panel with (18344, 10544) -> (3840, 2160) conversion. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/wscons/tpcalib.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: ryoon Date: Tue Jul 9 12:55:46 UTC 2019 Modified Files: src/sys/dev/wscons: tpcalib.c Log Message: Do not overflow int64_t on HP Spectre x360 13-inch ae019TU The machine has pen touch panel with (18344, 10544) -> (3840, 2160) conversion. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/wscons/tpcalib.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/dev/wscons/tpcalib.c diff -u src/sys/dev/wscons/tpcalib.c:1.12 src/sys/dev/wscons/tpcalib.c:1.13 --- src/sys/dev/wscons/tpcalib.c:1.12 Thu Apr 6 20:44:39 2017 +++ src/sys/dev/wscons/tpcalib.c Tue Jul 9 12:55:45 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: tpcalib.c,v 1.12 2017/04/06 20:44:39 macallan Exp $ */ +/* $NetBSD: tpcalib.c,v 1.13 2019/07/09 12:55:45 ryoon Exp $ */ /* * Copyright (c) 1999-2003 TAKEMURA Shin All rights reserved. @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tpcalib.c,v 1.12 2017/04/06 20:44:39 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tpcalib.c,v 1.13 2019/07/09 12:55:45 ryoon Exp $"); #ifdef _KERNEL_OPT #include "opt_tpcalib.h" @@ -53,7 +53,7 @@ extern int mra_Y_AX1_BX2_C(const int *, const int *, int, const int *, int, int, int, int *, int *, int *); -#define SCALE (1024*256) +#define SCALE (1024) int tpcalib_init(struct tpcalib_softc *sc)
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: isaki Date: Sat Jun 22 08:03:01 UTC 2019 Modified Files: src/sys/dev/wscons: wsbell.c Log Message: Add missing SETBELL() for WSKBDIO_COMPLEXBELL. wskbd_bell_data structure has value fields and operation bitmask field. "xset b * * 0" doesn't touch period field (and doesn't initialized it) and doesn't set DOPERIOD flag (this means that period field should not be used). SETBELL() handles this situation appropliately. This happened during copying wsbell.c from wskbd.c. Fix PR xsrc/54245. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/wscons/wsbell.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/dev/wscons/wsbell.c diff -u src/sys/dev/wscons/wsbell.c:1.11 src/sys/dev/wscons/wsbell.c:1.12 --- src/sys/dev/wscons/wsbell.c:1.11 Thu Apr 18 14:01:28 2019 +++ src/sys/dev/wscons/wsbell.c Sat Jun 22 08:03:01 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: wsbell.c,v 1.11 2019/04/18 14:01:28 isaki Exp $ */ +/* $NetBSD: wsbell.c,v 1.12 2019/06/22 08:03:01 isaki Exp $ */ /*- * Copyright (c) 2017 Nathanial Sloss @@ -107,7 +107,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsbell.c,v 1.11 2019/04/18 14:01:28 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsbell.c,v 1.12 2019/06/22 08:03:01 isaki Exp $"); #if defined(_KERNEL_OPT) #include "wsmux.h" @@ -396,9 +396,9 @@ getbell: return (EACCES); if (data == NULL) return 0; -#define d ((struct wskbd_bell_data *)data) - spkr_audio_play(sc, d->pitch, d->period, d->volume); -#undef d + ubdp = (struct wskbd_bell_data *)data; + SETBELL(ubdp, ubdp, &sc->sc_bell_data); + spkr_audio_play(sc, ubdp->pitch, ubdp->period, ubdp->volume); return 0; }
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: isaki Date: Sat Jun 22 08:03:01 UTC 2019 Modified Files: src/sys/dev/wscons: wsbell.c Log Message: Add missing SETBELL() for WSKBDIO_COMPLEXBELL. wskbd_bell_data structure has value fields and operation bitmask field. "xset b * * 0" doesn't touch period field (and doesn't initialized it) and doesn't set DOPERIOD flag (this means that period field should not be used). SETBELL() handles this situation appropliately. This happened during copying wsbell.c from wskbd.c. Fix PR xsrc/54245. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/wscons/wsbell.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/dev/wscons
On Sun, Sep 11, 2011 at 11:33:48PM +0200, Christoph Egger wrote: > On 11.09.11 21:19, Jonathan A. Kollasch wrote: > > Module Name:src > > Committed By: jakllsch > > Date: Sun Sep 11 19:19:19 UTC 2011 > > > > Modified Files: > > src/sys/dev/wscons: wsmouse.c > > > > Log Message: > > Initialize the W axis value on open as is already done for the other axes. > > > > To generate a diff of this commit: > > cvs rdiff -u -r1.62 -r1.63 src/sys/dev/wscons/wsmouse.c > > > > sc->sc_z = INVALID_Z; > > + sc->sc_z = INVALID_W; > > You mean sc->sc_w here, right ? Yes, fixed.
Re: CVS commit: src/sys/dev/wscons
On 11.09.11 21:19, Jonathan A. Kollasch wrote: > Module Name: src > Committed By: jakllsch > Date: Sun Sep 11 19:19:19 UTC 2011 > > Modified Files: > src/sys/dev/wscons: wsmouse.c > > Log Message: > Initialize the W axis value on open as is already done for the other axes. > > > To generate a diff of this commit: > cvs rdiff -u -r1.62 -r1.63 src/sys/dev/wscons/wsmouse.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/dev/wscons/wsmouse.c > diff -u src/sys/dev/wscons/wsmouse.c:1.62 src/sys/dev/wscons/wsmouse.c:1.63 > --- src/sys/dev/wscons/wsmouse.c:1.62 Thu Jan 15 04:22:11 2009 > +++ src/sys/dev/wscons/wsmouse.c Sun Sep 11 19:19:19 2011 > @@ -1,4 +1,4 @@ > -/* $NetBSD: wsmouse.c,v 1.62 2009/01/15 04:22:11 yamt Exp $ */ > +/* $NetBSD: wsmouse.c,v 1.63 2011/09/11 19:19:19 jakllsch Exp $ */ > > /*- > * Copyright (c) 2006 The NetBSD Foundation, Inc. > @@ -104,7 +104,7 @@ > */ > > #include > -__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.62 2009/01/15 04:22:11 yamt Exp > $"); > +__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.63 2011/09/11 19:19:19 jakllsch > Exp $"); > > #include "wsmouse.h" > #include "wsdisplay.h" > @@ -143,6 +143,7 @@ > #define INVALID_XINT_MAX > #define INVALID_YINT_MAX > #define INVALID_ZINT_MAX > +#define INVALID_WINT_MAX > > struct wsmouse_softc { > struct wsevsrc sc_base; > @@ -621,6 +622,7 @@ > sc->sc_x = INVALID_X; > sc->sc_y = INVALID_Y; > sc->sc_z = INVALID_Z; > + sc->sc_z = INVALID_W; You mean sc->sc_w here, right ? Christoph > > /* Stop button repeating when messing with the device. */ > if (sc->sc_repeat_button != -1) { >
Re: CVS commit: src/sys/dev/wscons
> Module Name: src > Committed By: macallan > Date: Wed Jun 29 03:06:16 UTC 2011 > > Modified Files: > src/sys/dev/wscons: wsconsio.h > > Log Message: > add two new ioctl()s: > WSDISPLAYIO_GET_EDID to retrieve EDID data from display drivers > WSDISPLAYIO_SET_POLLING to control polling with VCONS_DRAW_INTR Can you please document these new exported APIs in wsdisplay(4) man page? Too many undocumented APIs in wscons(4) are really annoying. --- Izumi Tsutsui
Re: CVS commit: src/sys/dev/wscons
Hello, On Wed, 29 Jun 2011 04:23:00 + (UTC) chris...@astron.com (Christos Zoulas) wrote: > In article <20110629030617.0d3dc17...@cvs.netbsd.org>, > Michael Lorenz wrote: > >-=-=-=-=-=- > > > >+struct wsdisplayio_edid_info { > >+int buffer_size; > >+int data_size; > >+uint8_t *edid_data; > >+}; > > Shouldn't the sizes be size_t or uintXX_t? > Signed sizes lead to bugs. True. > Shouldn't edit_data be void *? The EDID block is a byte array and read as such. have fun Michael
Re: CVS commit: src/sys/dev/wscons
In article <20110629030617.0d3dc17...@cvs.netbsd.org>, Michael Lorenz wrote: >-=-=-=-=-=- > >+struct wsdisplayio_edid_info { >+ int buffer_size; >+ int data_size; >+ uint8_t *edid_data; >+}; Shouldn't the sizes be size_t or uintXX_t? Signed sizes lead to bugs. Shouldn't edit_data be void *? christos
Re: CVS commit: src/sys/dev/wscons (wsemul_vt100.c)
nick.hud...@gmx.co.uk said: > On Thursday 11 February 2010 00:28:23 Geoff Wing wrote: > > This reversal removed variables that were being used. > I have no idea if my quick hack was correct. The variables are really needed, for that obscure "WSDISPLAY_CUSTOM_OUTPUT" hack which I had missed initially. I've just put them back. best regards Matthias Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender), Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, Prof. Dr. Sebastian M. Schmidt
CVS commit: src/sys/dev/wscons
Module Name:src Committed By: drochner Date: Thu Feb 11 10:07:14 UTC 2010 Modified Files: src/sys/dev/wscons: wsemul_vt100.c Log Message: put back the "vt100base_data" variable which was souce of confusion, it is really needed, as noted by Geoff Wing To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/dev/wscons/wsemul_vt100.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.