Module Name:    src
Committed By:   macallan
Date:           Thu Apr  6 20:44:39 UTC 2017

Modified Files:
        src/sys/dev/wscons: tpcalib.c

Log Message:
don't forget to store bounds rectangle in raw mode


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 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.11 src/sys/dev/wscons/tpcalib.c:1.12
--- src/sys/dev/wscons/tpcalib.c:1.11	Sun Mar  4 06:02:51 2007
+++ src/sys/dev/wscons/tpcalib.c	Thu Apr  6 20:44:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: tpcalib.c,v 1.11 2007/03/04 06:02:51 christos Exp $	*/
+/*	$NetBSD: tpcalib.c,v 1.12 2017/04/06 20:44:39 macallan Exp $	*/
 
 /*
  * Copyright (c) 1999-2003 TAKEMURA Shin All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tpcalib.c,v 1.11 2007/03/04 06:02:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tpcalib.c,v 1.12 2017/04/06 20:44:39 macallan Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_tpcalib.h"
@@ -101,7 +101,8 @@ tpcalib_ioctl(struct tpcalib_softc *sc, 
 		d = (const struct wsmouse_calibcoords *)data;
 		if (d->samplelen == WSMOUSE_CALIBCOORDS_RESET) {
 			tpcalib_reset(sc);
-		} else
+		} 
+		if (d->samplelen > 0) {
 			if (mra_Y_AX1_BX2_C(&d->samples[0].x, s,
 				    &d->samples[0].rawx, s,
 				    &d->samples[0].rawy, s,
@@ -116,20 +117,21 @@ tpcalib_ioctl(struct tpcalib_softc *sc, 
 				tpcalib_reset(sc);
 
 				return (EINVAL);
-			} else {
-				sc->sc_minx = d->minx;
-				sc->sc_maxx = d->maxx;
-				sc->sc_miny = d->miny;
-				sc->sc_maxy = d->maxy;
-				sc->sc_saved = *d;
-				DPRINTF(("tpcalib: x=%d~%d y=%d~%d\n",
-				    sc->sc_minx, sc->sc_maxx,
-				    sc->sc_miny, sc->sc_maxy));
-				DPRINTF(("tpcalib: Ax=%d Bx=%d Cx=%d\n",
-				    sc->sc_ax, sc->sc_bx, sc->sc_cx));
-				DPRINTF(("tpcalib: Ay=%d By=%d Cy=%d\n",
-				    sc->sc_ay, sc->sc_by, sc->sc_cy));
 			}
+		}
+		sc->sc_minx = d->minx;
+		sc->sc_maxx = d->maxx;
+		sc->sc_miny = d->miny;
+		sc->sc_maxy = d->maxy;
+		sc->sc_saved = *d;
+		DPRINTF(("tpcalib: x=%d~%d y=%d~%d\n",
+		    sc->sc_minx, sc->sc_maxx,
+		    sc->sc_miny, sc->sc_maxy));
+		DPRINTF(("tpcalib: Ax=%d Bx=%d Cx=%d\n",
+		    sc->sc_ax, sc->sc_bx, sc->sc_cx));
+		DPRINTF(("tpcalib: Ay=%d By=%d Cy=%d\n",
+		    sc->sc_ay, sc->sc_by, sc->sc_cy));
+		
 		break;
 
 	case WSMOUSEIO_GCALIBCOORDS:

Reply via email to