Add enable/disable polling hooks to genfb_ops.

This commit is contained in:
riastradh 2014-07-24 21:35:12 +00:00
parent 01b7eb4932
commit b41195f82b
5 changed files with 21 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_genfb.c,v 1.5 2013/05/11 07:42:34 skrll Exp $ */
/* $NetBSD: bcm2835_genfb.c,v 1.6 2014/07/24 21:35:12 riastradh Exp $ */
/*-
* Copyright (c) 2013 Jared D. McNeill <jmcneill@invisible.ca>
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_genfb.c,v 1.5 2013/05/11 07:42:34 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_genfb.c,v 1.6 2014/07/24 21:35:12 riastradh Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -82,7 +82,8 @@ bcmgenfb_attach(device_t parent, device_t self, void *aux)
struct bcmgenfb_softc *sc = device_private(self);
struct amba_attach_args *aaa = aux;
prop_dictionary_t dict = device_properties(self);
struct genfb_ops ops;
static const struct genfb_ops zero_ops;
struct genfb_ops ops = zero_ops;
bool is_console = false;
int error;
@ -113,7 +114,6 @@ bcmgenfb_attach(device_t parent, device_t self, void *aux)
}
sc->sc_gen.sc_fbaddr = bus_space_vaddr(sc->sc_iot, sc->sc_ioh);
memset(&ops, 0, sizeof(ops));
ops.genfb_ioctl = bcmgenfb_ioctl;
ops.genfb_mmap = bcmgenfb_mmap;

View File

@ -1,4 +1,4 @@
/* $NetBSD: genfb_pci.c,v 1.36 2014/01/27 13:22:55 macallan Exp $ */
/* $NetBSD: genfb_pci.c,v 1.37 2014/07/24 21:35:13 riastradh Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: genfb_pci.c,v 1.36 2014/01/27 13:22:55 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: genfb_pci.c,v 1.37 2014/07/24 21:35:13 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -98,7 +98,8 @@ pci_genfb_attach(device_t parent, device_t self, void *aux)
{
struct pci_genfb_softc *sc = device_private(self);
struct pci_attach_args *pa = aux;
struct genfb_ops ops;
static const struct genfb_ops zero_ops;
struct genfb_ops ops = zero_ops;
pcireg_t rom;
int idx, bar, type;

View File

@ -1,4 +1,4 @@
/* $NetBSD: genfb_sbus.c,v 1.10 2010/10/07 07:53:54 macallan Exp $ */
/* $NetBSD: genfb_sbus.c,v 1.11 2014/07/24 21:35:13 riastradh Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@ -29,7 +29,7 @@
/* an SBus frontend for the generic fb console driver */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: genfb_sbus.c,v 1.10 2010/10/07 07:53:54 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: genfb_sbus.c,v 1.11 2014/07/24 21:35:13 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -91,7 +91,8 @@ genfb_attach_sbus(device_t parent, device_t self, void *args)
{
struct genfb_sbus_softc *sc = device_private(self);
struct sbus_attach_args *sa = args;
struct genfb_ops ops;
static const struct genfb_ops zero_ops;
struct genfb_ops ops = zero_ops;
prop_dictionary_t dict;
bus_space_handle_t bh;
paddr_t fbpa;

View File

@ -1,4 +1,4 @@
/* $NetBSD: genfb.c,v 1.54 2014/07/22 15:42:59 riastradh Exp $ */
/* $NetBSD: genfb.c,v 1.55 2014/07/24 21:35:13 riastradh Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.54 2014/07/22 15:42:59 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.55 2014/07/24 21:35:13 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -779,6 +779,8 @@ genfb_enable_polling(device_t dev)
SCREEN_ENABLE_DRAWING(&sc->sc_console_screen);
vcons_hard_switch(&sc->sc_console_screen);
vcons_enable_polling(&sc->vd);
if (sc->sc_ops.genfb_enable_polling)
(*sc->sc_ops.genfb_enable_polling)(sc);
}
}
@ -788,6 +790,8 @@ genfb_disable_polling(device_t dev)
struct genfb_softc *sc = device_private(dev);
if (sc->sc_console_screen.scr_vd) {
if (sc->sc_ops.genfb_disable_polling)
(*sc->sc_ops.genfb_disable_polling)(sc);
vcons_disable_polling(&sc->vd);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: genfbvar.h,v 1.23 2014/07/23 16:56:49 riastradh Exp $ */
/* $NetBSD: genfbvar.h,v 1.24 2014/07/24 21:35:13 riastradh Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@ -60,6 +60,8 @@ struct genfb_ops {
int (*genfb_ioctl)(void *, void *, u_long, void *, int, struct lwp *);
paddr_t (*genfb_mmap)(void *, void *, off_t, int);
int (*genfb_borrow)(void *, bus_addr_t, bus_space_handle_t *);
int (*genfb_enable_polling)(void *);
int (*genfb_disable_polling)(void *);
};
struct genfb_colormap_callback {