summaryrefslogtreecommitdiff
path: root/sys/dev/wsfb/genfb.c
diff options
context:
space:
mode:
authorskrll <skrll@NetBSD.org>2014-01-22 18:47:11 +0000
committerskrll <skrll@NetBSD.org>2014-01-22 18:47:11 +0000
commit8729d8d139dd2cf47a92c9f01f290696dcddea5d (patch)
tree3bd3f5bbfe69674dfcca872fa865255e1832f314 /sys/dev/wsfb/genfb.c
parent67b37d936823edd206a624c600fa467651ffeeb8 (diff)
Provide a wsdisplay_accessops.pollc
This makes sure that the screen gets painted properly during early boot input (e.g. boot -a) on the Raspberry PI.
Diffstat (limited to 'sys/dev/wsfb/genfb.c')
-rw-r--r--sys/dev/wsfb/genfb.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/sys/dev/wsfb/genfb.c b/sys/dev/wsfb/genfb.c
index 1820a5bc191..3df92181458 100644
--- a/sys/dev/wsfb/genfb.c
+++ b/sys/dev/wsfb/genfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb.c,v 1.51 2013/10/09 17:20:54 macallan Exp $ */
+/* $NetBSD: genfb.c,v 1.52 2014/01/22 18:47:11 skrll Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.51 2013/10/09 17:20:54 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.52 2014/01/22 18:47:11 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -68,6 +68,8 @@ __KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.51 2013/10/09 17:20:54 macallan Exp $");
static int genfb_ioctl(void *, void *, u_long, void *, int, struct lwp *);
static paddr_t genfb_mmap(void *, void *, off_t, int);
+static void genfb_pollc(void *, int);
+
static void genfb_init_screen(void *, struct vcons_screen *, int, long *);
static int genfb_putcmap(struct genfb_softc *, struct wsdisplay_cmap *);
@@ -234,6 +236,7 @@ genfb_attach(struct genfb_softc *sc, struct genfb_ops *ops)
sc->sc_accessops.ioctl = genfb_ioctl;
sc->sc_accessops.mmap = genfb_mmap;
+ sc->sc_accessops.pollc = genfb_pollc;
#ifdef GENFB_SHADOWFB
sc->sc_shadowfb = kmem_alloc(sc->sc_fbsize, KM_SLEEP);
@@ -485,6 +488,21 @@ genfb_mmap(void *v, void *vs, off_t offset, int prot)
}
static void
+genfb_pollc(void *v, int on)
+{
+ struct vcons_data *vd = v;
+ struct genfb_softc *sc = vd->cookie;
+
+ if (sc == NULL)
+ return;
+
+ if (on)
+ genfb_enable_polling(sc->sc_dev);
+ else
+ genfb_disable_polling(sc->sc_dev);
+}
+
+static void
genfb_init_screen(void *cookie, struct vcons_screen *scr,
int existing, long *defattr)
{