Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/dreamcast/dev Add WSDISPLAYIO_VIDEO_{ON, OFF} suppor...



details:   https://anonhg.NetBSD.org/src/rev/9e00a19277e2
branches:  trunk
changeset: 556235:9e00a19277e2
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Dec 10 10:36:02 2003 +0000

description:
Add WSDISPLAYIO_VIDEO_{ON,OFF} support for WSDISPLAYIO_SVIDEO ioctl.
Patch from Yasushi Oshima.

diffstat:

 sys/arch/dreamcast/dev/pvr.c |  26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r 7df1fa4adbe8 -r 9e00a19277e2 sys/arch/dreamcast/dev/pvr.c
--- a/sys/arch/dreamcast/dev/pvr.c      Wed Dec 10 10:30:45 2003 +0000
+++ b/sys/arch/dreamcast/dev/pvr.c      Wed Dec 10 10:36:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pvr.c,v 1.17 2002/10/02 05:11:19 thorpej Exp $ */
+/*     $NetBSD: pvr.c,v 1.18 2003/12/10 10:36:02 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2001 Marcus Comstedt.
@@ -65,7 +65,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pvr.c,v 1.17 2002/10/02 05:11:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pvr.c,v 1.18 2003/12/10 10:36:02 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -364,7 +364,27 @@
                return (EPASSTHROUGH);  /* XXX Colormap */
 
        case WSDISPLAYIO_SVIDEO:
-               return (EPASSTHROUGH);  /* XXX */
+               switch (*(u_int *)data) {
+               case WSDISPLAYIO_VIDEO_OFF:
+                       if (!dc->dc_blanked) {
+                               dc->dc_blanked = 1;
+                               PVR_REG_WRITE(dc, PVRREG_DIWMODE,
+                                   PVR_REG_READ(dc, PVRREG_DIWMODE) &
+                                   ~DIWMODE_DE);
+                       }
+                       break;
+               case WSDISPLAYIO_VIDEO_ON:
+                       if (dc->dc_blanked) {
+                               dc->dc_blanked = 0;
+                               PVR_REG_WRITE(dc, PVRREG_DIWMODE,
+                                   PVR_REG_READ(dc, PVRREG_DIWMODE) |
+                                   DIWMODE_DE);
+                       }
+                       break;
+               default:
+                       return (EPASSTHROUGH);  /* XXX */
+               }
+               return (0);
 
        case WSDISPLAYIO_GVIDEO:
                *(u_int *)data = dc->dc_blanked ?



Home | Main Index | Thread Index | Old Index