Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci - unmap registers in WSDISPLAYIO_MODE_MAPPED onl...
details: https://anonhg.NetBSD.org/src/rev/5fd0801d3750
branches: trunk
changeset: 333490:5fd0801d3750
user: macallan <macallan%NetBSD.org@localhost>
date: Wed Nov 05 19:39:17 2014 +0000
description:
- unmap registers in WSDISPLAYIO_MODE_MAPPED only if a drm attached
- don't try to touch backlight registers when they're not mapped
diffstat:
sys/dev/pci/radeonfb.c | 27 ++++++++++++++++++++-------
sys/dev/pci/radeonfbvar.h | 3 ++-
2 files changed, 22 insertions(+), 8 deletions(-)
diffs (98 lines):
diff -r f57d489b0df1 -r 5fd0801d3750 sys/dev/pci/radeonfb.c
--- a/sys/dev/pci/radeonfb.c Wed Nov 05 18:32:29 2014 +0000
+++ b/sys/dev/pci/radeonfb.c Wed Nov 05 19:39:17 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: radeonfb.c,v 1.87 2014/10/21 09:07:07 macallan Exp $ */
+/* $NetBSD: radeonfb.c,v 1.88 2014/11/05 19:39:17 macallan Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.87 2014/10/21 09:07:07 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.88 2014/11/05 19:39:17 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1001,7 +1001,14 @@
pmf_event_register(dev, PMFE_DISPLAY_BRIGHTNESS_DOWN,
radeonfb_brightness_down, TRUE);
- config_found_ia(dev, "drm", aux, radeonfb_drm_print);
+ /*
+ * if we attach a DRM we need to unmap registers in
+ * WSDISPLAYIO_MODE_MAPPED, since this keeps us from doing things like
+ * screen blanking we only do it if needed
+ */
+ sc->sc_needs_unmap =
+ (config_found_ia(dev, "drm", aux, radeonfb_drm_print) != 0);
+ DPRINTF(("needs_unmap: %d\n", sc->sc_needs_unmap));
PRINTREG(RADEON_CRTC_EXT_CNTL);
PRINTREG(RADEON_CRTC_GEN_CNTL);
@@ -1048,6 +1055,9 @@
static void
radeonfb_unmap(struct radeonfb_softc *sc)
{
+ if (!sc->sc_needs_unmap)
+ return;
+
if (sc->sc_mapped) {
bus_space_unmap(sc->sc_regt, sc->sc_regh, sc->sc_regsz);
bus_space_unmap(sc->sc_memt, sc->sc_memh, sc->sc_memsz);
@@ -1119,6 +1129,8 @@
case WSDISPLAYIO_SVIDEO:
radeonfb_blank(dp,
(*(unsigned int *)d == WSDISPLAYIO_VIDEO_OFF));
+ radeonfb_switch_backlight(dp,
+ (*(unsigned int *)d == WSDISPLAYIO_VIDEO_ON));
return 0;
case WSDISPLAYIO_GETCMAP:
@@ -4093,10 +4105,13 @@
static int
radeonfb_set_backlight(struct radeonfb_display *dp, int level)
{
- struct radeonfb_softc *sc;
+ struct radeonfb_softc *sc = dp->rd_softc;;
int rlevel, s;
uint32_t lvds;
+ if(!sc->sc_mapped)
+ return 0;
+
s = spltty();
dp->rd_bl_level = level;
@@ -4108,11 +4123,9 @@
else if (level >= RADEONFB_BACKLIGHT_MAX)
level = RADEONFB_BACKLIGHT_MAX;
- sc = dp->rd_softc;
-
/* On some chips, we should negate the backlight level. */
if (dp->rd_softc->sc_flags & RFB_INV_BLIGHT) {
- rlevel = RADEONFB_BACKLIGHT_MAX - level;
+ rlevel = RADEONFB_BACKLIGHT_MAX - level;
} else
rlevel = level;
diff -r f57d489b0df1 -r 5fd0801d3750 sys/dev/pci/radeonfbvar.h
--- a/sys/dev/pci/radeonfbvar.h Wed Nov 05 18:32:29 2014 +0000
+++ b/sys/dev/pci/radeonfbvar.h Wed Nov 05 19:39:17 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: radeonfbvar.h,v 1.19 2014/01/22 07:57:33 macallan Exp $ */
+/* $NetBSD: radeonfbvar.h,v 1.20 2014/11/05 19:39:17 macallan Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -231,6 +231,7 @@
bus_size_t sc_iosz;
bus_addr_t sc_ioaddr;
+ int sc_needs_unmap;
int sc_mapped;
/* size of a single display */
Home |
Main Index |
Thread Index |
Old Index