diff options
| author | macallan <macallan@NetBSD.org> | 2020-10-30 15:30:43 +0000 |
|---|---|---|
| committer | macallan <macallan@NetBSD.org> | 2020-10-30 15:30:43 +0000 |
| commit | 844af0169eece0f0d9799bbbb9cb302250e5bec7 (patch) | |
| tree | c6b0fae1df1c5d6af1d779d386e98bd6b42dcf18 /sys/dev | |
| parent | 38964cda09947ea89d3c5b4c8f228254204771b7 (diff) | |
support screen blanking of r5xx
somewhat crude but works
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pci/radeonfb.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/sys/dev/pci/radeonfb.c b/sys/dev/pci/radeonfb.c index 088d4451af1..ebde56da5f9 100644 --- a/sys/dev/pci/radeonfb.c +++ b/sys/dev/pci/radeonfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: radeonfb.c,v 1.111 2020/10/11 21:41:57 jdc Exp $ */ +/* $NetBSD: radeonfb.c,v 1.112 2020/10/30 15:30:43 macallan Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.111 2020/10/11 21:41:57 jdc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.112 2020/10/30 15:30:43 macallan Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -2558,11 +2558,14 @@ radeonfb_isblank(struct radeonfb_display *dp) struct radeonfb_softc *sc = dp->rd_softc; uint32_t reg, mask; - if (IS_AVIVO(sc)) return 0; - if(!dp->rd_softc->sc_mapped) return 1; + if (IS_AVIVO(sc)) { + reg = GET32(sc, AVIVO_D1CRTC_CONTROL); + return ((reg & AVIVO_CRTC_EN) == 0); + } + if (dp->rd_crtcs[0].rc_number) { reg = RADEON_CRTC2_GEN_CNTL; mask = RADEON_CRTC2_DISP_DIS; @@ -2581,11 +2584,27 @@ radeonfb_blank(struct radeonfb_display *dp, int blank) uint32_t fpreg, fpval; int i; - if(IS_AVIVO(sc)) return; if (!sc->sc_mapped) return; + if(IS_AVIVO(sc)) { + + /* + * XXX + * I don't know how to turn the sunc outputs off for DPMS + * power control, so for now just turn the entire CRTC off + */ + if (blank) { + CLR32(sc, AVIVO_D1CRTC_CONTROL, AVIVO_CRTC_EN); + CLR32(sc, AVIVO_D2CRTC_CONTROL, AVIVO_CRTC_EN); + } else { + SET32(sc, AVIVO_D1CRTC_CONTROL, AVIVO_CRTC_EN); + SET32(sc, AVIVO_D2CRTC_CONTROL, AVIVO_CRTC_EN); + } + return; + } + /* non-AVIVO case */ for (i = 0; i < dp->rd_ncrtcs; i++) { if (dp->rd_crtcs[i].rc_number) { |
