Module Name: src Committed By: martin Date: Sat Nov 15 11:31:40 UTC 2014
Modified Files: src/sys/arch/arm/allwinner [netbsd-7]: awin_debe.c awin_fb.c awin_var.h Log Message: Pull up following revision(s) (requested by jmcneill in ticket #239): sys/arch/arm/allwinner/awin_debe.c: revision 1.8 sys/arch/arm/allwinner/awin_var.h: revision 1.24 sys/arch/arm/allwinner/awin_fb.c: revision 1.6 Implement WSDISPLAYIO_SVIDEO, WSDISPLAYIO_GVIDEO for screen blanking To generate a diff of this commit: cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/sys/arch/arm/allwinner/awin_debe.c cvs rdiff -u -r1.4.2.3 -r1.4.2.4 src/sys/arch/arm/allwinner/awin_fb.c cvs rdiff -u -r1.10.2.3 -r1.10.2.4 src/sys/arch/arm/allwinner/awin_var.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/arch/arm/allwinner/awin_debe.c diff -u src/sys/arch/arm/allwinner/awin_debe.c:1.6.2.3 src/sys/arch/arm/allwinner/awin_debe.c:1.6.2.4 --- src/sys/arch/arm/allwinner/awin_debe.c:1.6.2.3 Fri Nov 14 22:23:28 2014 +++ src/sys/arch/arm/allwinner/awin_debe.c Sat Nov 15 11:31:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_debe.c,v 1.6.2.3 2014/11/14 22:23:28 martin Exp $ */ +/* $NetBSD: awin_debe.c,v 1.6.2.4 2014/11/15 11:31:40 martin Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill <jmcne...@invisible.ca> @@ -34,7 +34,7 @@ #endif #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: awin_debe.c,v 1.6.2.3 2014/11/14 22:23:28 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_debe.c,v 1.6.2.4 2014/11/15 11:31:40 martin Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: awin_debe.c, #include <arm/allwinner/awin_var.h> #include <dev/videomode/videomode.h> +#include <dev/wscons/wsconsio.h> struct awin_debe_softc { device_t sc_dev; @@ -360,3 +361,30 @@ awin_debe_set_videomode(const struct vid awin_debe_setup_fbdev(sc, mode); } } + +int +awin_debe_ioctl(device_t self, u_long cmd, void *data) +{ + struct awin_debe_softc *sc = device_private(self); + uint32_t val; + int enable; + + switch (cmd) { + case WSDISPLAYIO_SVIDEO: + enable = *(int *)data; + val = DEBE_READ(sc, AWIN_DEBE_MODCTL_REG); + if (enable) + val |= AWIN_DEBE_MODCTL_LAY0_EN; + else + val &= ~AWIN_DEBE_MODCTL_LAY0_EN; + DEBE_WRITE(sc, AWIN_DEBE_MODCTL_REG, val); + return 0; + case WSDISPLAYIO_GVIDEO: + val = DEBE_READ(sc, AWIN_DEBE_MODCTL_REG); + *(int *)data = !!(val & AWIN_DEBE_MODCTL_LAY0_EN); + return 0; + } + + return EPASSTHROUGH; +} + Index: src/sys/arch/arm/allwinner/awin_fb.c diff -u src/sys/arch/arm/allwinner/awin_fb.c:1.4.2.3 src/sys/arch/arm/allwinner/awin_fb.c:1.4.2.4 --- src/sys/arch/arm/allwinner/awin_fb.c:1.4.2.3 Fri Nov 14 22:23:28 2014 +++ src/sys/arch/arm/allwinner/awin_fb.c Sat Nov 15 11:31:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_fb.c,v 1.4.2.3 2014/11/14 22:23:28 martin Exp $ */ +/* $NetBSD: awin_fb.c,v 1.4.2.4 2014/11/15 11:31:40 martin Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: awin_fb.c,v 1.4.2.3 2014/11/14 22:23:28 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_fb.c,v 1.4.2.4 2014/11/15 11:31:40 martin Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -46,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: awin_fb.c,v struct awin_fb_softc { struct genfb_softc sc_gen; + device_t sc_debedev; bus_dma_tag_t sc_dmat; bus_dma_segment_t *sc_dmasegs; @@ -82,6 +83,7 @@ awin_fb_attach(device_t parent, device_t awin_fb_consoledev = self; sc->sc_gen.sc_dev = self; + sc->sc_debedev = parent; sc->sc_dmat = afb->afb_dmat; sc->sc_dmasegs = afb->afb_dmasegs; sc->sc_ndmasegs = afb->afb_ndmasegs; @@ -144,6 +146,9 @@ awin_fb_ioctl(void *v, void *vs, u_long if (error == 0) fbi->fbi_flags |= WSFB_VRAM_IS_RAM; return error; + case WSDISPLAYIO_SVIDEO: + case WSDISPLAYIO_GVIDEO: + return awin_debe_ioctl(sc->sc_debedev, cmd, data); default: return EPASSTHROUGH; } Index: src/sys/arch/arm/allwinner/awin_var.h diff -u src/sys/arch/arm/allwinner/awin_var.h:1.10.2.3 src/sys/arch/arm/allwinner/awin_var.h:1.10.2.4 --- src/sys/arch/arm/allwinner/awin_var.h:1.10.2.3 Fri Nov 14 22:23:28 2014 +++ src/sys/arch/arm/allwinner/awin_var.h Sat Nov 15 11:31:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_var.h,v 1.10.2.3 2014/11/14 22:23:28 martin Exp $ */ +/* $NetBSD: awin_var.h,v 1.10.2.4 2014/11/15 11:31:40 martin Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -131,6 +131,7 @@ void awin_tcon_set_videomode(const struc void awin_tcon_enable(bool); void awin_debe_set_videomode(const struct videomode *); void awin_debe_enable(bool); +int awin_debe_ioctl(device_t, u_long, void *); void awin_fb_set_videomode(device_t, u_int, u_int); void awin_fb_ddb_trap_callback(int);