Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wscons - add a cookie to show_screen_cb()



details:   https://anonhg.NetBSD.org/src/rev/8cff2b22ee8c
branches:  trunk
changeset: 824358:8cff2b22ee8c
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Jun 02 19:33:51 2017 +0000

description:
- add a cookie to show_screen_cb()
- call show_screen_cb() when loading a font into a visible screen, so this can
  be used to track parameters by drivers that use the glyph cache

diffstat:

 sys/dev/wscons/wsdisplay_vcons.c    |  13 +++++++++----
 sys/dev/wscons/wsdisplay_vconsvar.h |   5 +++--
 2 files changed, 12 insertions(+), 6 deletions(-)

diffs (67 lines):

diff -r 331b036d1f34 -r 8cff2b22ee8c sys/dev/wscons/wsdisplay_vcons.c
--- a/sys/dev/wscons/wsdisplay_vcons.c  Fri Jun 02 19:30:10 2017 +0000
+++ b/sys/dev/wscons/wsdisplay_vcons.c  Fri Jun 02 19:33:51 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wsdisplay_vcons.c,v 1.37 2017/05/19 19:22:33 macallan Exp $ */
+/*     $NetBSD: wsdisplay_vcons.c,v 1.38 2017/06/02 19:33:51 macallan Exp $ */
 
 /*-
  * Copyright (c) 2005, 2006 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.37 2017/05/19 19:22:33 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.38 2017/06/02 19:33:51 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -438,6 +438,11 @@
        ri->ri_ops.copycols  = vcons_copycols;
        ri->ri_ops.copyrows  = vcons_copyrows;
        vcons_unlock(vd->active);
+
+       /* notify things that we're about to redraw */
+       if (vd->show_screen_cb != NULL)
+               vd->show_screen_cb(scr, vd->show_screen_cookie);
+       
 #ifdef VCONS_DRAW_INTR
        /*
         * XXX
@@ -515,7 +520,7 @@
 #endif
 
        if (vd->show_screen_cb != NULL)
-               vd->show_screen_cb(scr);
+               vd->show_screen_cb(scr, vd->show_screen_cookie);
 
        if ((scr->scr_flags & VCONS_NO_REDRAW) == 0)
                vcons_redraw_screen(scr);
@@ -1505,7 +1510,7 @@
        vd->wanted = NULL;
 
        if (vd->show_screen_cb != NULL)
-               vd->show_screen_cb(scr);
+               vd->show_screen_cb(scr, vd->show_screen_cookie);
 }
 
 #ifdef VCONS_DRAW_INTR
diff -r 331b036d1f34 -r 8cff2b22ee8c sys/dev/wscons/wsdisplay_vconsvar.h
--- a/sys/dev/wscons/wsdisplay_vconsvar.h       Fri Jun 02 19:30:10 2017 +0000
+++ b/sys/dev/wscons/wsdisplay_vconsvar.h       Fri Jun 02 19:33:51 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wsdisplay_vconsvar.h,v 1.25 2017/05/19 19:22:33 macallan Exp $ */
+/*     $NetBSD: wsdisplay_vconsvar.h,v 1.26 2017/06/02 19:33:51 macallan Exp $ */
 
 /*-
  * Copyright (c) 2005, 2006 Michael Lorenz
@@ -116,7 +116,8 @@
        void (*eraserows)(void *, int, int, long);
        void (*cursor)(void *, int, int, int);
        /* called before vcons_redraw_screen */
-       void (*show_screen_cb)(struct vcons_screen *);
+       void *show_screen_cookie;
+       void (*show_screen_cb)(struct vcons_screen *, void *);
        /* virtual screen management stuff */
        void (*switch_cb)(void *, int, int);
        void *switch_cb_arg;



Home | Main Index | Thread Index | Old Index