Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/rockchip in rk_vop_dpms() set or unset the VOP_...



details:   https://anonhg.NetBSD.org/src/rev/4f8c1fed298d
branches:  trunk
changeset: 466889:4f8c1fed298d
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Jan 05 12:14:35 2020 +0000

description:
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 6aad6885240e -r 4f8c1fed298d sys/arch/arm/rockchip/rk_vop.c
--- a/sys/arch/arm/rockchip/rk_vop.c    Sun Jan 05 08:11:10 2020 +0000
+++ b/sys/arch/arm/rockchip/rk_vop.c    Sun Jan 05 12:14:35 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_vop.c,v 1.5 2019/12/17 18:30:51 jakllsch Exp $ */
+/* $NetBSD: rk_vop.c,v 1.6 2020/01/05 12:14:35 mrg 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.5 2019/12/17 18:30:51 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.6 2020/01/05 12:14:35 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -265,6 +265,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