Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/arm/rockchip Pull up following revision(s) (requ...



details:   https://anonhg.NetBSD.org/src/rev/0276559da26c
branches:  netbsd-9
changeset: 1001371:0276559da26c
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jan 09 11:16:53 2020 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #613):

        sys/arch/arm/rockchip/rk_vop.c: revision 1.6

in rk_vop_dpms() set or unset the VOP_STANDBY_EN bit in VOP_SYS_CTRL
depending on the dpms mode requested.

this makes pinebook pro display actually turn off when dpms asks.

diffstat:

 sys/arch/arm/rockchip/rk_vop.c |  25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r 9cf4d73b13c9 -r 0276559da26c sys/arch/arm/rockchip/rk_vop.c
--- a/sys/arch/arm/rockchip/rk_vop.c    Wed Jan 08 11:52:24 2020 +0000
+++ b/sys/arch/arm/rockchip/rk_vop.c    Thu Jan 09 11:16:53 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_vop.c,v 1.2.2.3 2019/12/17 12:32:52 martin Exp $ */
+/* $NetBSD: rk_vop.c,v 1.2.2.4 2020/01/09 11:16:53 martin Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.2.2.3 2019/12/17 12:32:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.2.2.4 2020/01/09 11:16:53 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -266,6 +266,27 @@
 static void
 rk_vop_dpms(struct drm_crtc *crtc, int mode)
 {
+       struct rk_vop_crtc *mixer_crtc = to_rk_vop_crtc(crtc);
+       struct rk_vop_softc * const sc = mixer_crtc->sc;
+       uint32_t val;
+
+       val = RD4(sc, VOP_SYS_CTRL);
+
+       switch (mode) {
+       case DRM_MODE_DPMS_ON:
+               val &= ~VOP_STANDBY_EN;
+               break;
+       case DRM_MODE_DPMS_STANDBY:
+       case DRM_MODE_DPMS_SUSPEND:
+       case DRM_MODE_DPMS_OFF:
+               val |= VOP_STANDBY_EN;
+               break;
+       }
+
+       WR4(sc, VOP_SYS_CTRL, val);
+
+       /* Commit settings */
+       WR4(sc, VOP_REG_CFG_DONE, REG_LOAD_EN);
 }
 
 static bool



Home | Main Index | Thread Index | Old Index