diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-06-20 19:54:38 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-06-20 19:54:38 +0000 |
commit | 69fc1a7162ec1f1ccf8d054be842341222e28530 (patch) | |
tree | 24b5ef741ed647f9d87dc36ad29438a1a759f272 /sys/arch/sparc64/dev | |
parent | c7c31c649973f0cf9cc915731ea1d5d3d1df7701 (diff) |
Screen blanker routine for Creator, adapted from the X11 sunffb driver code.
Tested by jason@ and I.
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r-- | sys/arch/sparc64/dev/creator.c | 30 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/creatorreg.h | 6 |
2 files changed, 32 insertions, 4 deletions
diff --git a/sys/arch/sparc64/dev/creator.c b/sys/arch/sparc64/dev/creator.c index 2d06d94bc2d..65ce54ab5e7 100644 --- a/sys/arch/sparc64/dev/creator.c +++ b/sys/arch/sparc64/dev/creator.c @@ -1,4 +1,4 @@ -/* $OpenBSD: creator.c,v 1.26 2003/06/17 17:35:40 miod Exp $ */ +/* $OpenBSD: creator.c,v 1.27 2003/06/20 19:54:37 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -67,6 +67,7 @@ int creator_alloc_screen(void *, const struct wsscreen_descr *, void **, void creator_free_screen(void *, void *); int creator_show_screen(void *, void *, int, void (*cb)(void *, int, int), void *); +void creator_burner(void *, u_int, u_int); paddr_t creator_mmap(void *, off_t, int); void creator_ras_fifo_wait(struct creator_softc *, int); void creator_ras_wait(struct creator_softc *); @@ -90,7 +91,7 @@ struct wsdisplay_accessops creator_accessops = { NULL, /* load font */ NULL, /* scrollback */ NULL, /* getchar */ - NULL, /* burner */ + creator_burner }; struct cfdriver creator_cd = { @@ -159,7 +160,7 @@ creator_attach(struct creator_softc *sc) if (sc->sc_console) { sc->sc_sunfb.sf_ro.ri_updatecursor = creator_ras_updatecursor; fbwscons_console_init(&sc->sc_sunfb, &creator_stdscreen, -1, - NULL); + creator_burner); } waa.console = sc->sc_console; @@ -427,6 +428,29 @@ creator_show_screen(v, cookie, waitok, cb, cbarg) return (0); } +void +creator_burner(void *v, u_int on, u_int flags) +{ + struct creator_softc *sc = v; + u_int32_t tgen; + + DAC_WRITE(sc, FFB_DAC_TYPE, DAC_TYPE_BLANK); + tgen = DAC_READ(sc, FFB_DAC_VALUE); + if (on) { + tgen |= DAC_BLANK_VIDEO_ENABLE; + tgen &= ~(DAC_BLANK_HSYNC_DISABLE | DAC_BLANK_VSYNC_DISABLE); + } else { + tgen &= ~DAC_BLANK_VIDEO_ENABLE; +#if 0 /* yields very strange results sometimes when unblanking... */ + if (flags & WSDISPLAY_BURN_VBLANK) + tgen |= DAC_BLANK_HSYNC_DISABLE | + DAC_BLANK_VSYNC_DISABLE; +#endif + } + DAC_WRITE(sc, FFB_DAC_TYPE, DAC_TYPE_BLANK); + DAC_WRITE(sc, FFB_DAC_VALUE, tgen); +} + const struct creator_mappings { bus_addr_t uoff; bus_addr_t poff; diff --git a/sys/arch/sparc64/dev/creatorreg.h b/sys/arch/sparc64/dev/creatorreg.h index 453374647ef..6ad4c52a250 100644 --- a/sys/arch/sparc64/dev/creatorreg.h +++ b/sys/arch/sparc64/dev/creatorreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: creatorreg.h,v 1.7 2003/06/02 20:02:49 jason Exp $ */ +/* $OpenBSD: creatorreg.h,v 1.8 2003/06/20 19:54:37 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -313,3 +313,7 @@ #define DAC_TYPE2_CURSENAB 0x100 /* cursor enable */ #define DAC_TYPE2_CURSCMAP 0x102 /* set cursor colormap */ #define DAC_TYPE2_CURSPOS 0x104 /* set cursor position */ + +#define DAC_BLANK_VIDEO_ENABLE 0x00000001 +#define DAC_BLANK_HSYNC_DISABLE 0x00000004 +#define DAC_BLANK_VSYNC_DISABLE 0x00000008 |