Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/allwinner Implement WSDISPLAYIO_SVIDEO, WSDISPL...
details: https://anonhg.NetBSD.org/src/rev/4c4a870b51ae
branches: trunk
changeset: 803853:4c4a870b51ae
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Fri Nov 14 23:45:02 2014 +0000
description:
Implement WSDISPLAYIO_SVIDEO, WSDISPLAYIO_GVIDEO for screen blanking
diffstat:
sys/arch/arm/allwinner/awin_debe.c | 32 ++++++++++++++++++++++++++++++--
sys/arch/arm/allwinner/awin_fb.c | 9 +++++++--
sys/arch/arm/allwinner/awin_var.h | 3 ++-
3 files changed, 39 insertions(+), 5 deletions(-)
diffs (118 lines):
diff -r cc7eb036e7c6 -r 4c4a870b51ae sys/arch/arm/allwinner/awin_debe.c
--- a/sys/arch/arm/allwinner/awin_debe.c Fri Nov 14 22:46:34 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_debe.c Fri Nov 14 23:45:02 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_debe.c,v 1.7 2014/11/14 19:47:36 jmcneill Exp $ */
+/* $NetBSD: awin_debe.c,v 1.8 2014/11/14 23:45:02 jmcneill Exp $ */
/*-
* Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -34,7 +34,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_debe.c,v 1.7 2014/11/14 19:47:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_debe.c,v 1.8 2014/11/14 23:45:02 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -49,6 +49,7 @@
#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_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;
+}
+
diff -r cc7eb036e7c6 -r 4c4a870b51ae sys/arch/arm/allwinner/awin_fb.c
--- a/sys/arch/arm/allwinner/awin_fb.c Fri Nov 14 22:46:34 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_fb.c Fri Nov 14 23:45:02 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_fb.c,v 1.5 2014/11/14 19:47:36 jmcneill Exp $ */
+/* $NetBSD: awin_fb.c,v 1.6 2014/11/14 23:45:02 jmcneill Exp $ */
/*-
* Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_fb.c,v 1.5 2014/11/14 19:47:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_fb.c,v 1.6 2014/11/14 23:45:02 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -46,6 +46,7 @@
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_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 @@
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;
}
diff -r cc7eb036e7c6 -r 4c4a870b51ae sys/arch/arm/allwinner/awin_var.h
--- a/sys/arch/arm/allwinner/awin_var.h Fri Nov 14 22:46:34 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_var.h Fri Nov 14 23:45:02 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_var.h,v 1.23 2014/11/14 19:47:36 jmcneill Exp $ */
+/* $NetBSD: awin_var.h,v 1.24 2014/11/14 23:45:02 jmcneill Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -131,6 +131,7 @@
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);
Home |
Main Index |
Thread Index |
Old Index