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 rkdrm: Turn display off and back on ag...



details:   https://anonhg.NetBSD.org/src/rev/6f8fd90f477b
branches:  trunk
changeset: 1029029:6f8fd90f477b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:45:19 2021 +0000

description:
rkdrm: Turn display off and back on again at config_interrupts.

This grody kludge works around whatever we're doing wrong in the
initial modeset that causes it not to take.

diffstat:

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

diffs (53 lines):

diff -r d2c163249a64 -r 6f8fd90f477b sys/arch/arm/rockchip/rk_fb.c
--- a/sys/arch/arm/rockchip/rk_fb.c     Sun Dec 19 12:45:12 2021 +0000
+++ b/sys/arch/arm/rockchip/rk_fb.c     Sun Dec 19 12:45:19 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_fb.c,v 1.5 2021/12/19 12:28:27 riastradh Exp $ */
+/* $NetBSD: rk_fb.c,v 1.6 2021/12/19 12:45:19 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2015-2019 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_wsdisplay_compat.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_fb.c,v 1.5 2021/12/19 12:28:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_fb.c,v 1.6 2021/12/19 12:45:19 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -99,6 +99,25 @@
 }
 
 static void
+rk_fb_turnoffandbackonagain(device_t self)
+{
+       struct rk_fb_softc *sc = device_private(self);
+       struct rk_drmfb_attach_args * const sfa = &sc->sc_sfa;
+
+       /*
+        * This is a grody kludge to turn the display off and back on
+        * again at boot; otherwise the initial modeset doesn't take.
+        * This is surely a bug somewhere in rk_vop.c or nearby, but I
+        * haven't been able to find it, and this gives us almost the
+        * same effect.
+        */
+       mutex_lock(&sfa->sfa_fb_helper->lock);
+       drm_client_modeset_dpms(&sfa->sfa_fb_helper->client, DRM_MODE_DPMS_OFF);
+       drm_client_modeset_dpms(&sfa->sfa_fb_helper->client, DRM_MODE_DPMS_ON);
+       mutex_unlock(&sfa->sfa_fb_helper->lock);
+}
+
+static void
 rk_fb_init(struct rk_drm_task *task)
 {
        struct rk_fb_softc * const sc =
@@ -123,6 +142,8 @@
        }
 
        pmf_device_register1(self, NULL, NULL, rk_fb_shutdown);
+
+       config_interrupts(self, rk_fb_turnoffandbackonagain);
 }
 
 static bool



Home | Main Index | Thread Index | Old Index