Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Emit PMFE_DISPLAY_{ON,OFF} events in response to ...



details:   https://anonhg.NetBSD.org/src/rev/03d17becba68
branches:  trunk
changeset: 968156:03d17becba68
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jan 04 12:08:32 2020 +0000

description:
Emit PMFE_DISPLAY_{ON,OFF} events in response to DPMS requests.

diffstat:

 sys/arch/arm/rockchip/rk_anxdp.c |  13 +++++++++++--
 sys/dev/ic/anx_dp.c              |  19 +++++++++++++++++--
 sys/dev/ic/anx_dp.h              |   4 +++-
 3 files changed, 31 insertions(+), 5 deletions(-)

diffs (97 lines):

diff -r 1337ffd1ec53 -r 03d17becba68 sys/arch/arm/rockchip/rk_anxdp.c
--- a/sys/arch/arm/rockchip/rk_anxdp.c  Sat Jan 04 09:50:20 2020 +0000
+++ b/sys/arch/arm/rockchip/rk_anxdp.c  Sat Jan 04 12:08:32 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_anxdp.c,v 1.1 2019/12/19 00:25:59 jakllsch Exp $ */
+/* $NetBSD: rk_anxdp.c,v 1.2 2020/01/04 12:08:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jonathan A. Kollasch <jakllsch%kollasch.net@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_anxdp.c,v 1.1 2019/12/19 00:25:59 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_anxdp.c,v 1.2 2020/01/04 12:08:32 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -122,6 +122,14 @@
 {
 }
 
+static void
+rk_anxdp_encoder_dpms(struct drm_encoder *encoder, int mode)
+{
+       struct rk_anxdp_softc * const sc = to_rk_anxdp_encoder(encoder);
+
+       anxdp_dpms(&sc->sc_base, mode);
+}
+
 static const struct drm_encoder_funcs rk_anxdp_encoder_funcs = {
        .destroy = drm_encoder_cleanup,
 };
@@ -133,6 +141,7 @@
        .enable = rk_anxdp_encoder_enable,
        .disable = rk_anxdp_encoder_disable,
        .commit = rk_anxdp_encoder_commit,
+       .dpms = rk_anxdp_encoder_dpms,
 };
 
 static int
diff -r 1337ffd1ec53 -r 03d17becba68 sys/dev/ic/anx_dp.c
--- a/sys/dev/ic/anx_dp.c       Sat Jan 04 09:50:20 2020 +0000
+++ b/sys/dev/ic/anx_dp.c       Sat Jan 04 12:08:32 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: anx_dp.c,v 1.1 2019/12/19 00:23:57 jakllsch Exp $ */
+/* $NetBSD: anx_dp.c,v 1.2 2020/01/04 12:08:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jonathan A. Kollasch <jakllsch%kollasch.net@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: anx_dp.c,v 1.1 2019/12/19 00:23:57 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: anx_dp.c,v 1.2 2020/01/04 12:08:32 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -991,6 +991,21 @@
        return ret;
 }
 
+void
+anxdp_dpms(struct anxdp_softc *sc, int mode)
+{
+       switch (mode) {
+       case DRM_MODE_DPMS_ON:
+               pmf_event_inject(NULL, PMFE_DISPLAY_ON);
+               break;
+       case DRM_MODE_DPMS_STANDBY:
+       case DRM_MODE_DPMS_SUSPEND:
+       case DRM_MODE_DPMS_OFF:
+               pmf_event_inject(NULL, PMFE_DISPLAY_OFF);
+               break;
+       }
+}
+
 int
 anxdp_attach(struct anxdp_softc *sc)
 {
diff -r 1337ffd1ec53 -r 03d17becba68 sys/dev/ic/anx_dp.h
--- a/sys/dev/ic/anx_dp.h       Sat Jan 04 09:50:20 2020 +0000
+++ b/sys/dev/ic/anx_dp.h       Sat Jan 04 12:08:32 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: anx_dp.h,v 1.1 2019/12/19 00:23:57 jakllsch Exp $ */
+/* $NetBSD: anx_dp.h,v 1.2 2020/01/04 12:08:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jonathan A. Kollasch <jakllsch%kollasch.net@localhost>
@@ -74,4 +74,6 @@
 int            anxdp_attach(struct anxdp_softc *);
 int            anxdp_bind(struct anxdp_softc *, struct drm_encoder *);
 
+void           anxdp_dpms(struct anxdp_softc *, int);
+
 #endif /* !_DEV_IC_ANXDP_H */



Home | Main Index | Thread Index | Old Index